@skyux/core 5.7.2 → 6.0.0-beta.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/documentation.json +4 -4
- package/esm2020/index.mjs +60 -0
- package/esm2020/lib/modules/adapter-service/adapter.module.mjs +16 -0
- package/esm2020/lib/modules/adapter-service/adapter.service.mjs +218 -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 +349 -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 +23 -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 +41 -0
- package/esm2020/lib/modules/numeric/numeric.pipe.mjs +82 -0
- package/esm2020/lib/modules/numeric/numeric.service.mjs +188 -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/scrollable-host/scrollable-host.service.mjs +184 -0
- package/esm2020/lib/modules/shared/number-format/number-format-utility.mjs +72 -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 +3043 -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} +134 -150
- package/fesm2020/skyux-core.mjs.map +1 -0
- package/package.json +36 -12
- package/testing/package.json +5 -5
- package/bundles/skyux-core-testing.umd.js +0 -459
- package/bundles/skyux-core.umd.js +0 -3648
- package/esm2015/index.js +0 -60
- 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 -218
- 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/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,3648 +0,0 @@
|
|
1
|
-
(function (global, factory) {
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('rxjs'), require('rxjs/operators'), require('@skyux/i18n'), require('@angular/router'), require('@angular/platform-browser')) :
|
3
|
-
typeof define === 'function' && define.amd ? define('@skyux/core', ['exports', '@angular/core', '@angular/common', 'rxjs', 'rxjs/operators', '@skyux/i18n', '@angular/router', '@angular/platform-browser'], factory) :
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.skyux = global.skyux || {}, global.skyux.core = {}), global.ng.core, global.ng.common, global.rxjs, global.rxjs.operators, global.i1, global.ng.router, global.ng.platformBrowser));
|
5
|
-
})(this, (function (exports, i0, i4, rxjs, operators, i1, i3, i1$1) { 'use strict';
|
6
|
-
|
7
|
-
function _interopNamespace(e) {
|
8
|
-
if (e && e.__esModule) return e;
|
9
|
-
var n = Object.create(null);
|
10
|
-
if (e) {
|
11
|
-
Object.keys(e).forEach(function (k) {
|
12
|
-
if (k !== 'default') {
|
13
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
14
|
-
Object.defineProperty(n, k, d.get ? d : {
|
15
|
-
enumerable: true,
|
16
|
-
get: function () { return e[k]; }
|
17
|
-
});
|
18
|
-
}
|
19
|
-
});
|
20
|
-
}
|
21
|
-
n["default"] = e;
|
22
|
-
return Object.freeze(n);
|
23
|
-
}
|
24
|
-
|
25
|
-
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
26
|
-
var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
|
27
|
-
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
28
|
-
var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
|
29
|
-
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
30
|
-
|
31
|
-
/**
|
32
|
-
* @deprecated The `SkyCoreAdapterService` no longer needs the `SkyCoreAdapterModule`.
|
33
|
-
* The `SkyCoreAdapterModule` can be removed from your project.
|
34
|
-
*/
|
35
|
-
var SkyCoreAdapterModule = /** @class */ (function () {
|
36
|
-
function SkyCoreAdapterModule() {
|
37
|
-
}
|
38
|
-
return SkyCoreAdapterModule;
|
39
|
-
}());
|
40
|
-
SkyCoreAdapterModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCoreAdapterModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
41
|
-
SkyCoreAdapterModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCoreAdapterModule });
|
42
|
-
SkyCoreAdapterModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCoreAdapterModule });
|
43
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCoreAdapterModule, decorators: [{
|
44
|
-
type: i0.NgModule,
|
45
|
-
args: [{}]
|
46
|
-
}] });
|
47
|
-
|
48
|
-
exports.SkyMediaBreakpoints = void 0;
|
49
|
-
(function (SkyMediaBreakpoints) {
|
50
|
-
/**
|
51
|
-
* Indicates screen widths of 767px or less.
|
52
|
-
*/
|
53
|
-
SkyMediaBreakpoints[SkyMediaBreakpoints["xs"] = 1] = "xs";
|
54
|
-
/**
|
55
|
-
* Indicates screen widths of 768px to 991px.
|
56
|
-
*/
|
57
|
-
SkyMediaBreakpoints[SkyMediaBreakpoints["sm"] = 2] = "sm";
|
58
|
-
/**
|
59
|
-
* Indicates screen widths of 992px to 1199px.
|
60
|
-
*/
|
61
|
-
SkyMediaBreakpoints[SkyMediaBreakpoints["md"] = 3] = "md";
|
62
|
-
/**
|
63
|
-
* Indicates screen widths of 1200px or greater.
|
64
|
-
*/
|
65
|
-
SkyMediaBreakpoints[SkyMediaBreakpoints["lg"] = 4] = "lg";
|
66
|
-
})(exports.SkyMediaBreakpoints || (exports.SkyMediaBreakpoints = {}));
|
67
|
-
|
68
|
-
var SKY_TABBABLE_SELECTOR = [
|
69
|
-
'a[href]',
|
70
|
-
'area[href]',
|
71
|
-
'input:not([disabled])',
|
72
|
-
'button:not([disabled])',
|
73
|
-
'select:not([disabled])',
|
74
|
-
'textarea:not([disabled])',
|
75
|
-
'iframe',
|
76
|
-
'object',
|
77
|
-
'embed',
|
78
|
-
'*[contenteditable=true]:not([disabled])',
|
79
|
-
'*[tabindex]:not([disabled])',
|
80
|
-
].join(', ');
|
81
|
-
var SkyCoreAdapterService = /** @class */ (function () {
|
82
|
-
function SkyCoreAdapterService(rendererFactory) {
|
83
|
-
this.rendererFactory = rendererFactory;
|
84
|
-
this.renderer = this.rendererFactory.createRenderer(undefined, undefined);
|
85
|
-
}
|
86
|
-
/**
|
87
|
-
* Set the responsive container CSS class for a given element.
|
88
|
-
*
|
89
|
-
* @param elementRef - The element that will recieve the new CSS class.
|
90
|
-
* @param breakpoint - The SkyMediaBreakpoint will determine which class
|
91
|
-
* gets set. For example a SkyMediaBreakpoint of `xs` will set a CSS class of `sky-responsive-container-xs`.
|
92
|
-
*/
|
93
|
-
SkyCoreAdapterService.prototype.setResponsiveContainerClass = function (elementRef, breakpoint) {
|
94
|
-
var nativeEl = elementRef.nativeElement;
|
95
|
-
this.renderer.removeClass(nativeEl, 'sky-responsive-container-xs');
|
96
|
-
this.renderer.removeClass(nativeEl, 'sky-responsive-container-sm');
|
97
|
-
this.renderer.removeClass(nativeEl, 'sky-responsive-container-md');
|
98
|
-
this.renderer.removeClass(nativeEl, 'sky-responsive-container-lg');
|
99
|
-
var newClass;
|
100
|
-
switch (breakpoint) {
|
101
|
-
case exports.SkyMediaBreakpoints.xs: {
|
102
|
-
newClass = 'sky-responsive-container-xs';
|
103
|
-
break;
|
104
|
-
}
|
105
|
-
case exports.SkyMediaBreakpoints.sm: {
|
106
|
-
newClass = 'sky-responsive-container-sm';
|
107
|
-
break;
|
108
|
-
}
|
109
|
-
case exports.SkyMediaBreakpoints.md: {
|
110
|
-
newClass = 'sky-responsive-container-md';
|
111
|
-
break;
|
112
|
-
}
|
113
|
-
default: {
|
114
|
-
newClass = 'sky-responsive-container-lg';
|
115
|
-
break;
|
116
|
-
}
|
117
|
-
}
|
118
|
-
this.renderer.addClass(nativeEl, newClass);
|
119
|
-
};
|
120
|
-
/**
|
121
|
-
* This method temporarily enables/disables pointer events.
|
122
|
-
* This is helpful to prevent iFrames from interfering with drag events.
|
123
|
-
*
|
124
|
-
* @param enable - Set to `true` to enable pointer events. Set to `false` to disable.
|
125
|
-
*/
|
126
|
-
SkyCoreAdapterService.prototype.toggleIframePointerEvents = function (enable) {
|
127
|
-
var iframes = document.querySelectorAll('iframe');
|
128
|
-
for (var i = 0; i < iframes.length; i++) {
|
129
|
-
// Setting to empty string will allow iframe to fall back to its prior CSS assignment.
|
130
|
-
iframes[i].style.pointerEvents = enable ? '' : 'none';
|
131
|
-
}
|
132
|
-
};
|
133
|
-
/**
|
134
|
-
* Focuses on the first element found with an `autofocus` attribute inside the supplied `elementRef`.
|
135
|
-
*
|
136
|
-
* @param elementRef - The element to search within.
|
137
|
-
* @return Returns `true` if a child element with autofocus is found.
|
138
|
-
*/
|
139
|
-
SkyCoreAdapterService.prototype.applyAutoFocus = function (elementRef) {
|
140
|
-
var elementWithAutoFocus = elementRef.nativeElement.querySelector('[autofocus]');
|
141
|
-
// Child was found with the autofocus property. Set focus and return true.
|
142
|
-
if (elementWithAutoFocus) {
|
143
|
-
elementWithAutoFocus.focus();
|
144
|
-
return true;
|
145
|
-
}
|
146
|
-
// No children were found with autofocus property. Return false.
|
147
|
-
return false;
|
148
|
-
};
|
149
|
-
/**
|
150
|
-
* Sets focus on the first focusable child of the `elementRef` parameter.
|
151
|
-
* If no focusable children are found, and `focusOnContainerIfNoChildrenFound` is `true`,
|
152
|
-
* focus will be set on the container element.
|
153
|
-
*
|
154
|
-
* @param elementRef - The element to search within.
|
155
|
-
* @param containerSelector - A CSS selector indicating the container that should
|
156
|
-
* recieve focus if no focusable children are found.
|
157
|
-
* @param focusOnContainerIfNoChildrenFound - It set to `true`, the container will
|
158
|
-
* recieve focus if no focusable children are found.
|
159
|
-
*/
|
160
|
-
SkyCoreAdapterService.prototype.getFocusableChildrenAndApplyFocus = function (elementRef, containerSelector, focusOnContainerIfNoChildrenFound) {
|
161
|
-
if (focusOnContainerIfNoChildrenFound === void 0) { focusOnContainerIfNoChildrenFound = false; }
|
162
|
-
var containerElement = elementRef.nativeElement.querySelector(containerSelector);
|
163
|
-
var focusableChildren = this.getFocusableChildren(containerElement);
|
164
|
-
// Focus first focusable child if available. Otherwise, set focus on container.
|
165
|
-
if (!this.focusFirstElement(focusableChildren) &&
|
166
|
-
focusOnContainerIfNoChildrenFound) {
|
167
|
-
containerElement.focus();
|
168
|
-
}
|
169
|
-
};
|
170
|
-
/**
|
171
|
-
* Returns an array of all focusable children of provided `element`.
|
172
|
-
*
|
173
|
-
* @param element - The HTMLElement to search within.
|
174
|
-
* @param options - Options for getting focusable children.
|
175
|
-
*/
|
176
|
-
SkyCoreAdapterService.prototype.getFocusableChildren = function (element, options) {
|
177
|
-
var _this = this;
|
178
|
-
var elements = Array.prototype.slice.call(element.querySelectorAll(SKY_TABBABLE_SELECTOR));
|
179
|
-
// Unless ignoreTabIndex = true, filter out elements with tabindex = -1.
|
180
|
-
if (!options || !options.ignoreTabIndex) {
|
181
|
-
elements = elements.filter(function (el) {
|
182
|
-
return el.tabIndex !== -1;
|
183
|
-
});
|
184
|
-
}
|
185
|
-
// Unless ignoreVisibility = true, filter out elements that are not visible.
|
186
|
-
if (!options || !options.ignoreVisibility) {
|
187
|
-
elements = elements.filter(function (el) {
|
188
|
-
return _this.isVisible(el);
|
189
|
-
});
|
190
|
-
}
|
191
|
-
return elements;
|
192
|
-
};
|
193
|
-
/**
|
194
|
-
* Returns the clientWidth of the provided elementRef.
|
195
|
-
* @param elementRef - The element to calculate width from.
|
196
|
-
*/
|
197
|
-
SkyCoreAdapterService.prototype.getWidth = function (elementRef) {
|
198
|
-
return elementRef.nativeElement.clientWidth;
|
199
|
-
};
|
200
|
-
/**
|
201
|
-
* Checks if an event target has a higher z-index than a given element.
|
202
|
-
* @param target The event target element.
|
203
|
-
* @param element The element to test against. A z-index must be explicitly set for this element.
|
204
|
-
*/
|
205
|
-
SkyCoreAdapterService.prototype.isTargetAboveElement = function (target, element) {
|
206
|
-
var zIndex = getComputedStyle(element).zIndex;
|
207
|
-
var el = target;
|
208
|
-
while (el) {
|
209
|
-
// Getting the computed style only works for elements that exist in the DOM.
|
210
|
-
// In certain scenarios, an element is removed after a click event; by the time the event
|
211
|
-
// bubbles up to other elements, however, the element has been removed and the computed style returns empty.
|
212
|
-
// In this case, we'll need to check the z-index directly, via the style property.
|
213
|
-
var targetZIndex = getComputedStyle(el).zIndex || el.style.zIndex;
|
214
|
-
if (targetZIndex !== '' &&
|
215
|
-
targetZIndex !== 'auto' &&
|
216
|
-
+targetZIndex > +zIndex) {
|
217
|
-
return true;
|
218
|
-
}
|
219
|
-
el = el.parentElement;
|
220
|
-
}
|
221
|
-
return false;
|
222
|
-
};
|
223
|
-
/**
|
224
|
-
* Remove inline height styles from the provided elements.
|
225
|
-
* @param elementRef - The element to search within.
|
226
|
-
* @param selector - The CSS selector to use when finding elements for removing height.
|
227
|
-
*/
|
228
|
-
SkyCoreAdapterService.prototype.resetHeight = function (elementRef, selector) {
|
229
|
-
var children = elementRef.nativeElement.querySelectorAll(selector);
|
230
|
-
/* istanbul ignore else */
|
231
|
-
if (children.length > 0) {
|
232
|
-
for (var i = 0; i < children.length; i++) {
|
233
|
-
// Setting style attributes with Web API requires null instead of undefined.
|
234
|
-
// tslint:disable-next-line: no-null-keyword
|
235
|
-
children[i].style.height = null;
|
236
|
-
}
|
237
|
-
}
|
238
|
-
};
|
239
|
-
/**
|
240
|
-
* Sets all element heights to match the height of the tallest element.
|
241
|
-
* @param elementRef - The element to search within.
|
242
|
-
* @param selector - The CSS selector to use when finding elements for syncing height.
|
243
|
-
*/
|
244
|
-
SkyCoreAdapterService.prototype.syncMaxHeight = function (elementRef, selector) {
|
245
|
-
var children = elementRef.nativeElement.querySelectorAll(selector);
|
246
|
-
/* istanbul ignore else */
|
247
|
-
if (children.length > 0) {
|
248
|
-
var maxHeight = 0;
|
249
|
-
for (var i = 0; i < children.length; i++) {
|
250
|
-
maxHeight = Math.max(maxHeight, children[i].offsetHeight);
|
251
|
-
}
|
252
|
-
for (var i = 0; i < children.length; i++) {
|
253
|
-
children[i].style.height = maxHeight + 'px';
|
254
|
-
}
|
255
|
-
}
|
256
|
-
};
|
257
|
-
SkyCoreAdapterService.prototype.focusFirstElement = function (list) {
|
258
|
-
if (list.length > 0) {
|
259
|
-
list[0].focus();
|
260
|
-
return true;
|
261
|
-
}
|
262
|
-
return false;
|
263
|
-
};
|
264
|
-
SkyCoreAdapterService.prototype.isVisible = function (element) {
|
265
|
-
var style = window.getComputedStyle(element);
|
266
|
-
var isHidden = style.display === 'none' || style.visibility === 'hidden';
|
267
|
-
if (isHidden) {
|
268
|
-
return false;
|
269
|
-
}
|
270
|
-
var hasBounds = !!(element.offsetWidth ||
|
271
|
-
element.offsetHeight ||
|
272
|
-
element.getClientRects().length);
|
273
|
-
return hasBounds;
|
274
|
-
};
|
275
|
-
return SkyCoreAdapterService;
|
276
|
-
}());
|
277
|
-
SkyCoreAdapterService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCoreAdapterService, deps: [{ token: i0__namespace.RendererFactory2 }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
278
|
-
SkyCoreAdapterService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCoreAdapterService, providedIn: 'root' });
|
279
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCoreAdapterService, decorators: [{
|
280
|
-
type: i0.Injectable,
|
281
|
-
args: [{
|
282
|
-
providedIn: 'root',
|
283
|
-
}]
|
284
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.RendererFactory2 }]; } });
|
285
|
-
|
286
|
-
exports.SkyAffixAutoFitContext = void 0;
|
287
|
-
(function (SkyAffixAutoFitContext) {
|
288
|
-
/**
|
289
|
-
* Auto-fit functionality will respect the nearest overflow parent element's dimensions.
|
290
|
-
*/
|
291
|
-
SkyAffixAutoFitContext[SkyAffixAutoFitContext["OverflowParent"] = 0] = "OverflowParent";
|
292
|
-
/**
|
293
|
-
* Auto-fit functionality will respect the browser viewport dimensions.
|
294
|
-
*/
|
295
|
-
SkyAffixAutoFitContext[SkyAffixAutoFitContext["Viewport"] = 1] = "Viewport";
|
296
|
-
})(exports.SkyAffixAutoFitContext || (exports.SkyAffixAutoFitContext = {}));
|
297
|
-
|
298
|
-
function getNextPlacement(placement) {
|
299
|
-
var placements = ['above', 'right', 'below', 'left'];
|
300
|
-
var index = placements.indexOf(placement) + 1;
|
301
|
-
if (index >= placements.length) {
|
302
|
-
index = 0;
|
303
|
-
}
|
304
|
-
return placements[index];
|
305
|
-
}
|
306
|
-
function getInversePlacement(placement) {
|
307
|
-
var pairings = {
|
308
|
-
above: 'below',
|
309
|
-
below: 'above',
|
310
|
-
right: 'left',
|
311
|
-
left: 'right',
|
312
|
-
};
|
313
|
-
return pairings[placement];
|
314
|
-
}
|
315
|
-
|
316
|
-
/**
|
317
|
-
* Returns the offset values of a given element.
|
318
|
-
* @param element The HTML element.
|
319
|
-
* @param bufferOffset An optional offset to add/subtract to the element's actual offset.
|
320
|
-
*/
|
321
|
-
function getElementOffset(element, bufferOffset) {
|
322
|
-
if (bufferOffset === void 0) { bufferOffset = {}; }
|
323
|
-
var bufferOffsetBottom = bufferOffset.bottom || 0;
|
324
|
-
var bufferOffsetLeft = bufferOffset.left || 0;
|
325
|
-
var bufferOffsetRight = bufferOffset.right || 0;
|
326
|
-
var bufferOffsetTop = bufferOffset.top || 0;
|
327
|
-
var top;
|
328
|
-
var left;
|
329
|
-
var right;
|
330
|
-
var bottom;
|
331
|
-
if (element === document.body) {
|
332
|
-
left = 0;
|
333
|
-
top = 0;
|
334
|
-
right = document.documentElement.clientWidth;
|
335
|
-
bottom = document.documentElement.clientHeight;
|
336
|
-
}
|
337
|
-
else {
|
338
|
-
var clientRect = element.getBoundingClientRect();
|
339
|
-
left = clientRect.left;
|
340
|
-
top = clientRect.top;
|
341
|
-
right = clientRect.right;
|
342
|
-
bottom = clientRect.bottom;
|
343
|
-
}
|
344
|
-
bottom -= bufferOffsetBottom;
|
345
|
-
left += bufferOffsetLeft;
|
346
|
-
right -= bufferOffsetRight;
|
347
|
-
top += bufferOffsetTop;
|
348
|
-
return {
|
349
|
-
bottom: bottom,
|
350
|
-
left: left,
|
351
|
-
right: right,
|
352
|
-
top: top,
|
353
|
-
};
|
354
|
-
}
|
355
|
-
function getOverflowParents(child) {
|
356
|
-
var bodyElement = window.document.body;
|
357
|
-
var results = [bodyElement];
|
358
|
-
var parentElement = child.parentNode;
|
359
|
-
while (parentElement !== undefined &&
|
360
|
-
parentElement !== bodyElement &&
|
361
|
-
parentElement instanceof HTMLElement) {
|
362
|
-
var overflowY = window
|
363
|
-
.getComputedStyle(parentElement, undefined)
|
364
|
-
.overflowY.toLowerCase();
|
365
|
-
if (overflowY === 'auto' ||
|
366
|
-
overflowY === 'hidden' ||
|
367
|
-
overflowY === 'scroll') {
|
368
|
-
results.push(parentElement);
|
369
|
-
}
|
370
|
-
parentElement = parentElement.parentNode;
|
371
|
-
}
|
372
|
-
return results;
|
373
|
-
}
|
374
|
-
/**
|
375
|
-
* Confirms offset is fully visible within a parent element.
|
376
|
-
* @param parent
|
377
|
-
* @param offset
|
378
|
-
*/
|
379
|
-
function isOffsetFullyVisibleWithinParent(parent, offset, bufferOffset) {
|
380
|
-
var parentOffset = getElementOffset(parent, bufferOffset);
|
381
|
-
return !(parentOffset.top > offset.top ||
|
382
|
-
parentOffset.right < offset.right ||
|
383
|
-
parentOffset.bottom < offset.bottom ||
|
384
|
-
parentOffset.left > offset.left);
|
385
|
-
}
|
386
|
-
function isOffsetPartiallyVisibleWithinParent(parent, offset, bufferOffset) {
|
387
|
-
var parentOffset = getElementOffset(parent, bufferOffset);
|
388
|
-
return !(parentOffset.top >= offset.bottom ||
|
389
|
-
parentOffset.right <= offset.left ||
|
390
|
-
parentOffset.bottom <= offset.top ||
|
391
|
-
parentOffset.left >= offset.right);
|
392
|
-
}
|
393
|
-
|
394
|
-
var DEFAULT_AFFIX_CONFIG = {
|
395
|
-
autoFitContext: exports.SkyAffixAutoFitContext.OverflowParent,
|
396
|
-
enableAutoFit: false,
|
397
|
-
horizontalAlignment: 'center',
|
398
|
-
isSticky: false,
|
399
|
-
placement: 'above',
|
400
|
-
};
|
401
|
-
var SkyAffixer = /** @class */ (function () {
|
402
|
-
function SkyAffixer(affixedElement, renderer) {
|
403
|
-
this.affixedElement = affixedElement;
|
404
|
-
this.renderer = renderer;
|
405
|
-
this._offsetChange = new rxjs.Subject();
|
406
|
-
this._overflowScroll = new rxjs.Subject();
|
407
|
-
this._placementChange = new rxjs.Subject();
|
408
|
-
}
|
409
|
-
Object.defineProperty(SkyAffixer.prototype, "offsetChange", {
|
410
|
-
/**
|
411
|
-
* Fires when the affixed element's offset changes.
|
412
|
-
*/
|
413
|
-
get: function () {
|
414
|
-
return this._offsetChange.asObservable();
|
415
|
-
},
|
416
|
-
enumerable: false,
|
417
|
-
configurable: true
|
418
|
-
});
|
419
|
-
Object.defineProperty(SkyAffixer.prototype, "overflowScroll", {
|
420
|
-
/**
|
421
|
-
* Fires when the base element's nearest overflow parent is scrolling. This is useful if you need
|
422
|
-
* to perform an additional action during the scroll event but don't want to generate another
|
423
|
-
* event listener.
|
424
|
-
*/
|
425
|
-
get: function () {
|
426
|
-
return this._overflowScroll.asObservable();
|
427
|
-
},
|
428
|
-
enumerable: false,
|
429
|
-
configurable: true
|
430
|
-
});
|
431
|
-
Object.defineProperty(SkyAffixer.prototype, "placementChange", {
|
432
|
-
/**
|
433
|
-
* Fires when the placement value changes. A `null` value indicates that a suitable
|
434
|
-
* placement could not be found.
|
435
|
-
*/
|
436
|
-
get: function () {
|
437
|
-
return this._placementChange.asObservable();
|
438
|
-
},
|
439
|
-
enumerable: false,
|
440
|
-
configurable: true
|
441
|
-
});
|
442
|
-
Object.defineProperty(SkyAffixer.prototype, "config", {
|
443
|
-
get: function () {
|
444
|
-
return this._config;
|
445
|
-
},
|
446
|
-
set: function (value) {
|
447
|
-
var merged = Object.assign(Object.assign({}, DEFAULT_AFFIX_CONFIG), value);
|
448
|
-
// Make sure none of the values are undefined.
|
449
|
-
Object.keys(merged).forEach(function (k) {
|
450
|
-
if (merged[k] === undefined) {
|
451
|
-
merged[k] = DEFAULT_AFFIX_CONFIG[k];
|
452
|
-
}
|
453
|
-
});
|
454
|
-
this._config = merged;
|
455
|
-
},
|
456
|
-
enumerable: false,
|
457
|
-
configurable: true
|
458
|
-
});
|
459
|
-
/**
|
460
|
-
* Affixes an element to a base element.
|
461
|
-
* @param baseElement The base element.
|
462
|
-
* @param config Configuration for the affix action.
|
463
|
-
*/
|
464
|
-
SkyAffixer.prototype.affixTo = function (baseElement, config) {
|
465
|
-
this.reset();
|
466
|
-
this.config = config;
|
467
|
-
this.baseElement = baseElement;
|
468
|
-
this.overflowParents = getOverflowParents(baseElement);
|
469
|
-
this.affix();
|
470
|
-
if (this.config.isSticky) {
|
471
|
-
this.addScrollListeners();
|
472
|
-
this.addResizeListener();
|
473
|
-
}
|
474
|
-
};
|
475
|
-
/**
|
476
|
-
* Re-runs the affix calculation.
|
477
|
-
*/
|
478
|
-
SkyAffixer.prototype.reaffix = function () {
|
479
|
-
// Reset current placement to preferred placement.
|
480
|
-
this.currentPlacement = this.config.placement;
|
481
|
-
this.affix();
|
482
|
-
};
|
483
|
-
/**
|
484
|
-
* Destroys the affixer.
|
485
|
-
*/
|
486
|
-
SkyAffixer.prototype.destroy = function () {
|
487
|
-
this.reset();
|
488
|
-
this._placementChange.complete();
|
489
|
-
this._offsetChange.complete();
|
490
|
-
this._overflowScroll.complete();
|
491
|
-
this._offsetChange =
|
492
|
-
this._placementChange =
|
493
|
-
this._overflowScroll =
|
494
|
-
undefined;
|
495
|
-
};
|
496
|
-
SkyAffixer.prototype.affix = function () {
|
497
|
-
this.baseRect = this.baseElement.getBoundingClientRect();
|
498
|
-
this.affixedRect = this.affixedElement.getBoundingClientRect();
|
499
|
-
var offset = this.getOffset();
|
500
|
-
if (this.isNewOffset(offset)) {
|
501
|
-
this.renderer.setStyle(this.affixedElement, 'top', offset.top + "px");
|
502
|
-
this.renderer.setStyle(this.affixedElement, 'left', offset.left + "px");
|
503
|
-
this._offsetChange.next({ offset: offset });
|
504
|
-
}
|
505
|
-
};
|
506
|
-
SkyAffixer.prototype.getOffset = function () {
|
507
|
-
var parent = this.getAutoFitContextParent();
|
508
|
-
var maxAttempts = 4;
|
509
|
-
var attempts = 0;
|
510
|
-
var isAffixedElementFullyVisible = false;
|
511
|
-
var offset;
|
512
|
-
var placement = this.config.placement;
|
513
|
-
do {
|
514
|
-
offset = this.getPreferredOffset(placement);
|
515
|
-
isAffixedElementFullyVisible = isOffsetFullyVisibleWithinParent(parent, offset, this.config.autoFitOverflowOffset);
|
516
|
-
if (!this.config.enableAutoFit) {
|
517
|
-
break;
|
518
|
-
}
|
519
|
-
if (!isAffixedElementFullyVisible) {
|
520
|
-
placement =
|
521
|
-
attempts % 2 === 0
|
522
|
-
? getInversePlacement(placement)
|
523
|
-
: getNextPlacement(placement);
|
524
|
-
}
|
525
|
-
attempts++;
|
526
|
-
} while (!isAffixedElementFullyVisible && attempts < maxAttempts);
|
527
|
-
if (isAffixedElementFullyVisible) {
|
528
|
-
if (this.isBaseElementVisible()) {
|
529
|
-
this.notifyPlacementChange(placement);
|
530
|
-
}
|
531
|
-
else {
|
532
|
-
/* tslint:disable-next-line:no-null-keyword */
|
533
|
-
this.notifyPlacementChange(null);
|
534
|
-
}
|
535
|
-
return offset;
|
536
|
-
}
|
537
|
-
if (this.config.enableAutoFit) {
|
538
|
-
/* tslint:disable-next-line:no-null-keyword */
|
539
|
-
this.notifyPlacementChange(null);
|
540
|
-
}
|
541
|
-
// No suitable placement was found, so revert to preferred placement.
|
542
|
-
return this.getPreferredOffset(this.config.placement);
|
543
|
-
};
|
544
|
-
SkyAffixer.prototype.getPreferredOffset = function (placement) {
|
545
|
-
var affixedRect = this.affixedRect;
|
546
|
-
var baseRect = this.baseRect;
|
547
|
-
var horizontalAlignment = this.config.horizontalAlignment;
|
548
|
-
var verticalAlignment = this.config.verticalAlignment;
|
549
|
-
var enableAutoFit = this.config.enableAutoFit;
|
550
|
-
var top;
|
551
|
-
var left;
|
552
|
-
if (placement === 'above' || placement === 'below') {
|
553
|
-
if (placement === 'above') {
|
554
|
-
top = baseRect.top - affixedRect.height;
|
555
|
-
switch (verticalAlignment) {
|
556
|
-
case 'top':
|
557
|
-
top = top + affixedRect.height;
|
558
|
-
break;
|
559
|
-
case 'middle':
|
560
|
-
top = top + affixedRect.height / 2;
|
561
|
-
break;
|
562
|
-
case 'bottom':
|
563
|
-
default:
|
564
|
-
break;
|
565
|
-
}
|
566
|
-
}
|
567
|
-
else {
|
568
|
-
top = baseRect.bottom;
|
569
|
-
switch (verticalAlignment) {
|
570
|
-
case 'top':
|
571
|
-
default:
|
572
|
-
break;
|
573
|
-
case 'middle':
|
574
|
-
top = top - affixedRect.height / 2;
|
575
|
-
break;
|
576
|
-
case 'bottom':
|
577
|
-
top = top - affixedRect.height;
|
578
|
-
break;
|
579
|
-
}
|
580
|
-
}
|
581
|
-
switch (horizontalAlignment) {
|
582
|
-
case 'left':
|
583
|
-
left = baseRect.left;
|
584
|
-
break;
|
585
|
-
case 'center':
|
586
|
-
default:
|
587
|
-
left = baseRect.left + baseRect.width / 2 - affixedRect.width / 2;
|
588
|
-
break;
|
589
|
-
case 'right':
|
590
|
-
left = baseRect.right - affixedRect.width;
|
591
|
-
break;
|
592
|
-
}
|
593
|
-
}
|
594
|
-
else {
|
595
|
-
if (placement === 'left') {
|
596
|
-
left = baseRect.left - affixedRect.width;
|
597
|
-
}
|
598
|
-
else {
|
599
|
-
left = baseRect.right;
|
600
|
-
}
|
601
|
-
switch (verticalAlignment) {
|
602
|
-
case 'top':
|
603
|
-
top = baseRect.top;
|
604
|
-
break;
|
605
|
-
case 'middle':
|
606
|
-
default:
|
607
|
-
top = baseRect.top + baseRect.height / 2 - affixedRect.height / 2;
|
608
|
-
break;
|
609
|
-
case 'bottom':
|
610
|
-
top = baseRect.bottom - affixedRect.height;
|
611
|
-
break;
|
612
|
-
}
|
613
|
-
}
|
614
|
-
var offset = { left: left, top: top };
|
615
|
-
if (enableAutoFit) {
|
616
|
-
offset = this.adjustOffsetToOverflowParent(Object.assign({}, offset), placement);
|
617
|
-
}
|
618
|
-
offset.bottom = offset.top + affixedRect.height;
|
619
|
-
offset.right = offset.left + affixedRect.width;
|
620
|
-
return offset;
|
621
|
-
};
|
622
|
-
/**
|
623
|
-
* Slightly adjust the offset to fit within the scroll parent's boundaries if
|
624
|
-
* the affixed element would otherwise be clipped.
|
625
|
-
*/
|
626
|
-
SkyAffixer.prototype.adjustOffsetToOverflowParent = function (offset, placement) {
|
627
|
-
var parent = this.getAutoFitContextParent();
|
628
|
-
var parentOffset = getElementOffset(parent, this.config.autoFitOverflowOffset);
|
629
|
-
var affixedRect = this.affixedRect;
|
630
|
-
var baseRect = this.baseRect;
|
631
|
-
// A pixel value representing the leeway between the edge of the overflow parent and the edge
|
632
|
-
// of the base element before it dissapears from view.
|
633
|
-
// If the visible portion of the base element is less than this pixel value, the auto-fit
|
634
|
-
// functionality attempts to find another placement.
|
635
|
-
var defaultPixelTolerance = 40;
|
636
|
-
var pixelTolerance;
|
637
|
-
var originalOffsetTop = offset.top;
|
638
|
-
var originalOffsetLeft = offset.left;
|
639
|
-
/* tslint:disable-next-line:switch-default */
|
640
|
-
switch (placement) {
|
641
|
-
case 'above':
|
642
|
-
case 'below':
|
643
|
-
// Keep the affixed element within the overflow parent.
|
644
|
-
if (offset.left < parentOffset.left) {
|
645
|
-
offset.left = parentOffset.left;
|
646
|
-
}
|
647
|
-
else if (offset.left + affixedRect.width > parentOffset.right) {
|
648
|
-
offset.left = parentOffset.right - affixedRect.width;
|
649
|
-
}
|
650
|
-
// Use a smaller pixel tolerance if the base element width is less than the default.
|
651
|
-
pixelTolerance = Math.min(defaultPixelTolerance, baseRect.width);
|
652
|
-
// Make sure the affixed element never detaches from the base element.
|
653
|
-
if (offset.left + pixelTolerance > baseRect.right ||
|
654
|
-
offset.left + affixedRect.width - pixelTolerance < baseRect.left) {
|
655
|
-
offset.left = originalOffsetLeft;
|
656
|
-
}
|
657
|
-
break;
|
658
|
-
case 'left':
|
659
|
-
case 'right':
|
660
|
-
// Keep the affixed element within the overflow parent.
|
661
|
-
if (offset.top < parentOffset.top) {
|
662
|
-
offset.top = parentOffset.top;
|
663
|
-
}
|
664
|
-
else if (offset.top + affixedRect.height > parentOffset.bottom) {
|
665
|
-
offset.top = parentOffset.bottom - affixedRect.height;
|
666
|
-
}
|
667
|
-
// Use a smaller pixel tolerance if the base element height is less than the default.
|
668
|
-
pixelTolerance = Math.min(defaultPixelTolerance, baseRect.height);
|
669
|
-
// Make sure the affixed element never detaches from the base element.
|
670
|
-
if (offset.top + pixelTolerance > baseRect.bottom ||
|
671
|
-
offset.top + affixedRect.height - pixelTolerance < baseRect.top) {
|
672
|
-
offset.top = originalOffsetTop;
|
673
|
-
}
|
674
|
-
break;
|
675
|
-
}
|
676
|
-
return offset;
|
677
|
-
};
|
678
|
-
SkyAffixer.prototype.getImmediateOverflowParent = function () {
|
679
|
-
return this.overflowParents[this.overflowParents.length - 1];
|
680
|
-
};
|
681
|
-
SkyAffixer.prototype.getAutoFitContextParent = function () {
|
682
|
-
var bodyElement = this.overflowParents[0];
|
683
|
-
return this.config.autoFitContext === exports.SkyAffixAutoFitContext.OverflowParent
|
684
|
-
? this.getImmediateOverflowParent()
|
685
|
-
: bodyElement;
|
686
|
-
};
|
687
|
-
SkyAffixer.prototype.notifyPlacementChange = function (placement) {
|
688
|
-
if (this.currentPlacement !== placement) {
|
689
|
-
this.currentPlacement = placement;
|
690
|
-
this._placementChange.next({
|
691
|
-
placement: placement,
|
692
|
-
});
|
693
|
-
}
|
694
|
-
};
|
695
|
-
SkyAffixer.prototype.reset = function () {
|
696
|
-
this.removeScrollListeners();
|
697
|
-
this.removeResizeListener();
|
698
|
-
this._config =
|
699
|
-
this.affixedRect =
|
700
|
-
this.baseElement =
|
701
|
-
this.baseRect =
|
702
|
-
this.currentPlacement =
|
703
|
-
this.currentOffset =
|
704
|
-
this.overflowParents =
|
705
|
-
undefined;
|
706
|
-
};
|
707
|
-
SkyAffixer.prototype.isNewOffset = function (offset) {
|
708
|
-
if (this.currentOffset === undefined) {
|
709
|
-
this.currentOffset = offset;
|
710
|
-
return true;
|
711
|
-
}
|
712
|
-
if (this.currentOffset.top === offset.top &&
|
713
|
-
this.currentOffset.left === offset.left) {
|
714
|
-
return false;
|
715
|
-
}
|
716
|
-
this.currentOffset = offset;
|
717
|
-
return true;
|
718
|
-
};
|
719
|
-
SkyAffixer.prototype.isBaseElementVisible = function () {
|
720
|
-
return isOffsetPartiallyVisibleWithinParent(this.getImmediateOverflowParent(), {
|
721
|
-
top: this.baseRect.top,
|
722
|
-
left: this.baseRect.left,
|
723
|
-
right: this.baseRect.right,
|
724
|
-
bottom: this.baseRect.bottom,
|
725
|
-
}, this.config.autoFitOverflowOffset);
|
726
|
-
};
|
727
|
-
SkyAffixer.prototype.addScrollListeners = function () {
|
728
|
-
var _this = this;
|
729
|
-
this.scrollListeners = this.overflowParents.map(function (parentElement) {
|
730
|
-
var overflow = parentElement === document.body ? 'window' : parentElement;
|
731
|
-
return _this.renderer.listen(overflow, 'scroll', function () {
|
732
|
-
_this.affix();
|
733
|
-
_this._overflowScroll.next();
|
734
|
-
});
|
735
|
-
});
|
736
|
-
};
|
737
|
-
SkyAffixer.prototype.addResizeListener = function () {
|
738
|
-
var _this = this;
|
739
|
-
this.resizeListener = rxjs.fromEvent(window, 'resize').subscribe(function () { return _this.affix(); });
|
740
|
-
};
|
741
|
-
SkyAffixer.prototype.removeResizeListener = function () {
|
742
|
-
if (this.resizeListener) {
|
743
|
-
this.resizeListener.unsubscribe();
|
744
|
-
this.resizeListener = undefined;
|
745
|
-
}
|
746
|
-
};
|
747
|
-
SkyAffixer.prototype.removeScrollListeners = function () {
|
748
|
-
if (this.scrollListeners) {
|
749
|
-
// Remove renderer-generated listeners by calling the listener itself.
|
750
|
-
// https://github.com/angular/angular/issues/9368#issuecomment-227199778
|
751
|
-
this.scrollListeners.forEach(function (listener) { return listener(); });
|
752
|
-
this.scrollListeners = undefined;
|
753
|
-
}
|
754
|
-
};
|
755
|
-
return SkyAffixer;
|
756
|
-
}());
|
757
|
-
|
758
|
-
var SkyAffixService = /** @class */ (function () {
|
759
|
-
function SkyAffixService(rendererFactory) {
|
760
|
-
this.renderer = rendererFactory.createRenderer(undefined, undefined);
|
761
|
-
}
|
762
|
-
/**
|
763
|
-
* Creates an instance of [[SkyAffixer]].
|
764
|
-
* @param affixed The element to be affixed.
|
765
|
-
*/
|
766
|
-
SkyAffixService.prototype.createAffixer = function (affixed) {
|
767
|
-
return new SkyAffixer(affixed.nativeElement, this.renderer);
|
768
|
-
};
|
769
|
-
return SkyAffixService;
|
770
|
-
}());
|
771
|
-
SkyAffixService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAffixService, deps: [{ token: i0__namespace.RendererFactory2 }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
772
|
-
SkyAffixService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAffixService, providedIn: 'root' });
|
773
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAffixService, decorators: [{
|
774
|
-
type: i0.Injectable,
|
775
|
-
args: [{
|
776
|
-
providedIn: 'root',
|
777
|
-
}]
|
778
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.RendererFactory2 }]; } });
|
779
|
-
|
780
|
-
/**
|
781
|
-
* Affixes the host element to a base element.
|
782
|
-
*/
|
783
|
-
var SkyAffixDirective = /** @class */ (function () {
|
784
|
-
function SkyAffixDirective(elementRef, affixService) {
|
785
|
-
var _this = this;
|
786
|
-
this.affixService = affixService;
|
787
|
-
/**
|
788
|
-
* Fires when the affixed element's offset changes.
|
789
|
-
*/
|
790
|
-
this.affixOffsetChange = new i0.EventEmitter();
|
791
|
-
/**
|
792
|
-
* Fires when the affixed element's overflow container is scrolled.
|
793
|
-
*/
|
794
|
-
this.affixOverflowScroll = new i0.EventEmitter();
|
795
|
-
/**
|
796
|
-
* Fires when the placement value changes.
|
797
|
-
*/
|
798
|
-
this.affixPlacementChange = new i0.EventEmitter();
|
799
|
-
this.ngUnsubscribe = new rxjs.Subject();
|
800
|
-
this.affixer = this.affixService.createAffixer(elementRef);
|
801
|
-
this.affixer.offsetChange
|
802
|
-
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
803
|
-
.subscribe(function (change) { return _this.affixOffsetChange.emit(change); });
|
804
|
-
this.affixer.overflowScroll
|
805
|
-
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
806
|
-
.subscribe(function (change) { return _this.affixOverflowScroll.emit(change); });
|
807
|
-
this.affixer.placementChange
|
808
|
-
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
809
|
-
.subscribe(function (change) { return _this.affixPlacementChange.emit(change); });
|
810
|
-
}
|
811
|
-
SkyAffixDirective.prototype.ngOnChanges = function (changes) {
|
812
|
-
/* istanbul ignore else */
|
813
|
-
if (changes.affixAutoFitContext ||
|
814
|
-
changes.affixAutoFitOverflowOffset ||
|
815
|
-
changes.affixEnableAutoFit ||
|
816
|
-
changes.affixHorizontalAlignment ||
|
817
|
-
changes.affixIsSticky ||
|
818
|
-
changes.affixPlacement ||
|
819
|
-
changes.affixVerticalAlignment) {
|
820
|
-
this.updateAlignment();
|
821
|
-
}
|
822
|
-
};
|
823
|
-
SkyAffixDirective.prototype.ngOnDestroy = function () {
|
824
|
-
this.affixOffsetChange.complete();
|
825
|
-
this.affixOverflowScroll.complete();
|
826
|
-
this.affixPlacementChange.complete();
|
827
|
-
this.ngUnsubscribe.next();
|
828
|
-
this.ngUnsubscribe.complete();
|
829
|
-
this.affixer.destroy();
|
830
|
-
};
|
831
|
-
SkyAffixDirective.prototype.updateAlignment = function () {
|
832
|
-
this.affixer.affixTo(this.skyAffixTo, {
|
833
|
-
autoFitContext: this.affixAutoFitContext,
|
834
|
-
autoFitOverflowOffset: this.affixAutoFitOverflowOffset,
|
835
|
-
enableAutoFit: this.affixEnableAutoFit,
|
836
|
-
horizontalAlignment: this.affixHorizontalAlignment,
|
837
|
-
isSticky: this.affixIsSticky,
|
838
|
-
placement: this.affixPlacement,
|
839
|
-
verticalAlignment: this.affixVerticalAlignment,
|
840
|
-
});
|
841
|
-
};
|
842
|
-
return SkyAffixDirective;
|
843
|
-
}());
|
844
|
-
SkyAffixDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAffixDirective, deps: [{ token: i0__namespace.ElementRef }, { token: SkyAffixService }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
845
|
-
SkyAffixDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SkyAffixDirective, selector: "[skyAffixTo]", inputs: { skyAffixTo: "skyAffixTo", affixAutoFitContext: "affixAutoFitContext", affixAutoFitOverflowOffset: "affixAutoFitOverflowOffset", affixEnableAutoFit: "affixEnableAutoFit", affixHorizontalAlignment: "affixHorizontalAlignment", affixIsSticky: "affixIsSticky", affixPlacement: "affixPlacement", affixVerticalAlignment: "affixVerticalAlignment" }, outputs: { affixOffsetChange: "affixOffsetChange", affixOverflowScroll: "affixOverflowScroll", affixPlacementChange: "affixPlacementChange" }, usesOnChanges: true, ngImport: i0__namespace });
|
846
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAffixDirective, decorators: [{
|
847
|
-
type: i0.Directive,
|
848
|
-
args: [{
|
849
|
-
selector: '[skyAffixTo]',
|
850
|
-
}]
|
851
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: SkyAffixService }]; }, propDecorators: { skyAffixTo: [{
|
852
|
-
type: i0.Input
|
853
|
-
}], affixAutoFitContext: [{
|
854
|
-
type: i0.Input
|
855
|
-
}], affixAutoFitOverflowOffset: [{
|
856
|
-
type: i0.Input
|
857
|
-
}], affixEnableAutoFit: [{
|
858
|
-
type: i0.Input
|
859
|
-
}], affixHorizontalAlignment: [{
|
860
|
-
type: i0.Input
|
861
|
-
}], affixIsSticky: [{
|
862
|
-
type: i0.Input
|
863
|
-
}], affixPlacement: [{
|
864
|
-
type: i0.Input
|
865
|
-
}], affixVerticalAlignment: [{
|
866
|
-
type: i0.Input
|
867
|
-
}], affixOffsetChange: [{
|
868
|
-
type: i0.Output
|
869
|
-
}], affixOverflowScroll: [{
|
870
|
-
type: i0.Output
|
871
|
-
}], affixPlacementChange: [{
|
872
|
-
type: i0.Output
|
873
|
-
}] } });
|
874
|
-
|
875
|
-
var SkyAffixModule = /** @class */ (function () {
|
876
|
-
function SkyAffixModule() {
|
877
|
-
}
|
878
|
-
return SkyAffixModule;
|
879
|
-
}());
|
880
|
-
SkyAffixModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAffixModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
881
|
-
SkyAffixModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAffixModule, declarations: [SkyAffixDirective], imports: [i4.CommonModule], exports: [SkyAffixDirective] });
|
882
|
-
SkyAffixModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAffixModule, imports: [[i4.CommonModule]] });
|
883
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAffixModule, decorators: [{
|
884
|
-
type: i0.NgModule,
|
885
|
-
args: [{
|
886
|
-
imports: [i4.CommonModule],
|
887
|
-
exports: [SkyAffixDirective],
|
888
|
-
declarations: [SkyAffixDirective],
|
889
|
-
}]
|
890
|
-
}] });
|
891
|
-
|
892
|
-
/**
|
893
|
-
* Represents a single item added to the dock.
|
894
|
-
*/
|
895
|
-
var SkyDockItem = /** @class */ (function () {
|
896
|
-
/**
|
897
|
-
* @param componentInstance The item's component instance.
|
898
|
-
* @param stackOrder The assigned stack order of the docked item.
|
899
|
-
*/
|
900
|
-
function SkyDockItem(componentInstance, stackOrder) {
|
901
|
-
this.componentInstance = componentInstance;
|
902
|
-
this.stackOrder = stackOrder;
|
903
|
-
this._destroyed = new rxjs.Subject();
|
904
|
-
}
|
905
|
-
Object.defineProperty(SkyDockItem.prototype, "destroyed", {
|
906
|
-
/**
|
907
|
-
* An event that emits when the item is removed from the dock.
|
908
|
-
*/
|
909
|
-
get: function () {
|
910
|
-
return this._destroyed.asObservable();
|
911
|
-
},
|
912
|
-
enumerable: false,
|
913
|
-
configurable: true
|
914
|
-
});
|
915
|
-
/**
|
916
|
-
* Removes the item from the dock.
|
917
|
-
*/
|
918
|
-
SkyDockItem.prototype.destroy = function () {
|
919
|
-
this._destroyed.next();
|
920
|
-
this._destroyed.complete();
|
921
|
-
};
|
922
|
-
return SkyDockItem;
|
923
|
-
}());
|
924
|
-
|
925
|
-
/**
|
926
|
-
* The location on the page where the dock component should be rendered.
|
927
|
-
*/
|
928
|
-
exports.SkyDockLocation = void 0;
|
929
|
-
(function (SkyDockLocation) {
|
930
|
-
/**
|
931
|
-
* Renders the dock component before a given element.
|
932
|
-
*/
|
933
|
-
SkyDockLocation[SkyDockLocation["BeforeElement"] = 0] = "BeforeElement";
|
934
|
-
/**
|
935
|
-
* Renders the dock component as the last element inside the BODY element.
|
936
|
-
*/
|
937
|
-
SkyDockLocation[SkyDockLocation["BodyBottom"] = 1] = "BodyBottom";
|
938
|
-
/**
|
939
|
-
* Renders the dock component as the last element inside a given element.
|
940
|
-
*/
|
941
|
-
SkyDockLocation[SkyDockLocation["ElementBottom"] = 2] = "ElementBottom";
|
942
|
-
})(exports.SkyDockLocation || (exports.SkyDockLocation = {}));
|
943
|
-
|
944
|
-
var MutationObserverService = /** @class */ (function () {
|
945
|
-
function MutationObserverService() {
|
946
|
-
}
|
947
|
-
MutationObserverService.prototype.create = function (callback) {
|
948
|
-
return new MutationObserver(callback);
|
949
|
-
};
|
950
|
-
return MutationObserverService;
|
951
|
-
}());
|
952
|
-
MutationObserverService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: MutationObserverService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
953
|
-
MutationObserverService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: MutationObserverService, providedIn: 'root' });
|
954
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: MutationObserverService, decorators: [{
|
955
|
-
type: i0.Injectable,
|
956
|
-
args: [{
|
957
|
-
providedIn: 'root',
|
958
|
-
}]
|
959
|
-
}] });
|
960
|
-
|
961
|
-
/**
|
962
|
-
* @internal
|
963
|
-
*/
|
964
|
-
var SkyDockDomAdapterService = /** @class */ (function () {
|
965
|
-
function SkyDockDomAdapterService(mutationService, rendererFactory) {
|
966
|
-
this.mutationService = mutationService;
|
967
|
-
this.ngUnsubscribe = new rxjs.Subject();
|
968
|
-
this.renderer = rendererFactory.createRenderer(undefined, undefined);
|
969
|
-
}
|
970
|
-
SkyDockDomAdapterService.prototype.ngOnDestroy = function () {
|
971
|
-
if (this.observer) {
|
972
|
-
this.observer.disconnect();
|
973
|
-
}
|
974
|
-
this.ngUnsubscribe.next();
|
975
|
-
if (this.styleElement) {
|
976
|
-
this.destroyStyleElement();
|
977
|
-
}
|
978
|
-
this.currentDockHeight =
|
979
|
-
this.ngUnsubscribe =
|
980
|
-
this.observer =
|
981
|
-
this.styleElement =
|
982
|
-
undefined;
|
983
|
-
};
|
984
|
-
SkyDockDomAdapterService.prototype.setSticky = function (elementRef) {
|
985
|
-
this.renderer.addClass(elementRef.nativeElement, 'sky-dock-sticky');
|
986
|
-
};
|
987
|
-
SkyDockDomAdapterService.prototype.setZIndex = function (zIndex, elementRef) {
|
988
|
-
this.renderer.setStyle(elementRef.nativeElement, 'z-index', zIndex);
|
989
|
-
};
|
990
|
-
SkyDockDomAdapterService.prototype.unbindDock = function (elementRef) {
|
991
|
-
this.renderer.addClass(elementRef.nativeElement, 'sky-dock-unbound');
|
992
|
-
};
|
993
|
-
SkyDockDomAdapterService.prototype.watchDomChanges = function (elementRef) {
|
994
|
-
var _this = this;
|
995
|
-
this.observer = this.mutationService.create(function () {
|
996
|
-
_this.adjustBodyStyles(elementRef);
|
997
|
-
});
|
998
|
-
this.observer.observe(elementRef.nativeElement, {
|
999
|
-
attributes: true,
|
1000
|
-
childList: true,
|
1001
|
-
characterData: true,
|
1002
|
-
subtree: true,
|
1003
|
-
});
|
1004
|
-
rxjs.fromEvent(window, 'resize')
|
1005
|
-
.pipe(operators.debounceTime(250), operators.takeUntil(this.ngUnsubscribe))
|
1006
|
-
.subscribe(function () { return _this.adjustBodyStyles(elementRef); });
|
1007
|
-
};
|
1008
|
-
SkyDockDomAdapterService.prototype.adjustBodyStyles = function (elementRef) {
|
1009
|
-
var dockHeight = elementRef.nativeElement.getBoundingClientRect().height;
|
1010
|
-
if (dockHeight === this.currentDockHeight) {
|
1011
|
-
return;
|
1012
|
-
}
|
1013
|
-
// Create a style element to avoid overwriting any existing inline body styles.
|
1014
|
-
var styleElement = this.renderer.createElement('style');
|
1015
|
-
var textNode = this.renderer.createText("body { margin-bottom: " + dockHeight + "px; }");
|
1016
|
-
// Apply a `data-` attribute to make unit testing easier.
|
1017
|
-
this.renderer.setAttribute(styleElement, 'data-test-selector', 'sky-layout-dock-bottom-styles');
|
1018
|
-
this.renderer.appendChild(styleElement, textNode);
|
1019
|
-
this.renderer.appendChild(document.head, styleElement);
|
1020
|
-
if (this.styleElement) {
|
1021
|
-
this.destroyStyleElement();
|
1022
|
-
}
|
1023
|
-
this.currentDockHeight = dockHeight;
|
1024
|
-
this.styleElement = styleElement;
|
1025
|
-
};
|
1026
|
-
SkyDockDomAdapterService.prototype.destroyStyleElement = function () {
|
1027
|
-
this.renderer.removeChild(document.head, this.styleElement);
|
1028
|
-
};
|
1029
|
-
return SkyDockDomAdapterService;
|
1030
|
-
}());
|
1031
|
-
SkyDockDomAdapterService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockDomAdapterService, deps: [{ token: MutationObserverService }, { token: i0__namespace.RendererFactory2 }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
1032
|
-
SkyDockDomAdapterService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockDomAdapterService });
|
1033
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockDomAdapterService, decorators: [{
|
1034
|
-
type: i0.Injectable
|
1035
|
-
}], ctorParameters: function () { return [{ type: MutationObserverService }, { type: i0__namespace.RendererFactory2 }]; } });
|
1036
|
-
|
1037
|
-
/**
|
1038
|
-
* @internal
|
1039
|
-
*/
|
1040
|
-
function sortByStackOrder(a, b) {
|
1041
|
-
if (a.stackOrder > b.stackOrder) {
|
1042
|
-
return -1;
|
1043
|
-
}
|
1044
|
-
if (a.stackOrder < b.stackOrder) {
|
1045
|
-
return 1;
|
1046
|
-
}
|
1047
|
-
return 0;
|
1048
|
-
}
|
1049
|
-
|
1050
|
-
/**
|
1051
|
-
* @internal
|
1052
|
-
*/
|
1053
|
-
var SkyDockComponent = /** @class */ (function () {
|
1054
|
-
function SkyDockComponent(changeDetector, resolver, elementRef, injector, domAdapter) {
|
1055
|
-
this.changeDetector = changeDetector;
|
1056
|
-
this.resolver = resolver;
|
1057
|
-
this.elementRef = elementRef;
|
1058
|
-
this.injector = injector;
|
1059
|
-
this.domAdapter = domAdapter;
|
1060
|
-
this.itemRefs = [];
|
1061
|
-
}
|
1062
|
-
SkyDockComponent.prototype.insertComponent = function (component, config) {
|
1063
|
-
if (config === void 0) { config = {}; }
|
1064
|
-
var factory = this.resolver.resolveComponentFactory(component);
|
1065
|
-
var injector = i0.Injector.create({
|
1066
|
-
providers: config.providers || [],
|
1067
|
-
parent: this.injector,
|
1068
|
-
});
|
1069
|
-
var componentRef = this.target.createComponent(factory, undefined, injector);
|
1070
|
-
var stackOrder = config.stackOrder !== null && config.stackOrder !== undefined
|
1071
|
-
? config.stackOrder
|
1072
|
-
: this.getHighestStackOrder();
|
1073
|
-
this.itemRefs.push({
|
1074
|
-
componentRef: componentRef,
|
1075
|
-
stackOrder: stackOrder,
|
1076
|
-
});
|
1077
|
-
this.sortItemsByStackOrder();
|
1078
|
-
this.changeDetector.markForCheck();
|
1079
|
-
return {
|
1080
|
-
componentRef: componentRef,
|
1081
|
-
stackOrder: stackOrder,
|
1082
|
-
};
|
1083
|
-
};
|
1084
|
-
SkyDockComponent.prototype.removeItem = function (item) {
|
1085
|
-
var viewRef = item.componentRef.hostView;
|
1086
|
-
this.target.remove(this.target.indexOf(viewRef));
|
1087
|
-
var found = this.itemRefs.find(function (i) { return i.componentRef.hostView === viewRef; });
|
1088
|
-
this.itemRefs.splice(this.itemRefs.indexOf(found), 1);
|
1089
|
-
};
|
1090
|
-
SkyDockComponent.prototype.setOptions = function (options) {
|
1091
|
-
var _a, _b;
|
1092
|
-
this.options = options;
|
1093
|
-
switch ((_a = this.options) === null || _a === void 0 ? void 0 : _a.location) {
|
1094
|
-
case exports.SkyDockLocation.BeforeElement:
|
1095
|
-
this.domAdapter.unbindDock(this.elementRef);
|
1096
|
-
break;
|
1097
|
-
case exports.SkyDockLocation.ElementBottom:
|
1098
|
-
this.domAdapter.setSticky(this.elementRef);
|
1099
|
-
break;
|
1100
|
-
case exports.SkyDockLocation.BodyBottom:
|
1101
|
-
default:
|
1102
|
-
this.domAdapter.watchDomChanges(this.elementRef);
|
1103
|
-
break;
|
1104
|
-
}
|
1105
|
-
if ((_b = this.options) === null || _b === void 0 ? void 0 : _b.zIndex) {
|
1106
|
-
this.domAdapter.setZIndex(this.options.zIndex, this.elementRef);
|
1107
|
-
}
|
1108
|
-
};
|
1109
|
-
SkyDockComponent.prototype.sortItemsByStackOrder = function () {
|
1110
|
-
var _this = this;
|
1111
|
-
this.itemRefs.sort(sortByStackOrder);
|
1112
|
-
// Reassign the correct index for each view.
|
1113
|
-
this.itemRefs.forEach(function (item, i) { return _this.target.move(item.componentRef.hostView, i); });
|
1114
|
-
};
|
1115
|
-
SkyDockComponent.prototype.getHighestStackOrder = function () {
|
1116
|
-
if (this.itemRefs.length === 0) {
|
1117
|
-
return 0;
|
1118
|
-
}
|
1119
|
-
return this.itemRefs[0].stackOrder + 1;
|
1120
|
-
};
|
1121
|
-
return SkyDockComponent;
|
1122
|
-
}());
|
1123
|
-
SkyDockComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.ComponentFactoryResolver }, { token: i0__namespace.ElementRef }, { token: i0__namespace.Injector }, { token: SkyDockDomAdapterService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
1124
|
-
SkyDockComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyDockComponent, selector: "sky-dock", providers: [SkyDockDomAdapterService], viewQueries: [{ propertyName: "target", first: true, predicate: ["target"], descendants: true, read: i0.ViewContainerRef, static: true }], ngImport: i0__namespace, template: "<ng-container #target></ng-container>\n", styles: [":host{display:flex;flex-direction:column;width:100%}:host:not(.sky-dock-unbound){position:fixed;left:0;bottom:0;right:0}:host.sky-dock-sticky{position:sticky}\n"], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
1125
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockComponent, decorators: [{
|
1126
|
-
type: i0.Component,
|
1127
|
-
args: [{
|
1128
|
-
selector: 'sky-dock',
|
1129
|
-
template: "<ng-container #target></ng-container>\n",
|
1130
|
-
styles: [":host{display:flex;flex-direction:column;width:100%}:host:not(.sky-dock-unbound){position:fixed;left:0;bottom:0;right:0}:host.sky-dock-sticky{position:sticky}\n"],
|
1131
|
-
providers: [SkyDockDomAdapterService],
|
1132
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
1133
|
-
}]
|
1134
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.ComponentFactoryResolver }, { type: i0__namespace.ElementRef }, { type: i0__namespace.Injector }, { type: SkyDockDomAdapterService }]; }, propDecorators: { target: [{
|
1135
|
-
type: i0.ViewChild,
|
1136
|
-
args: ['target', {
|
1137
|
-
read: i0.ViewContainerRef,
|
1138
|
-
static: true,
|
1139
|
-
}]
|
1140
|
-
}] } });
|
1141
|
-
|
1142
|
-
var SkyDockModule = /** @class */ (function () {
|
1143
|
-
function SkyDockModule() {
|
1144
|
-
}
|
1145
|
-
return SkyDockModule;
|
1146
|
-
}());
|
1147
|
-
SkyDockModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
1148
|
-
SkyDockModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockModule, declarations: [SkyDockComponent], imports: [i4.CommonModule] });
|
1149
|
-
SkyDockModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockModule, providers: [MutationObserverService], imports: [[i4.CommonModule]] });
|
1150
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockModule, decorators: [{
|
1151
|
-
type: i0.NgModule,
|
1152
|
-
args: [{
|
1153
|
-
imports: [i4.CommonModule],
|
1154
|
-
declarations: [SkyDockComponent],
|
1155
|
-
entryComponents: [SkyDockComponent],
|
1156
|
-
providers: [MutationObserverService],
|
1157
|
-
}]
|
1158
|
-
}] });
|
1159
|
-
|
1160
|
-
/**
|
1161
|
-
* The location on the page where the dynamic component should be rendered.
|
1162
|
-
*/
|
1163
|
-
exports.SkyDynamicComponentLocation = void 0;
|
1164
|
-
(function (SkyDynamicComponentLocation) {
|
1165
|
-
/**
|
1166
|
-
* Renders the dynamic component before a given element.
|
1167
|
-
*/
|
1168
|
-
SkyDynamicComponentLocation[SkyDynamicComponentLocation["BeforeElement"] = 0] = "BeforeElement";
|
1169
|
-
/**
|
1170
|
-
* Renders the dynamic component as the last element inside the BODY element.
|
1171
|
-
*/
|
1172
|
-
SkyDynamicComponentLocation[SkyDynamicComponentLocation["BodyBottom"] = 1] = "BodyBottom";
|
1173
|
-
/**
|
1174
|
-
* Renders the dynamic component as the first element inside the BODY element.
|
1175
|
-
*/
|
1176
|
-
SkyDynamicComponentLocation[SkyDynamicComponentLocation["BodyTop"] = 2] = "BodyTop";
|
1177
|
-
/**
|
1178
|
-
* Renders the dynamic component as the last element inside a given element.
|
1179
|
-
*/
|
1180
|
-
SkyDynamicComponentLocation[SkyDynamicComponentLocation["ElementBottom"] = 3] = "ElementBottom";
|
1181
|
-
/**
|
1182
|
-
* Renders the dynamic component as the first element inside a given element.
|
1183
|
-
*/
|
1184
|
-
SkyDynamicComponentLocation[SkyDynamicComponentLocation["ElementTop"] = 4] = "ElementTop";
|
1185
|
-
})(exports.SkyDynamicComponentLocation || (exports.SkyDynamicComponentLocation = {}));
|
1186
|
-
|
1187
|
-
/**
|
1188
|
-
* @internal
|
1189
|
-
*/
|
1190
|
-
function getWindow() {
|
1191
|
-
return window;
|
1192
|
-
}
|
1193
|
-
/**
|
1194
|
-
* The application window reference service references the global window variable.
|
1195
|
-
* After users inject SkyAppWindowRef into a component, they can use the service to interact with
|
1196
|
-
* window properties and event handlers by referencing its nativeWindow property.
|
1197
|
-
*/
|
1198
|
-
var SkyAppWindowRef = /** @class */ (function () {
|
1199
|
-
function SkyAppWindowRef() {
|
1200
|
-
}
|
1201
|
-
Object.defineProperty(SkyAppWindowRef.prototype, "nativeWindow", {
|
1202
|
-
/**
|
1203
|
-
* References the global `window` variable.
|
1204
|
-
*/
|
1205
|
-
get: function () {
|
1206
|
-
return getWindow();
|
1207
|
-
},
|
1208
|
-
enumerable: false,
|
1209
|
-
configurable: true
|
1210
|
-
});
|
1211
|
-
return SkyAppWindowRef;
|
1212
|
-
}());
|
1213
|
-
SkyAppWindowRef.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppWindowRef, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
1214
|
-
SkyAppWindowRef.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppWindowRef, providedIn: 'root' });
|
1215
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppWindowRef, decorators: [{
|
1216
|
-
type: i0.Injectable,
|
1217
|
-
args: [{
|
1218
|
-
providedIn: 'root',
|
1219
|
-
}]
|
1220
|
-
}] });
|
1221
|
-
|
1222
|
-
/**
|
1223
|
-
* Angular service for creating and rendering a dynamic component.
|
1224
|
-
*/
|
1225
|
-
var SkyDynamicComponentService = /** @class */ (function () {
|
1226
|
-
function SkyDynamicComponentService(componentFactoryResolver, applicationRef, injector, windowRef, rendererFactory) {
|
1227
|
-
this.componentFactoryResolver = componentFactoryResolver;
|
1228
|
-
this.applicationRef = applicationRef;
|
1229
|
-
this.injector = injector;
|
1230
|
-
this.windowRef = windowRef;
|
1231
|
-
// Based on suggestions from https://github.com/angular/angular/issues/17824
|
1232
|
-
// for accessing an instance of Renderer2 in a service since Renderer2 can't
|
1233
|
-
// be injected into a service. Passing undefined for both parameters results
|
1234
|
-
// in the default renderer which is what we want here.
|
1235
|
-
this.renderer = rendererFactory.createRenderer(undefined, undefined);
|
1236
|
-
}
|
1237
|
-
/**
|
1238
|
-
* Creates an instance of the specified component and adds it to the specified location
|
1239
|
-
* on the page.
|
1240
|
-
* @param options Options for creating the dynamic component.
|
1241
|
-
*/
|
1242
|
-
SkyDynamicComponentService.prototype.createComponent = function (componentType, options) {
|
1243
|
-
options = options || {
|
1244
|
-
location: exports.SkyDynamicComponentLocation.BodyBottom,
|
1245
|
-
};
|
1246
|
-
var componentRef = this.componentFactoryResolver
|
1247
|
-
.resolveComponentFactory(componentType)
|
1248
|
-
.create(this.injector);
|
1249
|
-
this.applicationRef.attachView(componentRef.hostView);
|
1250
|
-
var el = this.getRootNode(componentRef);
|
1251
|
-
var bodyEl = this.windowRef.nativeWindow.document.body;
|
1252
|
-
switch (options.location) {
|
1253
|
-
case exports.SkyDynamicComponentLocation.BeforeElement:
|
1254
|
-
this.renderer.insertBefore(options.referenceEl.parentElement, el, options.referenceEl);
|
1255
|
-
break;
|
1256
|
-
case exports.SkyDynamicComponentLocation.ElementTop:
|
1257
|
-
this.renderer.insertBefore(options.referenceEl, el, options.referenceEl.firstChild);
|
1258
|
-
break;
|
1259
|
-
case exports.SkyDynamicComponentLocation.ElementBottom:
|
1260
|
-
this.renderer.appendChild(options.referenceEl, el);
|
1261
|
-
break;
|
1262
|
-
case exports.SkyDynamicComponentLocation.BodyTop:
|
1263
|
-
this.renderer.insertBefore(bodyEl, el, bodyEl.firstChild);
|
1264
|
-
break;
|
1265
|
-
default:
|
1266
|
-
this.renderer.appendChild(bodyEl, el);
|
1267
|
-
break;
|
1268
|
-
}
|
1269
|
-
return componentRef;
|
1270
|
-
};
|
1271
|
-
/**
|
1272
|
-
* Removes a component ref from the page
|
1273
|
-
* @param componentRef Component ref for the component being removed
|
1274
|
-
*/
|
1275
|
-
SkyDynamicComponentService.prototype.removeComponent = function (componentRef) {
|
1276
|
-
if (!componentRef) {
|
1277
|
-
return;
|
1278
|
-
}
|
1279
|
-
this.applicationRef.detachView(componentRef.hostView);
|
1280
|
-
componentRef.destroy();
|
1281
|
-
};
|
1282
|
-
SkyDynamicComponentService.prototype.getRootNode = function (componentRef) {
|
1283
|
-
// Technique for retrieving the component's root node taken from here:
|
1284
|
-
// https://malcoded.com/posts/angular-dynamic-components
|
1285
|
-
return componentRef.hostView.rootNodes[0];
|
1286
|
-
};
|
1287
|
-
return SkyDynamicComponentService;
|
1288
|
-
}());
|
1289
|
-
SkyDynamicComponentService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDynamicComponentService, deps: [{ token: i0__namespace.ComponentFactoryResolver }, { token: i0__namespace.ApplicationRef }, { token: i0__namespace.Injector }, { token: SkyAppWindowRef }, { token: i0__namespace.RendererFactory2 }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
1290
|
-
SkyDynamicComponentService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDynamicComponentService, providedIn: 'any' });
|
1291
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDynamicComponentService, decorators: [{
|
1292
|
-
type: i0.Injectable,
|
1293
|
-
args: [{
|
1294
|
-
// Must be 'any' so that the component is created in the context of its module's injector.
|
1295
|
-
// If set to 'root', the component's dependency injections would only be derived from the root
|
1296
|
-
// injector and may loose context if the component is created within a lazy-loaded module.
|
1297
|
-
providedIn: 'any',
|
1298
|
-
}]
|
1299
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.ComponentFactoryResolver }, { type: i0__namespace.ApplicationRef }, { type: i0__namespace.Injector }, { type: SkyAppWindowRef }, { type: i0__namespace.RendererFactory2 }]; } });
|
1300
|
-
|
1301
|
-
/**
|
1302
|
-
* This service docks components to specific areas on the page.
|
1303
|
-
*/
|
1304
|
-
var SkyDockService = /** @class */ (function () {
|
1305
|
-
function SkyDockService(dynamicComponentService) {
|
1306
|
-
this.dynamicComponentService = dynamicComponentService;
|
1307
|
-
}
|
1308
|
-
Object.defineProperty(SkyDockService.prototype, "items", {
|
1309
|
-
/**
|
1310
|
-
* Returns all docked items.
|
1311
|
-
*/
|
1312
|
-
get: function () {
|
1313
|
-
return SkyDockService._items;
|
1314
|
-
},
|
1315
|
-
enumerable: false,
|
1316
|
-
configurable: true
|
1317
|
-
});
|
1318
|
-
/**
|
1319
|
-
* Docks a component to the bottom of the page.
|
1320
|
-
* @param component The component to dock.
|
1321
|
-
* @param config Options that affect the docking action.
|
1322
|
-
*/
|
1323
|
-
SkyDockService.prototype.insertComponent = function (component, config) {
|
1324
|
-
var _this = this;
|
1325
|
-
if (!SkyDockService.dockRef) {
|
1326
|
-
this.createDock();
|
1327
|
-
}
|
1328
|
-
var itemRef = SkyDockService.dockRef.instance.insertComponent(component, config);
|
1329
|
-
var item = new SkyDockItem(itemRef.componentRef.instance, itemRef.stackOrder);
|
1330
|
-
item.destroyed.subscribe(function () {
|
1331
|
-
SkyDockService.dockRef.instance.removeItem(itemRef);
|
1332
|
-
SkyDockService._items.splice(SkyDockService._items.indexOf(item), 1);
|
1333
|
-
if (SkyDockService._items.length === 0) {
|
1334
|
-
_this.destroyDock();
|
1335
|
-
}
|
1336
|
-
});
|
1337
|
-
SkyDockService._items.push(item);
|
1338
|
-
SkyDockService._items.sort(sortByStackOrder);
|
1339
|
-
return item;
|
1340
|
-
};
|
1341
|
-
/**
|
1342
|
-
* Sets options for the positioning and styling of the dock component. Since the dock service is a
|
1343
|
-
* singleton instance, these options will be applied to all components inserted into the dock. In
|
1344
|
-
* order to create a seperate dock with different options, consumers should provide a different
|
1345
|
-
* instance of the dock service.
|
1346
|
-
* @param options The options for positioning and styling
|
1347
|
-
*/
|
1348
|
-
SkyDockService.prototype.setDockOptions = function (options) {
|
1349
|
-
this.options = options;
|
1350
|
-
};
|
1351
|
-
SkyDockService.prototype.createDock = function () {
|
1352
|
-
var dockOptions;
|
1353
|
-
if (this.options) {
|
1354
|
-
var dynamicLocation = void 0;
|
1355
|
-
switch (this.options.location) {
|
1356
|
-
case exports.SkyDockLocation.BeforeElement:
|
1357
|
-
dynamicLocation = exports.SkyDynamicComponentLocation.BeforeElement;
|
1358
|
-
break;
|
1359
|
-
case exports.SkyDockLocation.ElementBottom:
|
1360
|
-
dynamicLocation = exports.SkyDynamicComponentLocation.ElementBottom;
|
1361
|
-
break;
|
1362
|
-
default:
|
1363
|
-
dynamicLocation = exports.SkyDynamicComponentLocation.BodyTop;
|
1364
|
-
break;
|
1365
|
-
}
|
1366
|
-
dockOptions = {
|
1367
|
-
location: dynamicLocation,
|
1368
|
-
referenceEl: this.options.referenceEl,
|
1369
|
-
};
|
1370
|
-
}
|
1371
|
-
SkyDockService.dockRef = this.dynamicComponentService.createComponent(SkyDockComponent, dockOptions);
|
1372
|
-
SkyDockService.dockRef.instance.setOptions(this.options);
|
1373
|
-
};
|
1374
|
-
SkyDockService.prototype.destroyDock = function () {
|
1375
|
-
this.dynamicComponentService.removeComponent(SkyDockService.dockRef);
|
1376
|
-
SkyDockService.dockRef = undefined;
|
1377
|
-
};
|
1378
|
-
return SkyDockService;
|
1379
|
-
}());
|
1380
|
-
SkyDockService._items = [];
|
1381
|
-
SkyDockService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockService, deps: [{ token: SkyDynamicComponentService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
1382
|
-
SkyDockService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockService, providedIn: 'any' });
|
1383
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockService, decorators: [{
|
1384
|
-
type: i0.Injectable,
|
1385
|
-
args: [{
|
1386
|
-
// Must be 'any' so that the dock component is created in the context of its module's injector.
|
1387
|
-
// If set to 'root', the component's dependency injections would only be derived from the root
|
1388
|
-
// injector and may loose context if the dock was opened from within a lazy-loaded module.
|
1389
|
-
providedIn: 'any',
|
1390
|
-
}]
|
1391
|
-
}], ctorParameters: function () { return [{ type: SkyDynamicComponentService }]; } });
|
1392
|
-
|
1393
|
-
/**
|
1394
|
-
* Provides services required to create dynamic components on the page.
|
1395
|
-
* @deprecated The `SkyDynamicComponentService` no longer needs the `SkyDynamicComponentModule`.
|
1396
|
-
* The `SkyDynamicComponentModule` can be removed from your project.
|
1397
|
-
*/
|
1398
|
-
var SkyDynamicComponentModule = /** @class */ (function () {
|
1399
|
-
function SkyDynamicComponentModule() {
|
1400
|
-
}
|
1401
|
-
return SkyDynamicComponentModule;
|
1402
|
-
}());
|
1403
|
-
SkyDynamicComponentModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDynamicComponentModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
1404
|
-
SkyDynamicComponentModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDynamicComponentModule });
|
1405
|
-
SkyDynamicComponentModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDynamicComponentModule });
|
1406
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDynamicComponentModule, decorators: [{
|
1407
|
-
type: i0.NgModule,
|
1408
|
-
args: [{}]
|
1409
|
-
}] });
|
1410
|
-
|
1411
|
-
var SkyAppFormat = /** @class */ (function () {
|
1412
|
-
function SkyAppFormat() {
|
1413
|
-
}
|
1414
|
-
SkyAppFormat.prototype.formatText = function (format) {
|
1415
|
-
var args = [];
|
1416
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
1417
|
-
args[_i - 1] = arguments[_i];
|
1418
|
-
}
|
1419
|
-
return String(format).replace(/\{(\d+)\}/g, function (match, capture) {
|
1420
|
-
return args[parseInt(capture, 10)];
|
1421
|
-
});
|
1422
|
-
};
|
1423
|
-
return SkyAppFormat;
|
1424
|
-
}());
|
1425
|
-
SkyAppFormat.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppFormat, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
1426
|
-
SkyAppFormat.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppFormat, providedIn: 'root' });
|
1427
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppFormat, decorators: [{
|
1428
|
-
type: i0.Injectable,
|
1429
|
-
args: [{
|
1430
|
-
providedIn: 'root',
|
1431
|
-
}]
|
1432
|
-
}] });
|
1433
|
-
|
1434
|
-
var idIndex = 0;
|
1435
|
-
function generateId() {
|
1436
|
-
idIndex++;
|
1437
|
-
return "sky-id-gen__" + idIndex;
|
1438
|
-
}
|
1439
|
-
/**
|
1440
|
-
* Sets the element's `id` attribute to a unique ID. To reference this unique ID on other elements,
|
1441
|
-
* such as in a `label` element's `for` attribute, assign this directive to a template reference
|
1442
|
-
* variable, then use its `id` property.
|
1443
|
-
*/
|
1444
|
-
var SkyIdDirective = /** @class */ (function () {
|
1445
|
-
function SkyIdDirective(elRef, renderer) {
|
1446
|
-
// Generate and apply the ID before the template is rendered
|
1447
|
-
// to avoid a changed-after-checked error.
|
1448
|
-
var id = generateId();
|
1449
|
-
renderer.setAttribute(elRef.nativeElement, 'id', id);
|
1450
|
-
this._id = id;
|
1451
|
-
}
|
1452
|
-
Object.defineProperty(SkyIdDirective.prototype, "id", {
|
1453
|
-
get: function () {
|
1454
|
-
return this._id;
|
1455
|
-
},
|
1456
|
-
enumerable: false,
|
1457
|
-
configurable: true
|
1458
|
-
});
|
1459
|
-
return SkyIdDirective;
|
1460
|
-
}());
|
1461
|
-
SkyIdDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyIdDirective, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.Renderer2 }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
1462
|
-
SkyIdDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SkyIdDirective, selector: "[skyId]", exportAs: ["skyId"], ngImport: i0__namespace });
|
1463
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyIdDirective, decorators: [{
|
1464
|
-
type: i0.Directive,
|
1465
|
-
args: [{
|
1466
|
-
selector: '[skyId]',
|
1467
|
-
exportAs: 'skyId',
|
1468
|
-
}]
|
1469
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.Renderer2 }]; } });
|
1470
|
-
|
1471
|
-
var SkyIdModule = /** @class */ (function () {
|
1472
|
-
function SkyIdModule() {
|
1473
|
-
}
|
1474
|
-
return SkyIdModule;
|
1475
|
-
}());
|
1476
|
-
SkyIdModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyIdModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
1477
|
-
SkyIdModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyIdModule, declarations: [SkyIdDirective], exports: [SkyIdDirective] });
|
1478
|
-
SkyIdModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyIdModule });
|
1479
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyIdModule, decorators: [{
|
1480
|
-
type: i0.NgModule,
|
1481
|
-
args: [{
|
1482
|
-
declarations: [SkyIdDirective],
|
1483
|
-
exports: [SkyIdDirective],
|
1484
|
-
}]
|
1485
|
-
}] });
|
1486
|
-
|
1487
|
-
/**
|
1488
|
-
* @deprecated The `SkyLogService` no longer needs the `SkyLogModule`.
|
1489
|
-
* The `SkyLogModule` can be removed from your project.
|
1490
|
-
*/
|
1491
|
-
var SkyLogModule = /** @class */ (function () {
|
1492
|
-
function SkyLogModule() {
|
1493
|
-
}
|
1494
|
-
return SkyLogModule;
|
1495
|
-
}());
|
1496
|
-
SkyLogModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLogModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
1497
|
-
SkyLogModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLogModule });
|
1498
|
-
SkyLogModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLogModule });
|
1499
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLogModule, decorators: [{
|
1500
|
-
type: i0.NgModule,
|
1501
|
-
args: [{}]
|
1502
|
-
}] });
|
1503
|
-
|
1504
|
-
/**
|
1505
|
-
* @deprecated The `SkyLogService` will be removed in the next major version of `@skyux/core`.
|
1506
|
-
*/
|
1507
|
-
var SkyLogService = /** @class */ (function () {
|
1508
|
-
function SkyLogService() {
|
1509
|
-
}
|
1510
|
-
SkyLogService.prototype.warn = function (message) {
|
1511
|
-
var optionalParams = [];
|
1512
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
1513
|
-
optionalParams[_i - 1] = arguments[_i];
|
1514
|
-
}
|
1515
|
-
/*istanbul ignore else */
|
1516
|
-
if (window.console) {
|
1517
|
-
// eslint-disable-next-line prefer-spread,prefer-rest-params
|
1518
|
-
window.console.warn.apply(window.console, arguments);
|
1519
|
-
}
|
1520
|
-
};
|
1521
|
-
return SkyLogService;
|
1522
|
-
}());
|
1523
|
-
SkyLogService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLogService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
1524
|
-
SkyLogService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLogService, providedIn: 'root' });
|
1525
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLogService, decorators: [{
|
1526
|
-
type: i0.Injectable,
|
1527
|
-
args: [{
|
1528
|
-
providedIn: 'root',
|
1529
|
-
}]
|
1530
|
-
}] });
|
1531
|
-
|
1532
|
-
/**
|
1533
|
-
* @deprecated The `SkyMediaQueryService` no longer needs the `SkyMediaQueryModule`.
|
1534
|
-
* The `SkyMediaQueryModule` can be removed from your project.
|
1535
|
-
*/
|
1536
|
-
var SkyMediaQueryModule = /** @class */ (function () {
|
1537
|
-
function SkyMediaQueryModule() {
|
1538
|
-
}
|
1539
|
-
return SkyMediaQueryModule;
|
1540
|
-
}());
|
1541
|
-
SkyMediaQueryModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyMediaQueryModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
1542
|
-
SkyMediaQueryModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyMediaQueryModule });
|
1543
|
-
SkyMediaQueryModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyMediaQueryModule });
|
1544
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyMediaQueryModule, decorators: [{
|
1545
|
-
type: i0.NgModule,
|
1546
|
-
args: [{}]
|
1547
|
-
}] });
|
1548
|
-
|
1549
|
-
var SkyMediaQueryService = /** @class */ (function () {
|
1550
|
-
function SkyMediaQueryService(zone) {
|
1551
|
-
this.zone = zone;
|
1552
|
-
this.currentSubject = new rxjs.BehaviorSubject(this.current);
|
1553
|
-
this._current = exports.SkyMediaBreakpoints.md;
|
1554
|
-
this.breakpoints = [
|
1555
|
-
{
|
1556
|
-
mediaQueryString: SkyMediaQueryService.xs,
|
1557
|
-
name: exports.SkyMediaBreakpoints.xs,
|
1558
|
-
},
|
1559
|
-
{
|
1560
|
-
mediaQueryString: SkyMediaQueryService.sm,
|
1561
|
-
name: exports.SkyMediaBreakpoints.sm,
|
1562
|
-
},
|
1563
|
-
{
|
1564
|
-
mediaQueryString: SkyMediaQueryService.md,
|
1565
|
-
name: exports.SkyMediaBreakpoints.md,
|
1566
|
-
},
|
1567
|
-
{
|
1568
|
-
mediaQueryString: SkyMediaQueryService.lg,
|
1569
|
-
name: exports.SkyMediaBreakpoints.lg,
|
1570
|
-
},
|
1571
|
-
];
|
1572
|
-
this.mediaQueries = [];
|
1573
|
-
this.addListeners();
|
1574
|
-
}
|
1575
|
-
Object.defineProperty(SkyMediaQueryService.prototype, "current", {
|
1576
|
-
/**
|
1577
|
-
* Returns the current breakpoint.
|
1578
|
-
*/
|
1579
|
-
get: function () {
|
1580
|
-
return this._current;
|
1581
|
-
},
|
1582
|
-
enumerable: false,
|
1583
|
-
configurable: true
|
1584
|
-
});
|
1585
|
-
SkyMediaQueryService.prototype.ngOnDestroy = function () {
|
1586
|
-
this.removeListeners();
|
1587
|
-
this.currentSubject.complete();
|
1588
|
-
};
|
1589
|
-
/**
|
1590
|
-
* Suscribes to screen size changes.
|
1591
|
-
* @param listener Specifies a function that is called when breakpoints change.
|
1592
|
-
*/
|
1593
|
-
SkyMediaQueryService.prototype.subscribe = function (listener) {
|
1594
|
-
return this.currentSubject.subscribe({
|
1595
|
-
next: function (breakpoints) {
|
1596
|
-
listener(breakpoints);
|
1597
|
-
},
|
1598
|
-
});
|
1599
|
-
};
|
1600
|
-
/**
|
1601
|
-
* @internal
|
1602
|
-
*/
|
1603
|
-
SkyMediaQueryService.prototype.destroy = function () {
|
1604
|
-
this.removeListeners();
|
1605
|
-
this.currentSubject.complete();
|
1606
|
-
};
|
1607
|
-
SkyMediaQueryService.prototype.addListeners = function () {
|
1608
|
-
var _this = this;
|
1609
|
-
this.mediaQueries = this.breakpoints.map(function (breakpoint) {
|
1610
|
-
var mq = matchMedia(breakpoint.mediaQueryString);
|
1611
|
-
var listener = function (event) {
|
1612
|
-
// Run the check outside of Angular's change detection since Angular
|
1613
|
-
// does not wrap matchMedia listeners in NgZone.
|
1614
|
-
// See: https://blog.assaf.co/angular-2-change-detection-zones-and-an-example/
|
1615
|
-
_this.zone.run(function () {
|
1616
|
-
if (event.matches) {
|
1617
|
-
_this.notifyBreakpointChange(breakpoint.name);
|
1618
|
-
}
|
1619
|
-
});
|
1620
|
-
};
|
1621
|
-
mq.addListener(listener);
|
1622
|
-
if (mq.matches) {
|
1623
|
-
_this.notifyBreakpointChange(breakpoint.name);
|
1624
|
-
}
|
1625
|
-
return {
|
1626
|
-
mediaQueryList: mq,
|
1627
|
-
listener: listener,
|
1628
|
-
};
|
1629
|
-
});
|
1630
|
-
};
|
1631
|
-
SkyMediaQueryService.prototype.removeListeners = function () {
|
1632
|
-
this.mediaQueries.forEach(function (mediaQuery) {
|
1633
|
-
mediaQuery.mediaQueryList.removeListener(mediaQuery.listener);
|
1634
|
-
});
|
1635
|
-
this.mediaQueries = [];
|
1636
|
-
};
|
1637
|
-
SkyMediaQueryService.prototype.notifyBreakpointChange = function (breakpoint) {
|
1638
|
-
this._current = breakpoint;
|
1639
|
-
this.currentSubject.next(breakpoint);
|
1640
|
-
};
|
1641
|
-
return SkyMediaQueryService;
|
1642
|
-
}());
|
1643
|
-
/**
|
1644
|
-
* The size for the `xs` breakpoint.
|
1645
|
-
* @default "(max-width: 767px)"
|
1646
|
-
*/
|
1647
|
-
SkyMediaQueryService.xs = '(max-width: 767px)';
|
1648
|
-
/**
|
1649
|
-
* The size for the `sm` breakpoint.
|
1650
|
-
* @default "(min-width: 768px) and (max-width: 991px)"
|
1651
|
-
*/
|
1652
|
-
SkyMediaQueryService.sm = '(min-width: 768px) and (max-width: 991px)';
|
1653
|
-
/**
|
1654
|
-
* The size for the `md` breakpoint.
|
1655
|
-
* @default "(min-width: 992px) and (max-width: 1199px)"
|
1656
|
-
*/
|
1657
|
-
SkyMediaQueryService.md = '(min-width: 992px) and (max-width: 1199px)';
|
1658
|
-
/**
|
1659
|
-
* The size for the `lg` breakpoint.
|
1660
|
-
* @default "(min-width: 1200px)"
|
1661
|
-
*/
|
1662
|
-
SkyMediaQueryService.lg = '(min-width: 1200px)';
|
1663
|
-
SkyMediaQueryService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyMediaQueryService, deps: [{ token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
1664
|
-
SkyMediaQueryService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyMediaQueryService, providedIn: 'root' });
|
1665
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyMediaQueryService, decorators: [{
|
1666
|
-
type: i0.Injectable,
|
1667
|
-
args: [{
|
1668
|
-
providedIn: 'root',
|
1669
|
-
}]
|
1670
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.NgZone }]; } });
|
1671
|
-
|
1672
|
-
/**
|
1673
|
-
* NOTICE: DO NOT MODIFY THIS FILE!
|
1674
|
-
* The contents of this file were automatically generated by
|
1675
|
-
* the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-core' schematic.
|
1676
|
-
* To update this file, simply rerun the command.
|
1677
|
-
*/
|
1678
|
-
var RESOURCES = {
|
1679
|
-
'EN-US': {
|
1680
|
-
skyux_numeric_billions_symbol: { message: 'B' },
|
1681
|
-
skyux_numeric_millions_symbol: { message: 'M' },
|
1682
|
-
skyux_numeric_thousands_symbol: { message: 'K' },
|
1683
|
-
skyux_numeric_trillions_symbol: { message: 'T' },
|
1684
|
-
},
|
1685
|
-
};
|
1686
|
-
var SkyCoreResourcesProvider = /** @class */ (function () {
|
1687
|
-
function SkyCoreResourcesProvider() {
|
1688
|
-
}
|
1689
|
-
SkyCoreResourcesProvider.prototype.getString = function (localeInfo, name) {
|
1690
|
-
return i1.getLibStringForLocale(RESOURCES, localeInfo.locale, name);
|
1691
|
-
};
|
1692
|
-
return SkyCoreResourcesProvider;
|
1693
|
-
}());
|
1694
|
-
/**
|
1695
|
-
* Import into any component library module that needs to use resource strings.
|
1696
|
-
*/
|
1697
|
-
var SkyCoreResourcesModule = /** @class */ (function () {
|
1698
|
-
function SkyCoreResourcesModule() {
|
1699
|
-
}
|
1700
|
-
return SkyCoreResourcesModule;
|
1701
|
-
}());
|
1702
|
-
SkyCoreResourcesModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCoreResourcesModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
1703
|
-
SkyCoreResourcesModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCoreResourcesModule, exports: [i1.SkyI18nModule] });
|
1704
|
-
SkyCoreResourcesModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCoreResourcesModule, providers: [
|
1705
|
-
{
|
1706
|
-
provide: i1.SKY_LIB_RESOURCES_PROVIDERS,
|
1707
|
-
useClass: SkyCoreResourcesProvider,
|
1708
|
-
multi: true,
|
1709
|
-
},
|
1710
|
-
], imports: [i1.SkyI18nModule] });
|
1711
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCoreResourcesModule, decorators: [{
|
1712
|
-
type: i0.NgModule,
|
1713
|
-
args: [{
|
1714
|
-
exports: [i1.SkyI18nModule],
|
1715
|
-
providers: [
|
1716
|
-
{
|
1717
|
-
provide: i1.SKY_LIB_RESOURCES_PROVIDERS,
|
1718
|
-
useClass: SkyCoreResourcesProvider,
|
1719
|
-
multi: true,
|
1720
|
-
},
|
1721
|
-
],
|
1722
|
-
}]
|
1723
|
-
}] });
|
1724
|
-
|
1725
|
-
/**
|
1726
|
-
* Provides arguments for the number to format.
|
1727
|
-
*/
|
1728
|
-
var NumericOptions = /** @class */ (function () {
|
1729
|
-
function NumericOptions() {
|
1730
|
-
/**
|
1731
|
-
* Specifies the maximum number of digits after the decimal separator.
|
1732
|
-
* @default 1
|
1733
|
-
*/
|
1734
|
-
this.digits = 1;
|
1735
|
-
/**
|
1736
|
-
* Specifies how to format the number. Options are `currency` or `number`.
|
1737
|
-
* @default "number"
|
1738
|
-
*/
|
1739
|
-
this.format = 'number';
|
1740
|
-
/**
|
1741
|
-
* Specifies the format of the currency.
|
1742
|
-
* @default "standard"
|
1743
|
-
*/
|
1744
|
-
this.currencySign = 'standard';
|
1745
|
-
/**
|
1746
|
-
* Specifies the ISO4217 currency code to use for currency formatting. If you do not specify a
|
1747
|
-
* currency code, the component uses the browser's culture to determine the currency unless your
|
1748
|
-
* SPA provides a different culture with `SkyAppLocaleProvider`.
|
1749
|
-
* @default "USD"
|
1750
|
-
*/
|
1751
|
-
this.iso = 'USD';
|
1752
|
-
/**
|
1753
|
-
* Indicates whether to shorten numbers to rounded numbers and abbreviation characters
|
1754
|
-
* such as K for thousands, M for millions, B for billions, and T for trillions.
|
1755
|
-
*/
|
1756
|
-
this.truncate = true;
|
1757
|
-
/**
|
1758
|
-
* Specifies the starting point after which numbers are shortened to rounded numbers
|
1759
|
-
* and abbreviation characters.
|
1760
|
-
* @default 0
|
1761
|
-
*/
|
1762
|
-
this.truncateAfter = 0;
|
1763
|
-
}
|
1764
|
-
return NumericOptions;
|
1765
|
-
}());
|
1766
|
-
|
1767
|
-
/*! *****************************************************************************
|
1768
|
-
Copyright (c) Microsoft Corporation.
|
1769
|
-
|
1770
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
1771
|
-
purpose with or without fee is hereby granted.
|
1772
|
-
|
1773
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
1774
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
1775
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
1776
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
1777
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
1778
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
1779
|
-
PERFORMANCE OF THIS SOFTWARE.
|
1780
|
-
***************************************************************************** */
|
1781
|
-
/* global Reflect, Promise */
|
1782
|
-
var extendStatics = function (d, b) {
|
1783
|
-
extendStatics = Object.setPrototypeOf ||
|
1784
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
1785
|
-
function (d, b) { for (var p in b)
|
1786
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
1787
|
-
d[p] = b[p]; };
|
1788
|
-
return extendStatics(d, b);
|
1789
|
-
};
|
1790
|
-
function __extends(d, b) {
|
1791
|
-
if (typeof b !== "function" && b !== null)
|
1792
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
1793
|
-
extendStatics(d, b);
|
1794
|
-
function __() { this.constructor = d; }
|
1795
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
1796
|
-
}
|
1797
|
-
var __assign = function () {
|
1798
|
-
__assign = Object.assign || function __assign(t) {
|
1799
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
1800
|
-
s = arguments[i];
|
1801
|
-
for (var p in s)
|
1802
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
1803
|
-
t[p] = s[p];
|
1804
|
-
}
|
1805
|
-
return t;
|
1806
|
-
};
|
1807
|
-
return __assign.apply(this, arguments);
|
1808
|
-
};
|
1809
|
-
function __rest(s, e) {
|
1810
|
-
var t = {};
|
1811
|
-
for (var p in s)
|
1812
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
1813
|
-
t[p] = s[p];
|
1814
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
1815
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
1816
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
1817
|
-
t[p[i]] = s[p[i]];
|
1818
|
-
}
|
1819
|
-
return t;
|
1820
|
-
}
|
1821
|
-
function __decorate(decorators, target, key, desc) {
|
1822
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
1823
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
1824
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
1825
|
-
else
|
1826
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
1827
|
-
if (d = decorators[i])
|
1828
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
1829
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
1830
|
-
}
|
1831
|
-
function __param(paramIndex, decorator) {
|
1832
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
1833
|
-
}
|
1834
|
-
function __metadata(metadataKey, metadataValue) {
|
1835
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
1836
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
1837
|
-
}
|
1838
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
1839
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
1840
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
1841
|
-
function fulfilled(value) { try {
|
1842
|
-
step(generator.next(value));
|
1843
|
-
}
|
1844
|
-
catch (e) {
|
1845
|
-
reject(e);
|
1846
|
-
} }
|
1847
|
-
function rejected(value) { try {
|
1848
|
-
step(generator["throw"](value));
|
1849
|
-
}
|
1850
|
-
catch (e) {
|
1851
|
-
reject(e);
|
1852
|
-
} }
|
1853
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
1854
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
1855
|
-
});
|
1856
|
-
}
|
1857
|
-
function __generator(thisArg, body) {
|
1858
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
1859
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
1860
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
1861
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
1862
|
-
function step(op) {
|
1863
|
-
if (f)
|
1864
|
-
throw new TypeError("Generator is already executing.");
|
1865
|
-
while (_)
|
1866
|
-
try {
|
1867
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
1868
|
-
return t;
|
1869
|
-
if (y = 0, t)
|
1870
|
-
op = [op[0] & 2, t.value];
|
1871
|
-
switch (op[0]) {
|
1872
|
-
case 0:
|
1873
|
-
case 1:
|
1874
|
-
t = op;
|
1875
|
-
break;
|
1876
|
-
case 4:
|
1877
|
-
_.label++;
|
1878
|
-
return { value: op[1], done: false };
|
1879
|
-
case 5:
|
1880
|
-
_.label++;
|
1881
|
-
y = op[1];
|
1882
|
-
op = [0];
|
1883
|
-
continue;
|
1884
|
-
case 7:
|
1885
|
-
op = _.ops.pop();
|
1886
|
-
_.trys.pop();
|
1887
|
-
continue;
|
1888
|
-
default:
|
1889
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
1890
|
-
_ = 0;
|
1891
|
-
continue;
|
1892
|
-
}
|
1893
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
1894
|
-
_.label = op[1];
|
1895
|
-
break;
|
1896
|
-
}
|
1897
|
-
if (op[0] === 6 && _.label < t[1]) {
|
1898
|
-
_.label = t[1];
|
1899
|
-
t = op;
|
1900
|
-
break;
|
1901
|
-
}
|
1902
|
-
if (t && _.label < t[2]) {
|
1903
|
-
_.label = t[2];
|
1904
|
-
_.ops.push(op);
|
1905
|
-
break;
|
1906
|
-
}
|
1907
|
-
if (t[2])
|
1908
|
-
_.ops.pop();
|
1909
|
-
_.trys.pop();
|
1910
|
-
continue;
|
1911
|
-
}
|
1912
|
-
op = body.call(thisArg, _);
|
1913
|
-
}
|
1914
|
-
catch (e) {
|
1915
|
-
op = [6, e];
|
1916
|
-
y = 0;
|
1917
|
-
}
|
1918
|
-
finally {
|
1919
|
-
f = t = 0;
|
1920
|
-
}
|
1921
|
-
if (op[0] & 5)
|
1922
|
-
throw op[1];
|
1923
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
1924
|
-
}
|
1925
|
-
}
|
1926
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
1927
|
-
if (k2 === undefined)
|
1928
|
-
k2 = k;
|
1929
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
1930
|
-
}) : (function (o, m, k, k2) {
|
1931
|
-
if (k2 === undefined)
|
1932
|
-
k2 = k;
|
1933
|
-
o[k2] = m[k];
|
1934
|
-
});
|
1935
|
-
function __exportStar(m, o) {
|
1936
|
-
for (var p in m)
|
1937
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
1938
|
-
__createBinding(o, m, p);
|
1939
|
-
}
|
1940
|
-
function __values(o) {
|
1941
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
1942
|
-
if (m)
|
1943
|
-
return m.call(o);
|
1944
|
-
if (o && typeof o.length === "number")
|
1945
|
-
return {
|
1946
|
-
next: function () {
|
1947
|
-
if (o && i >= o.length)
|
1948
|
-
o = void 0;
|
1949
|
-
return { value: o && o[i++], done: !o };
|
1950
|
-
}
|
1951
|
-
};
|
1952
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
1953
|
-
}
|
1954
|
-
function __read(o, n) {
|
1955
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
1956
|
-
if (!m)
|
1957
|
-
return o;
|
1958
|
-
var i = m.call(o), r, ar = [], e;
|
1959
|
-
try {
|
1960
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
1961
|
-
ar.push(r.value);
|
1962
|
-
}
|
1963
|
-
catch (error) {
|
1964
|
-
e = { error: error };
|
1965
|
-
}
|
1966
|
-
finally {
|
1967
|
-
try {
|
1968
|
-
if (r && !r.done && (m = i["return"]))
|
1969
|
-
m.call(i);
|
1970
|
-
}
|
1971
|
-
finally {
|
1972
|
-
if (e)
|
1973
|
-
throw e.error;
|
1974
|
-
}
|
1975
|
-
}
|
1976
|
-
return ar;
|
1977
|
-
}
|
1978
|
-
/** @deprecated */
|
1979
|
-
function __spread() {
|
1980
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
1981
|
-
ar = ar.concat(__read(arguments[i]));
|
1982
|
-
return ar;
|
1983
|
-
}
|
1984
|
-
/** @deprecated */
|
1985
|
-
function __spreadArrays() {
|
1986
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
1987
|
-
s += arguments[i].length;
|
1988
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
1989
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
1990
|
-
r[k] = a[j];
|
1991
|
-
return r;
|
1992
|
-
}
|
1993
|
-
function __spreadArray(to, from, pack) {
|
1994
|
-
if (pack || arguments.length === 2)
|
1995
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
1996
|
-
if (ar || !(i in from)) {
|
1997
|
-
if (!ar)
|
1998
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
1999
|
-
ar[i] = from[i];
|
2000
|
-
}
|
2001
|
-
}
|
2002
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
2003
|
-
}
|
2004
|
-
function __await(v) {
|
2005
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
2006
|
-
}
|
2007
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
2008
|
-
if (!Symbol.asyncIterator)
|
2009
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
2010
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
2011
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
2012
|
-
function verb(n) { if (g[n])
|
2013
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
2014
|
-
function resume(n, v) { try {
|
2015
|
-
step(g[n](v));
|
2016
|
-
}
|
2017
|
-
catch (e) {
|
2018
|
-
settle(q[0][3], e);
|
2019
|
-
} }
|
2020
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
2021
|
-
function fulfill(value) { resume("next", value); }
|
2022
|
-
function reject(value) { resume("throw", value); }
|
2023
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
2024
|
-
resume(q[0][0], q[0][1]); }
|
2025
|
-
}
|
2026
|
-
function __asyncDelegator(o) {
|
2027
|
-
var i, p;
|
2028
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
2029
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
2030
|
-
}
|
2031
|
-
function __asyncValues(o) {
|
2032
|
-
if (!Symbol.asyncIterator)
|
2033
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
2034
|
-
var m = o[Symbol.asyncIterator], i;
|
2035
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
2036
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
2037
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
2038
|
-
}
|
2039
|
-
function __makeTemplateObject(cooked, raw) {
|
2040
|
-
if (Object.defineProperty) {
|
2041
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
2042
|
-
}
|
2043
|
-
else {
|
2044
|
-
cooked.raw = raw;
|
2045
|
-
}
|
2046
|
-
return cooked;
|
2047
|
-
}
|
2048
|
-
;
|
2049
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
2050
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
2051
|
-
}) : function (o, v) {
|
2052
|
-
o["default"] = v;
|
2053
|
-
};
|
2054
|
-
function __importStar(mod) {
|
2055
|
-
if (mod && mod.__esModule)
|
2056
|
-
return mod;
|
2057
|
-
var result = {};
|
2058
|
-
if (mod != null)
|
2059
|
-
for (var k in mod)
|
2060
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
2061
|
-
__createBinding(result, mod, k);
|
2062
|
-
__setModuleDefault(result, mod);
|
2063
|
-
return result;
|
2064
|
-
}
|
2065
|
-
function __importDefault(mod) {
|
2066
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
2067
|
-
}
|
2068
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
2069
|
-
if (kind === "a" && !f)
|
2070
|
-
throw new TypeError("Private accessor was defined without a getter");
|
2071
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
2072
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
2073
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
2074
|
-
}
|
2075
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
2076
|
-
if (kind === "m")
|
2077
|
-
throw new TypeError("Private method is not writable");
|
2078
|
-
if (kind === "a" && !f)
|
2079
|
-
throw new TypeError("Private accessor was defined without a setter");
|
2080
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
2081
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
2082
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
2083
|
-
}
|
2084
|
-
|
2085
|
-
/* tslint:disable:no-null-keyword */
|
2086
|
-
function isNumeric(value) {
|
2087
|
-
return !isNaN(value - parseFloat(value));
|
2088
|
-
}
|
2089
|
-
function parseIntAutoRadix(text) {
|
2090
|
-
var result = parseInt(text, 10);
|
2091
|
-
/* istanbul ignore next */
|
2092
|
-
if (isNaN(result)) {
|
2093
|
-
throw new Error('Invalid integer literal when parsing ' + text);
|
2094
|
-
}
|
2095
|
-
return result;
|
2096
|
-
}
|
2097
|
-
// Need to add the following to classes which contain static methods.
|
2098
|
-
// See: https://github.com/ng-packagr/ng-packagr/issues/641
|
2099
|
-
// @dynamic
|
2100
|
-
var SkyNumberFormatUtility = /** @class */ (function () {
|
2101
|
-
function SkyNumberFormatUtility() {
|
2102
|
-
}
|
2103
|
-
SkyNumberFormatUtility.formatNumber = function (locale, value, style, digits, currency, currencyAsSymbol, currencySign) {
|
2104
|
-
if (currency === void 0) { currency = null; }
|
2105
|
-
if (currencyAsSymbol === void 0) { currencyAsSymbol = false; }
|
2106
|
-
if (value == null) {
|
2107
|
-
return null;
|
2108
|
-
}
|
2109
|
-
// Convert strings to numbers
|
2110
|
-
value = typeof value === 'string' && isNumeric(value) ? +value : value;
|
2111
|
-
if (typeof value !== 'number') {
|
2112
|
-
throw Error("SkyInvalidPipeArgument: '" + value + "'");
|
2113
|
-
}
|
2114
|
-
var minInt = undefined;
|
2115
|
-
var minFraction = undefined;
|
2116
|
-
var maxFraction = undefined;
|
2117
|
-
if (style !== i1.SkyIntlNumberFormatStyle.Currency) {
|
2118
|
-
// rely on Intl default for currency
|
2119
|
-
minInt = 1;
|
2120
|
-
minFraction = 0;
|
2121
|
-
maxFraction = 3;
|
2122
|
-
}
|
2123
|
-
if (digits) {
|
2124
|
-
var parts = digits.match(this._NUMBER_FORMAT_REGEXP);
|
2125
|
-
if (parts === null) {
|
2126
|
-
throw new Error(digits + " is not a valid digit info for number pipes");
|
2127
|
-
}
|
2128
|
-
/* istanbul ignore else */
|
2129
|
-
if (parts[1] != null) {
|
2130
|
-
// min integer digits
|
2131
|
-
minInt = parseIntAutoRadix(parts[1]);
|
2132
|
-
}
|
2133
|
-
/* istanbul ignore else */
|
2134
|
-
if (parts[3] != null) {
|
2135
|
-
// min fraction digits
|
2136
|
-
minFraction = parseIntAutoRadix(parts[3]);
|
2137
|
-
}
|
2138
|
-
/* istanbul ignore else */
|
2139
|
-
if (parts[5] != null) {
|
2140
|
-
// max fraction digits
|
2141
|
-
maxFraction = parseIntAutoRadix(parts[5]);
|
2142
|
-
}
|
2143
|
-
}
|
2144
|
-
return i1.SkyIntlNumberFormatter.format(value, locale, style, {
|
2145
|
-
minimumIntegerDigits: minInt,
|
2146
|
-
minimumFractionDigits: minFraction,
|
2147
|
-
maximumFractionDigits: maxFraction,
|
2148
|
-
currency: currency,
|
2149
|
-
currencyAsSymbol: currencyAsSymbol,
|
2150
|
-
currencySign: currencySign,
|
2151
|
-
});
|
2152
|
-
};
|
2153
|
-
return SkyNumberFormatUtility;
|
2154
|
-
}());
|
2155
|
-
SkyNumberFormatUtility._NUMBER_FORMAT_REGEXP = /^(\d+)?\.((\d+)(-(\d+))?)?$/;
|
2156
|
-
|
2157
|
-
var SkyNumericService = /** @class */ (function () {
|
2158
|
-
function SkyNumericService(resourcesService) {
|
2159
|
-
this.resourcesService = resourcesService;
|
2160
|
-
this.symbolIndex = [
|
2161
|
-
{ value: 1e12, label: this.getSymbol('skyux_numeric_trillions_symbol') },
|
2162
|
-
{ value: 1e9, label: this.getSymbol('skyux_numeric_billions_symbol') },
|
2163
|
-
{ value: 1e6, label: this.getSymbol('skyux_numeric_millions_symbol') },
|
2164
|
-
{ value: 1e3, label: this.getSymbol('skyux_numeric_thousands_symbol') },
|
2165
|
-
];
|
2166
|
-
}
|
2167
|
-
Object.defineProperty(SkyNumericService.prototype, "currentLocale", {
|
2168
|
-
get: function () {
|
2169
|
-
return this._locale || 'en-US';
|
2170
|
-
},
|
2171
|
-
/**
|
2172
|
-
* The browser's current locale.
|
2173
|
-
* @internal
|
2174
|
-
*/
|
2175
|
-
set: function (value) {
|
2176
|
-
this._locale = value;
|
2177
|
-
},
|
2178
|
-
enumerable: false,
|
2179
|
-
configurable: true
|
2180
|
-
});
|
2181
|
-
/**
|
2182
|
-
* Shortens with or without symbol (K/M/B/T) depending on value of number.
|
2183
|
-
* @param value The number to format.
|
2184
|
-
* @param options Format options.
|
2185
|
-
*/
|
2186
|
-
SkyNumericService.prototype.formatNumber = function (value, options) {
|
2187
|
-
var _a;
|
2188
|
-
/* tslint:disable-next-line:no-null-keyword */
|
2189
|
-
if (isNaN(value) || value === null) {
|
2190
|
-
return '';
|
2191
|
-
}
|
2192
|
-
var decimalPlaceRegExp = /\.0+$|(\.[0-9]*[1-9])0+$/;
|
2193
|
-
// Get the symbol for the number after rounding, since rounding could push the number
|
2194
|
-
// into a different symbol range.
|
2195
|
-
var roundedNumber = this.roundNumber(value, options.digits);
|
2196
|
-
var roundedNumberAbs = Math.abs(roundedNumber);
|
2197
|
-
var suffix = '';
|
2198
|
-
for (var i = 0; i < this.symbolIndex.length; i++) {
|
2199
|
-
var symbol = this.symbolIndex[i];
|
2200
|
-
if (options.truncate &&
|
2201
|
-
roundedNumberAbs >= options.truncateAfter &&
|
2202
|
-
roundedNumberAbs >= symbol.value) {
|
2203
|
-
roundedNumber = this.roundNumber(value / symbol.value, options.digits);
|
2204
|
-
if (Math.abs(roundedNumber) === 1000 && i > 0) {
|
2205
|
-
// Rounding caused the number to cross into the range of the next symbol.
|
2206
|
-
symbol = this.symbolIndex[i - 1];
|
2207
|
-
roundedNumber /= 1000;
|
2208
|
-
}
|
2209
|
-
suffix = symbol.label;
|
2210
|
-
break;
|
2211
|
-
}
|
2212
|
-
}
|
2213
|
-
var output = roundedNumber.toString().replace(decimalPlaceRegExp, '$1') + suffix;
|
2214
|
-
this.storeShortenSymbol(output);
|
2215
|
-
var locale = options.locale || this.currentLocale;
|
2216
|
-
var digits;
|
2217
|
-
var isDecimal;
|
2218
|
-
// Checks the string entered for format. Using toLowerCase to ignore case.
|
2219
|
-
switch ((_a = options.format) === null || _a === void 0 ? void 0 : _a.toLowerCase()) {
|
2220
|
-
// In a case where a decimal value was not shortened and
|
2221
|
-
// the digit input is 2 or higher, it forces 2 digits.
|
2222
|
-
// For example, this prevents a value like $15.50 from displaying as $15.5.
|
2223
|
-
// Note: This will need to be reviewed if we support currencies with
|
2224
|
-
// three decimal digits.
|
2225
|
-
case 'currency':
|
2226
|
-
isDecimal = value % 1 !== 0;
|
2227
|
-
if (options.minDigits) {
|
2228
|
-
digits = "1." + options.minDigits + "-" + options.digits;
|
2229
|
-
}
|
2230
|
-
else if (isDecimal && options.digits >= 2) {
|
2231
|
-
digits = "1.2-" + options.digits;
|
2232
|
-
}
|
2233
|
-
else {
|
2234
|
-
digits = "1.0-" + options.digits;
|
2235
|
-
}
|
2236
|
-
output = SkyNumberFormatUtility.formatNumber(locale, parseFloat(output), i1.SkyIntlNumberFormatStyle.Currency, digits, options.iso,
|
2237
|
-
// Angular 5+ needs a string for this parameter, but Angular 4 needs a boolean.
|
2238
|
-
// To support both versions we can supply 'symbol' which will evaluate truthy for Angular 4
|
2239
|
-
// and the appropriate string value for Angular 5+.
|
2240
|
-
// See: https://angular.io/api/common/CurrencyPipe#parameters
|
2241
|
-
'symbol', options.currencySign);
|
2242
|
-
break;
|
2243
|
-
// The following is a catch-all to ensure that if
|
2244
|
-
// anything but currency (or a future option) are entered,
|
2245
|
-
// it will be treated like a number.
|
2246
|
-
default:
|
2247
|
-
// Ensures localization of the number to ensure comma and
|
2248
|
-
// decimal separator
|
2249
|
-
if (options.minDigits) {
|
2250
|
-
digits = "1." + options.minDigits + "-" + options.digits;
|
2251
|
-
}
|
2252
|
-
else if (options.truncate) {
|
2253
|
-
digits = "1.0-" + options.digits;
|
2254
|
-
}
|
2255
|
-
else {
|
2256
|
-
digits = "1." + options.digits + "-" + options.digits;
|
2257
|
-
}
|
2258
|
-
output = SkyNumberFormatUtility.formatNumber(locale, parseFloat(output), i1.SkyIntlNumberFormatStyle.Decimal, digits);
|
2259
|
-
break;
|
2260
|
-
}
|
2261
|
-
if (options.truncate) {
|
2262
|
-
output = this.replaceShortenSymbol(output);
|
2263
|
-
}
|
2264
|
-
return output;
|
2265
|
-
};
|
2266
|
-
/**
|
2267
|
-
* Rounds a given number
|
2268
|
-
*
|
2269
|
-
* JS's limitation - numbers bigger than Number.MIN_SAFE_INTEGER or Number.MAX_SAFE_INTEGER
|
2270
|
-
* are not guaranteed to be represented or rounded correctly
|
2271
|
-
* @param value - value to round
|
2272
|
-
* @param precision - what precision to round with, defaults to 0 decimal places
|
2273
|
-
*/
|
2274
|
-
SkyNumericService.prototype.roundNumber = function (value, precision) {
|
2275
|
-
if (precision === void 0) { precision = 0; }
|
2276
|
-
if (precision < 0) {
|
2277
|
-
throw new Error('SkyInvalidArgument: precision must be >= 0');
|
2278
|
-
}
|
2279
|
-
/* tslint:disable-next-line:no-null-keyword */
|
2280
|
-
/* Sanity check - ignoring coverage but should not ignore if we make this method public */
|
2281
|
-
/* istanbul ignore next */
|
2282
|
-
if (isNaN(value) || value === null) {
|
2283
|
-
return 0;
|
2284
|
-
}
|
2285
|
-
var scaledValue = this.scaleNumberByPowerOfTen(value, precision, true);
|
2286
|
-
var scaledRoundedValue = Math.round(scaledValue);
|
2287
|
-
var unscaledRoundedValue = this.scaleNumberByPowerOfTen(scaledRoundedValue, precision, false);
|
2288
|
-
return unscaledRoundedValue;
|
2289
|
-
};
|
2290
|
-
/**
|
2291
|
-
* Scales a given number by a power of 10
|
2292
|
-
* @param value - value to scale
|
2293
|
-
* @param scalar - 10^scalar
|
2294
|
-
* @param scaleUp - whether to increase or decrease the value
|
2295
|
-
*/
|
2296
|
-
SkyNumericService.prototype.scaleNumberByPowerOfTen = function (value, scalar, scaleUp) {
|
2297
|
-
var valueStr = value.toString().toLowerCase();
|
2298
|
-
var isExponentFormat = valueStr.includes('e');
|
2299
|
-
if (isExponentFormat) {
|
2300
|
-
var _b = __read(valueStr.split('e'), 2), base = _b[0], exp = _b[1];
|
2301
|
-
var newExp = scaleUp ? Number(exp) + scalar : Number(exp) - scalar;
|
2302
|
-
return Number(base + "e" + newExp);
|
2303
|
-
}
|
2304
|
-
else {
|
2305
|
-
var e = scaleUp ? 'e' : 'e-';
|
2306
|
-
return Number("" + value + e + scalar);
|
2307
|
-
}
|
2308
|
-
};
|
2309
|
-
/**
|
2310
|
-
* Stores the symbol added from shortening to reapply later.
|
2311
|
-
* @param value The string to derive the shorten symbol from.
|
2312
|
-
*/
|
2313
|
-
SkyNumericService.prototype.storeShortenSymbol = function (value) {
|
2314
|
-
var symbols = this.symbolIndex.map(function (s) { return s.label; });
|
2315
|
-
var regexp = new RegExp(symbols.join('|'), 'ig');
|
2316
|
-
var match = value.match(regexp);
|
2317
|
-
this.shortSymbol = match ? match.toString() : '';
|
2318
|
-
};
|
2319
|
-
/**
|
2320
|
-
* Must have previously called storeShortenSymbol to have something to replace.
|
2321
|
-
* Finds the last number in the formatted number, gets the index of the position
|
2322
|
-
* after that character and re-inserts the symbol.
|
2323
|
-
* Works regardless of currency symbol position.
|
2324
|
-
* @param value The string to modify.
|
2325
|
-
*/
|
2326
|
-
SkyNumericService.prototype.replaceShortenSymbol = function (value) {
|
2327
|
-
var result = /(\d)(?!.*\d)/g.exec(value);
|
2328
|
-
var pos = result.index + result.length;
|
2329
|
-
var output = value.substring(0, pos) + this.shortSymbol + value.substring(pos);
|
2330
|
-
return output;
|
2331
|
-
};
|
2332
|
-
SkyNumericService.prototype.getSymbol = function (key) {
|
2333
|
-
// TODO: Need to implement the async `getString` method in a breaking change.
|
2334
|
-
return this.resourcesService.getStringForLocale({ locale: 'en_US' }, key);
|
2335
|
-
};
|
2336
|
-
return SkyNumericService;
|
2337
|
-
}());
|
2338
|
-
SkyNumericService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyNumericService, deps: [{ token: i1__namespace.SkyLibResourcesService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
2339
|
-
SkyNumericService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyNumericService, providedIn: 'any' });
|
2340
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyNumericService, decorators: [{
|
2341
|
-
type: i0.Injectable,
|
2342
|
-
args: [{
|
2343
|
-
providedIn: 'any',
|
2344
|
-
}]
|
2345
|
-
}], ctorParameters: function () { return [{ type: i1__namespace.SkyLibResourcesService }]; } });
|
2346
|
-
|
2347
|
-
/**
|
2348
|
-
* Shortens numbers to rounded numbers and abbreviation characters such as K for thousands,
|
2349
|
-
* M for millions, B for billions, and T for trillions. The pipe also formats for currency.
|
2350
|
-
* Be sure you have a space after the two curly brackets opening the pipe and
|
2351
|
-
* a space before the two curly brackets closing the pipe or it will not work.
|
2352
|
-
* Usage:
|
2353
|
-
* ```
|
2354
|
-
* {{ value | skyNumeric(config) }}
|
2355
|
-
* ```
|
2356
|
-
*/
|
2357
|
-
var SkyNumericPipe = /** @class */ (function () {
|
2358
|
-
function SkyNumericPipe(localeProvider, numericService, changeDetector) {
|
2359
|
-
var _this = this;
|
2360
|
-
this.localeProvider = localeProvider;
|
2361
|
-
this.numericService = numericService;
|
2362
|
-
this.changeDetector = changeDetector;
|
2363
|
-
this.ngUnsubscribe = new rxjs.Subject();
|
2364
|
-
this.localeProvider
|
2365
|
-
.getLocaleInfo()
|
2366
|
-
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
2367
|
-
.subscribe(function (localeInfo) {
|
2368
|
-
_this.providerLocale = localeInfo.locale;
|
2369
|
-
numericService.currentLocale = _this.providerLocale;
|
2370
|
-
_this.changeDetector.markForCheck();
|
2371
|
-
});
|
2372
|
-
}
|
2373
|
-
SkyNumericPipe.prototype.ngOnDestroy = function () {
|
2374
|
-
this.ngUnsubscribe.next();
|
2375
|
-
this.ngUnsubscribe.complete();
|
2376
|
-
};
|
2377
|
-
SkyNumericPipe.prototype.transform = function (value, config) {
|
2378
|
-
var _a;
|
2379
|
-
var newCacheKey = (config ? JSON.stringify(config, Object.keys(config).sort()) : '') +
|
2380
|
-
(value + "_" + ((config === null || config === void 0 ? void 0 : config.locale) || this.providerLocale));
|
2381
|
-
/* If the value and locale are the same as the last transform then return the previous value
|
2382
|
-
instead of reformatting. */
|
2383
|
-
if (this.formattedValue && this.cacheKey === newCacheKey) {
|
2384
|
-
return this.formattedValue;
|
2385
|
-
}
|
2386
|
-
var options = new NumericOptions();
|
2387
|
-
// The default number of digits is `1`. When truncate is disabled, set digits
|
2388
|
-
// to `0` to avoid the unnecessary addition of `.0` at the end of the formatted number.
|
2389
|
-
if (config && config.truncate === false && config.digits === undefined) {
|
2390
|
-
options.digits = 0;
|
2391
|
-
}
|
2392
|
-
// If the minimum digits is less than the set maximum digits then throw an error
|
2393
|
-
if (config &&
|
2394
|
-
config.minDigits &&
|
2395
|
-
config.digits &&
|
2396
|
-
config.minDigits > config.digits) {
|
2397
|
-
throw new Error('The `digits` property must be greater than or equal to the `minDigits` property');
|
2398
|
-
// If there is a minimum digits given but not a maximum then default the maximum to the minimum
|
2399
|
-
}
|
2400
|
-
else if (config && config.minDigits && !config.digits) {
|
2401
|
-
options.digits = config.minDigits;
|
2402
|
-
}
|
2403
|
-
Object.assign(options, config);
|
2404
|
-
// Assign properties for proper result caching.
|
2405
|
-
this.rawValue = value;
|
2406
|
-
this.lastTransformLocale = (_a = config === null || config === void 0 ? void 0 : config.locale) !== null && _a !== void 0 ? _a : this.providerLocale;
|
2407
|
-
this.cacheKey = newCacheKey;
|
2408
|
-
this.formattedValue = this.numericService.formatNumber(value, options);
|
2409
|
-
return this.formattedValue;
|
2410
|
-
};
|
2411
|
-
return SkyNumericPipe;
|
2412
|
-
}());
|
2413
|
-
SkyNumericPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyNumericPipe, deps: [{ token: i1__namespace.SkyAppLocaleProvider }, { token: SkyNumericService }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
2414
|
-
SkyNumericPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyNumericPipe, name: "skyNumeric", pure: false });
|
2415
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyNumericPipe, decorators: [{
|
2416
|
-
type: i0.Pipe,
|
2417
|
-
args: [{
|
2418
|
-
name: 'skyNumeric',
|
2419
|
-
pure: false,
|
2420
|
-
}]
|
2421
|
-
}], ctorParameters: function () { return [{ type: i1__namespace.SkyAppLocaleProvider }, { type: SkyNumericService }, { type: i0__namespace.ChangeDetectorRef }]; } });
|
2422
|
-
|
2423
|
-
var SkyNumericModule = /** @class */ (function () {
|
2424
|
-
function SkyNumericModule() {
|
2425
|
-
}
|
2426
|
-
return SkyNumericModule;
|
2427
|
-
}());
|
2428
|
-
SkyNumericModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyNumericModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
2429
|
-
SkyNumericModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyNumericModule, declarations: [SkyNumericPipe], imports: [i1.SkyI18nModule, SkyCoreResourcesModule], exports: [SkyNumericPipe] });
|
2430
|
-
SkyNumericModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyNumericModule, providers: [SkyNumericPipe], imports: [[i1.SkyI18nModule, SkyCoreResourcesModule]] });
|
2431
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyNumericModule, decorators: [{
|
2432
|
-
type: i0.NgModule,
|
2433
|
-
args: [{
|
2434
|
-
declarations: [SkyNumericPipe],
|
2435
|
-
providers: [SkyNumericPipe],
|
2436
|
-
imports: [i1.SkyI18nModule, SkyCoreResourcesModule],
|
2437
|
-
exports: [SkyNumericPipe],
|
2438
|
-
}]
|
2439
|
-
}] });
|
2440
|
-
|
2441
|
-
/**
|
2442
|
-
* Represents a new overlay instance. It is used to manage the "closed" state of the overlay,
|
2443
|
-
* and access any public members on the appended content component instance.
|
2444
|
-
*/
|
2445
|
-
var SkyOverlayInstance = /** @class */ (function () {
|
2446
|
-
function SkyOverlayInstance(
|
2447
|
-
/**
|
2448
|
-
* The configuration for the overlay.
|
2449
|
-
*/
|
2450
|
-
config, componentRef) {
|
2451
|
-
var _this = this;
|
2452
|
-
this.config = config;
|
2453
|
-
this.componentRef = componentRef;
|
2454
|
-
this._backdropClick = new rxjs.Subject();
|
2455
|
-
this._closed = new rxjs.Subject();
|
2456
|
-
this.componentRef.instance.closed.subscribe(function () {
|
2457
|
-
_this._closed.next();
|
2458
|
-
_this._closed.complete();
|
2459
|
-
_this._backdropClick.complete();
|
2460
|
-
});
|
2461
|
-
this.componentRef.instance.backdropClick.subscribe(function () {
|
2462
|
-
_this._backdropClick.next();
|
2463
|
-
});
|
2464
|
-
}
|
2465
|
-
Object.defineProperty(SkyOverlayInstance.prototype, "backdropClick", {
|
2466
|
-
/**
|
2467
|
-
* Emits when the overlay is clicked (but not its content).
|
2468
|
-
*/
|
2469
|
-
get: function () {
|
2470
|
-
return this._backdropClick.asObservable();
|
2471
|
-
},
|
2472
|
-
enumerable: false,
|
2473
|
-
configurable: true
|
2474
|
-
});
|
2475
|
-
Object.defineProperty(SkyOverlayInstance.prototype, "closed", {
|
2476
|
-
/**
|
2477
|
-
* Emits after the overlay is closed.
|
2478
|
-
*/
|
2479
|
-
get: function () {
|
2480
|
-
return this._closed.asObservable();
|
2481
|
-
},
|
2482
|
-
enumerable: false,
|
2483
|
-
configurable: true
|
2484
|
-
});
|
2485
|
-
/**
|
2486
|
-
* Creates and attaches a component to the overlay.
|
2487
|
-
* @param component The component to attach.
|
2488
|
-
* @param providers Custom providers to apply to the component.
|
2489
|
-
*/
|
2490
|
-
SkyOverlayInstance.prototype.attachComponent = function (component, providers) {
|
2491
|
-
var componentRef = this.componentRef.instance.attachComponent(component, providers);
|
2492
|
-
return componentRef.instance;
|
2493
|
-
};
|
2494
|
-
/**
|
2495
|
-
* Attaches a `TemplateRef` to the overlay.
|
2496
|
-
* @param templateRef The `TemplateRef` to attach.
|
2497
|
-
* @param context The context to provide to the template.
|
2498
|
-
*/
|
2499
|
-
SkyOverlayInstance.prototype.attachTemplate = function (templateRef, context) {
|
2500
|
-
this.componentRef.instance.attachTemplate(templateRef, context);
|
2501
|
-
};
|
2502
|
-
return SkyOverlayInstance;
|
2503
|
-
}());
|
2504
|
-
|
2505
|
-
/**
|
2506
|
-
* Provides contextual information to each overlay created.
|
2507
|
-
* @internal
|
2508
|
-
*/
|
2509
|
-
var SkyOverlayContext = /** @class */ (function () {
|
2510
|
-
function SkyOverlayContext(config) {
|
2511
|
-
this.config = config;
|
2512
|
-
}
|
2513
|
-
return SkyOverlayContext;
|
2514
|
-
}());
|
2515
|
-
|
2516
|
-
/**
|
2517
|
-
* Omnibar is 1000.
|
2518
|
-
* See: https://github.com/blackbaud/auth-client/blob/master/src/omnibar/omnibar.ts#L139
|
2519
|
-
* ---
|
2520
|
-
* Modals start their z-indexes at 1040. However, each modal's z-index is a multiple of 10, so it
|
2521
|
-
* will be difficult to reliably predict a z-index that will always appear above all other
|
2522
|
-
* layers. Starting the z-index for overlays at a number much greater than modals will accommodate
|
2523
|
-
* the most reasonable of scenarios.
|
2524
|
-
* See: https://github.com/blackbaud/skyux-modals/blob/master/src/app/public/modules/modal/modal-host.service.ts#L22
|
2525
|
-
* (NOTE: It should be noted that modals do not use the overlay service, which is something we
|
2526
|
-
* should do in the near future to make sure z-indexes are predictable across all component
|
2527
|
-
* libraries.)
|
2528
|
-
*/
|
2529
|
-
var uniqueZIndex = 5000;
|
2530
|
-
/**
|
2531
|
-
* @internal
|
2532
|
-
*/
|
2533
|
-
var SkyOverlayComponent = /** @class */ (function () {
|
2534
|
-
function SkyOverlayComponent(changeDetector, resolver, injector, coreAdapter, context, router) {
|
2535
|
-
this.changeDetector = changeDetector;
|
2536
|
-
this.resolver = resolver;
|
2537
|
-
this.injector = injector;
|
2538
|
-
this.coreAdapter = coreAdapter;
|
2539
|
-
this.context = context;
|
2540
|
-
this.router = router;
|
2541
|
-
this.wrapperClass = '';
|
2542
|
-
this.enablePointerEvents = false;
|
2543
|
-
this.showBackdrop = false;
|
2544
|
-
this.zIndex = "" + ++uniqueZIndex;
|
2545
|
-
this.ngUnsubscribe = new rxjs.Subject();
|
2546
|
-
this._backdropClick = new rxjs.Subject();
|
2547
|
-
this._closed = new rxjs.Subject();
|
2548
|
-
}
|
2549
|
-
Object.defineProperty(SkyOverlayComponent.prototype, "backdropClick", {
|
2550
|
-
get: function () {
|
2551
|
-
return this._backdropClick.asObservable();
|
2552
|
-
},
|
2553
|
-
enumerable: false,
|
2554
|
-
configurable: true
|
2555
|
-
});
|
2556
|
-
Object.defineProperty(SkyOverlayComponent.prototype, "closed", {
|
2557
|
-
get: function () {
|
2558
|
-
return this._closed.asObservable();
|
2559
|
-
},
|
2560
|
-
enumerable: false,
|
2561
|
-
configurable: true
|
2562
|
-
});
|
2563
|
-
SkyOverlayComponent.prototype.ngOnInit = function () {
|
2564
|
-
var _this = this;
|
2565
|
-
this.applyConfig(this.context.config);
|
2566
|
-
setTimeout(function () {
|
2567
|
-
_this.addBackdropClickListener();
|
2568
|
-
});
|
2569
|
-
if (this.context.config.closeOnNavigation) {
|
2570
|
-
this.addRouteListener();
|
2571
|
-
}
|
2572
|
-
};
|
2573
|
-
SkyOverlayComponent.prototype.ngOnDestroy = function () {
|
2574
|
-
this.removeRouteListener();
|
2575
|
-
this.ngUnsubscribe.next();
|
2576
|
-
this.ngUnsubscribe.complete();
|
2577
|
-
this._backdropClick.complete();
|
2578
|
-
this._closed.next();
|
2579
|
-
this._closed.complete();
|
2580
|
-
};
|
2581
|
-
SkyOverlayComponent.prototype.attachComponent = function (component, providers) {
|
2582
|
-
if (providers === void 0) { providers = []; }
|
2583
|
-
this.targetRef.clear();
|
2584
|
-
var factory = this.resolver.resolveComponentFactory(component);
|
2585
|
-
var injector = i0.Injector.create({
|
2586
|
-
providers: providers,
|
2587
|
-
parent: this.injector,
|
2588
|
-
});
|
2589
|
-
var componentRef = this.targetRef.createComponent(factory, undefined, injector);
|
2590
|
-
// Run an initial change detection cycle after the component has been created.
|
2591
|
-
componentRef.changeDetectorRef.detectChanges();
|
2592
|
-
return componentRef;
|
2593
|
-
};
|
2594
|
-
SkyOverlayComponent.prototype.attachTemplate = function (templateRef, context) {
|
2595
|
-
this.targetRef.clear();
|
2596
|
-
return this.targetRef.createEmbeddedView(templateRef, context);
|
2597
|
-
};
|
2598
|
-
SkyOverlayComponent.prototype.applyConfig = function (config) {
|
2599
|
-
this.wrapperClass = config.wrapperClass || '';
|
2600
|
-
this.showBackdrop = config.showBackdrop;
|
2601
|
-
this.enablePointerEvents = config.enablePointerEvents;
|
2602
|
-
this.changeDetector.markForCheck();
|
2603
|
-
};
|
2604
|
-
SkyOverlayComponent.prototype.addBackdropClickListener = function () {
|
2605
|
-
var _this = this;
|
2606
|
-
rxjs.fromEvent(window.document, 'click')
|
2607
|
-
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
2608
|
-
.subscribe(function (event) {
|
2609
|
-
var isChild = _this.overlayContentRef.nativeElement.contains(event.target);
|
2610
|
-
var isAbove = _this.coreAdapter.isTargetAboveElement(event.target, _this.overlayRef.nativeElement);
|
2611
|
-
/* istanbul ignore else */
|
2612
|
-
if (!isChild && !isAbove) {
|
2613
|
-
_this._backdropClick.next();
|
2614
|
-
if (_this.context.config.enableClose) {
|
2615
|
-
_this._closed.next();
|
2616
|
-
}
|
2617
|
-
}
|
2618
|
-
});
|
2619
|
-
};
|
2620
|
-
SkyOverlayComponent.prototype.addRouteListener = function () {
|
2621
|
-
var _this = this;
|
2622
|
-
/*istanbul ignore else*/
|
2623
|
-
if (this.router) {
|
2624
|
-
this.routerSubscription = this.router.events.subscribe(function (event) {
|
2625
|
-
/* istanbul ignore else */
|
2626
|
-
if (event instanceof i3.NavigationStart) {
|
2627
|
-
_this._closed.next();
|
2628
|
-
}
|
2629
|
-
});
|
2630
|
-
}
|
2631
|
-
};
|
2632
|
-
SkyOverlayComponent.prototype.removeRouteListener = function () {
|
2633
|
-
if (this.routerSubscription) {
|
2634
|
-
this.routerSubscription.unsubscribe();
|
2635
|
-
this.routerSubscription = undefined;
|
2636
|
-
}
|
2637
|
-
};
|
2638
|
-
return SkyOverlayComponent;
|
2639
|
-
}());
|
2640
|
-
SkyOverlayComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyOverlayComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.ComponentFactoryResolver }, { token: i0__namespace.Injector }, { token: SkyCoreAdapterService }, { token: SkyOverlayContext }, { token: i3__namespace.Router, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
2641
|
-
SkyOverlayComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyOverlayComponent, selector: "sky-overlay", viewQueries: [{ propertyName: "overlayContentRef", first: true, predicate: ["overlayContentRef"], descendants: true, read: i0.ElementRef, static: true }, { propertyName: "overlayRef", first: true, predicate: ["overlayRef"], descendants: true, read: i0.ElementRef, static: true }, { propertyName: "targetRef", first: true, predicate: ["target"], descendants: true, read: i0.ViewContainerRef, static: true }], ngImport: i0__namespace, template: "<div\n [class]=\"wrapperClass\"\n [style.zIndex]=\"zIndex\"\n [ngClass]=\"{\n 'enable-pointer-events-pass-through': enablePointerEvents,\n 'sky-overlay': true\n }\"\n #overlayRef\n>\n <div class=\"sky-overlay-content\" #overlayContentRef>\n <ng-template #target> </ng-template>\n </div>\n <div *ngIf=\"showBackdrop\" class=\"sky-overlay-backdrop\"></div>\n</div>\n", styles: [".sky-overlay{position:fixed;top:0;right:0;left:0;bottom:0;width:100%;height:100%;display:flex;pointer-events:auto}.sky-overlay-content{position:relative;z-index:1;display:inline-flex;align-self:start;pointer-events:auto}.sky-overlay-backdrop{background:rgba(0,0,0,.5);top:0;right:0;left:0;bottom:0;width:100%;height:100%;position:absolute}.enable-pointer-events-pass-through{pointer-events:none}.enable-pointer-events-pass-through .sky-overlay-backdrop{pointer-events:none}.enable-pointer-events-pass-through .sky-overlay-content{pointer-events:auto}\n"], directives: [{ type: i4__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
2642
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyOverlayComponent, decorators: [{
|
2643
|
-
type: i0.Component,
|
2644
|
-
args: [{
|
2645
|
-
selector: 'sky-overlay',
|
2646
|
-
template: "<div\n [class]=\"wrapperClass\"\n [style.zIndex]=\"zIndex\"\n [ngClass]=\"{\n 'enable-pointer-events-pass-through': enablePointerEvents,\n 'sky-overlay': true\n }\"\n #overlayRef\n>\n <div class=\"sky-overlay-content\" #overlayContentRef>\n <ng-template #target> </ng-template>\n </div>\n <div *ngIf=\"showBackdrop\" class=\"sky-overlay-backdrop\"></div>\n</div>\n",
|
2647
|
-
styles: [".sky-overlay{position:fixed;top:0;right:0;left:0;bottom:0;width:100%;height:100%;display:flex;pointer-events:auto}.sky-overlay-content{position:relative;z-index:1;display:inline-flex;align-self:start;pointer-events:auto}.sky-overlay-backdrop{background:rgba(0,0,0,.5);top:0;right:0;left:0;bottom:0;width:100%;height:100%;position:absolute}.enable-pointer-events-pass-through{pointer-events:none}.enable-pointer-events-pass-through .sky-overlay-backdrop{pointer-events:none}.enable-pointer-events-pass-through .sky-overlay-content{pointer-events:auto}\n"],
|
2648
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
2649
|
-
}]
|
2650
|
-
}], ctorParameters: function () {
|
2651
|
-
return [{ type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.ComponentFactoryResolver }, { type: i0__namespace.Injector }, { type: SkyCoreAdapterService }, { type: SkyOverlayContext }, { type: i3__namespace.Router, decorators: [{
|
2652
|
-
type: i0.Optional
|
2653
|
-
}] }];
|
2654
|
-
}, propDecorators: { overlayContentRef: [{
|
2655
|
-
type: i0.ViewChild,
|
2656
|
-
args: ['overlayContentRef', {
|
2657
|
-
read: i0.ElementRef,
|
2658
|
-
static: true,
|
2659
|
-
}]
|
2660
|
-
}], overlayRef: [{
|
2661
|
-
type: i0.ViewChild,
|
2662
|
-
args: ['overlayRef', {
|
2663
|
-
read: i0.ElementRef,
|
2664
|
-
static: true,
|
2665
|
-
}]
|
2666
|
-
}], targetRef: [{
|
2667
|
-
type: i0.ViewChild,
|
2668
|
-
args: ['target', {
|
2669
|
-
read: i0.ViewContainerRef,
|
2670
|
-
static: true,
|
2671
|
-
}]
|
2672
|
-
}] } });
|
2673
|
-
|
2674
|
-
var SkyOverlayModule = /** @class */ (function () {
|
2675
|
-
function SkyOverlayModule() {
|
2676
|
-
}
|
2677
|
-
return SkyOverlayModule;
|
2678
|
-
}());
|
2679
|
-
SkyOverlayModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyOverlayModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
2680
|
-
SkyOverlayModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyOverlayModule, declarations: [SkyOverlayComponent], imports: [i4.CommonModule] });
|
2681
|
-
SkyOverlayModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyOverlayModule, imports: [[i4.CommonModule]] });
|
2682
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyOverlayModule, decorators: [{
|
2683
|
-
type: i0.NgModule,
|
2684
|
-
args: [{
|
2685
|
-
imports: [i4.CommonModule],
|
2686
|
-
declarations: [SkyOverlayComponent],
|
2687
|
-
entryComponents: [SkyOverlayComponent],
|
2688
|
-
}]
|
2689
|
-
}] });
|
2690
|
-
|
2691
|
-
/**
|
2692
|
-
* @internal
|
2693
|
-
*/
|
2694
|
-
var SkyOverlayAdapterService = /** @class */ (function () {
|
2695
|
-
function SkyOverlayAdapterService(rendererFactory) {
|
2696
|
-
this.renderer = rendererFactory.createRenderer(undefined, undefined);
|
2697
|
-
}
|
2698
|
-
SkyOverlayAdapterService.prototype.restrictBodyScroll = function () {
|
2699
|
-
// Create a style element to avoid overwriting any existing inline body styles.
|
2700
|
-
var styleElement = this.renderer.createElement('style');
|
2701
|
-
var textNode = this.renderer.createText('body { overflow: hidden }');
|
2702
|
-
// Apply a `data-` attribute to make unit testing easier.
|
2703
|
-
this.renderer.setAttribute(styleElement, 'data-test-selector', 'sky-overlay-restrict-scroll-styles');
|
2704
|
-
this.renderer.appendChild(styleElement, textNode);
|
2705
|
-
this.renderer.appendChild(document.head, styleElement);
|
2706
|
-
if (this.styleElement) {
|
2707
|
-
this.destroyStyleElement();
|
2708
|
-
}
|
2709
|
-
this.styleElement = styleElement;
|
2710
|
-
};
|
2711
|
-
SkyOverlayAdapterService.prototype.releaseBodyScroll = function () {
|
2712
|
-
this.destroyStyleElement();
|
2713
|
-
};
|
2714
|
-
SkyOverlayAdapterService.prototype.destroyStyleElement = function () {
|
2715
|
-
/* istanbul ignore else */
|
2716
|
-
if (this.styleElement.parentElement === document.head) {
|
2717
|
-
this.renderer.removeChild(document.head, this.styleElement);
|
2718
|
-
}
|
2719
|
-
};
|
2720
|
-
return SkyOverlayAdapterService;
|
2721
|
-
}());
|
2722
|
-
SkyOverlayAdapterService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyOverlayAdapterService, deps: [{ token: i0__namespace.RendererFactory2 }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
2723
|
-
SkyOverlayAdapterService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyOverlayAdapterService, providedIn: 'root' });
|
2724
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyOverlayAdapterService, decorators: [{
|
2725
|
-
type: i0.Injectable,
|
2726
|
-
args: [{
|
2727
|
-
providedIn: 'root',
|
2728
|
-
}]
|
2729
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.RendererFactory2 }]; } });
|
2730
|
-
|
2731
|
-
/**
|
2732
|
-
* This service is used to create new overlays.
|
2733
|
-
* @dynamic
|
2734
|
-
*/
|
2735
|
-
var SkyOverlayService = /** @class */ (function () {
|
2736
|
-
function SkyOverlayService(applicationRef, componentFactoryResolver, injector, adapter) {
|
2737
|
-
this.applicationRef = applicationRef;
|
2738
|
-
this.componentFactoryResolver = componentFactoryResolver;
|
2739
|
-
this.injector = injector;
|
2740
|
-
this.adapter = adapter;
|
2741
|
-
}
|
2742
|
-
/**
|
2743
|
-
* Creates an empty overlay. Use the returned `SkyOverlayInstance` to append content.
|
2744
|
-
* @param config Configuration for the overlay.
|
2745
|
-
*/
|
2746
|
-
SkyOverlayService.prototype.create = function (config) {
|
2747
|
-
var _this = this;
|
2748
|
-
var settings = this.prepareConfig(config);
|
2749
|
-
if (settings.enableScroll === false) {
|
2750
|
-
this.adapter.restrictBodyScroll();
|
2751
|
-
}
|
2752
|
-
var componentRef = this.createOverlay(settings);
|
2753
|
-
var instance = new SkyOverlayInstance(settings, componentRef);
|
2754
|
-
instance.closed.subscribe(function () {
|
2755
|
-
// Only execute the service's close method if the instance still exists.
|
2756
|
-
// This is needed to address a race condition if the deprecated instance.close method is used instead.
|
2757
|
-
if (SkyOverlayService.overlays.indexOf(instance) > -1) {
|
2758
|
-
_this.close(instance);
|
2759
|
-
}
|
2760
|
-
});
|
2761
|
-
SkyOverlayService.overlays.push(instance);
|
2762
|
-
return instance;
|
2763
|
-
};
|
2764
|
-
/**
|
2765
|
-
* Closes (and destroys) an overlay instance.
|
2766
|
-
* @param instance The instance to close.
|
2767
|
-
*/
|
2768
|
-
SkyOverlayService.prototype.close = function (instance) {
|
2769
|
-
this.destroyOverlay(instance);
|
2770
|
-
this.applicationRef.detachView(instance.componentRef.hostView);
|
2771
|
-
instance.componentRef.destroy();
|
2772
|
-
// In some cases, Angular keeps dynamically-generated component's nodes in the DOM during
|
2773
|
-
// unit tests. This can make querying difficult because the older DOM nodes still exist and
|
2774
|
-
// produce inconsistent results.
|
2775
|
-
// Angular Material's overlay appears to do the same thing:
|
2776
|
-
// https://github.com/angular/components/blob/master/src/cdk/portal/dom-portal-outlet.ts#L143-L145
|
2777
|
-
// (Ignoring coverage since this branch will only be hit by consumer unit tests.)
|
2778
|
-
var componentElement = instance.componentRef.location.nativeElement;
|
2779
|
-
/* istanbul ignore if */
|
2780
|
-
if (componentElement.parentNode !== null) {
|
2781
|
-
componentElement.parentNode.removeChild(componentElement);
|
2782
|
-
}
|
2783
|
-
};
|
2784
|
-
/**
|
2785
|
-
* Closes all overlay instances.
|
2786
|
-
*/
|
2787
|
-
SkyOverlayService.prototype.closeAll = function () {
|
2788
|
-
// The `close` event handler for each instance alters the array's length asynchronously,
|
2789
|
-
// so the only "safe" index to call is zero.
|
2790
|
-
while (SkyOverlayService.overlays.length > 0) {
|
2791
|
-
this.close(SkyOverlayService.overlays[0]);
|
2792
|
-
}
|
2793
|
-
};
|
2794
|
-
SkyOverlayService.prototype.createOverlay = function (config) {
|
2795
|
-
var injector = i0.Injector.create({
|
2796
|
-
parent: this.injector,
|
2797
|
-
providers: [
|
2798
|
-
{
|
2799
|
-
provide: SkyOverlayContext,
|
2800
|
-
useValue: new SkyOverlayContext(config),
|
2801
|
-
},
|
2802
|
-
],
|
2803
|
-
});
|
2804
|
-
var componentRef = this.componentFactoryResolver
|
2805
|
-
.resolveComponentFactory(SkyOverlayComponent)
|
2806
|
-
.create(injector);
|
2807
|
-
this.applicationRef.attachView(componentRef.hostView);
|
2808
|
-
var domElem = componentRef.hostView
|
2809
|
-
.rootNodes[0];
|
2810
|
-
document.body.appendChild(domElem);
|
2811
|
-
return componentRef;
|
2812
|
-
};
|
2813
|
-
SkyOverlayService.prototype.prepareConfig = function (config) {
|
2814
|
-
var defaults = {
|
2815
|
-
closeOnNavigation: true,
|
2816
|
-
enableClose: false,
|
2817
|
-
enablePointerEvents: false,
|
2818
|
-
enableScroll: true,
|
2819
|
-
showBackdrop: false,
|
2820
|
-
wrapperClass: '',
|
2821
|
-
};
|
2822
|
-
return Object.assign(Object.assign({}, defaults), config);
|
2823
|
-
};
|
2824
|
-
SkyOverlayService.prototype.destroyOverlay = function (instance) {
|
2825
|
-
SkyOverlayService.overlays.splice(SkyOverlayService.overlays.indexOf(instance), 1);
|
2826
|
-
if (instance.config.enableScroll === false) {
|
2827
|
-
// Only release the body scroll if no other overlay wishes it to be disabled.
|
2828
|
-
var anotherOverlayDisablesScroll = SkyOverlayService.overlays.some(function (o) { return !o.config.enableScroll; });
|
2829
|
-
if (!anotherOverlayDisablesScroll) {
|
2830
|
-
this.adapter.releaseBodyScroll();
|
2831
|
-
}
|
2832
|
-
}
|
2833
|
-
};
|
2834
|
-
return SkyOverlayService;
|
2835
|
-
}());
|
2836
|
-
SkyOverlayService.overlays = [];
|
2837
|
-
SkyOverlayService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyOverlayService, deps: [{ token: i0__namespace.ApplicationRef }, { token: i0__namespace.ComponentFactoryResolver }, { token: i0__namespace.Injector }, { token: SkyOverlayAdapterService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
2838
|
-
SkyOverlayService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyOverlayService, providedIn: 'root' });
|
2839
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyOverlayService, decorators: [{
|
2840
|
-
type: i0.Injectable,
|
2841
|
-
args: [{
|
2842
|
-
providedIn: 'root',
|
2843
|
-
}]
|
2844
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.ApplicationRef }, { type: i0__namespace.ComponentFactoryResolver }, { type: i0__namespace.Injector }, { type: SkyOverlayAdapterService }]; } });
|
2845
|
-
|
2846
|
-
var SkyPercentPipe = /** @class */ (function () {
|
2847
|
-
function SkyPercentPipe(localeProvider) {
|
2848
|
-
var _this = this;
|
2849
|
-
this.localeProvider = localeProvider;
|
2850
|
-
this.defaultFormat = '1.0-2';
|
2851
|
-
this.defaultLocale = 'en-US';
|
2852
|
-
this.ngUnsubscribe = new rxjs.Subject();
|
2853
|
-
this.localeProvider
|
2854
|
-
.getLocaleInfo()
|
2855
|
-
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
2856
|
-
.subscribe(function (localeInfo) {
|
2857
|
-
_this.defaultLocale = localeInfo.locale;
|
2858
|
-
_this.updateFormattedValue();
|
2859
|
-
});
|
2860
|
-
}
|
2861
|
-
SkyPercentPipe.prototype.ngOnDestroy = function () {
|
2862
|
-
this.ngUnsubscribe.next();
|
2863
|
-
this.ngUnsubscribe.complete();
|
2864
|
-
};
|
2865
|
-
SkyPercentPipe.prototype.transform = function (value, format, locale) {
|
2866
|
-
this.value = value;
|
2867
|
-
this.format = format;
|
2868
|
-
this.locale = locale;
|
2869
|
-
this.updateFormattedValue();
|
2870
|
-
return this.formattedValue;
|
2871
|
-
};
|
2872
|
-
SkyPercentPipe.prototype.updateFormattedValue = function () {
|
2873
|
-
var locale = this.locale || this.defaultLocale;
|
2874
|
-
var format = this.format || this.defaultFormat;
|
2875
|
-
this.formattedValue = SkyNumberFormatUtility.formatNumber(locale, this.value, i1.SkyIntlNumberFormatStyle.Percent, format);
|
2876
|
-
};
|
2877
|
-
return SkyPercentPipe;
|
2878
|
-
}());
|
2879
|
-
SkyPercentPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyPercentPipe, deps: [{ token: i1__namespace.SkyAppLocaleProvider }], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
2880
|
-
SkyPercentPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyPercentPipe, name: "skyPercent", pure: false });
|
2881
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyPercentPipe, decorators: [{
|
2882
|
-
type: i0.Pipe,
|
2883
|
-
args: [{
|
2884
|
-
name: 'skyPercent',
|
2885
|
-
pure: false,
|
2886
|
-
}]
|
2887
|
-
}], ctorParameters: function () { return [{ type: i1__namespace.SkyAppLocaleProvider }]; } });
|
2888
|
-
|
2889
|
-
var SkyPercentPipeModule = /** @class */ (function () {
|
2890
|
-
function SkyPercentPipeModule() {
|
2891
|
-
}
|
2892
|
-
return SkyPercentPipeModule;
|
2893
|
-
}());
|
2894
|
-
SkyPercentPipeModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyPercentPipeModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
2895
|
-
SkyPercentPipeModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyPercentPipeModule, declarations: [SkyPercentPipe], imports: [i4.CommonModule, SkyCoreResourcesModule], exports: [SkyPercentPipe] });
|
2896
|
-
SkyPercentPipeModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyPercentPipeModule, providers: [SkyPercentPipe], imports: [[i4.CommonModule, SkyCoreResourcesModule]] });
|
2897
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyPercentPipeModule, decorators: [{
|
2898
|
-
type: i0.NgModule,
|
2899
|
-
args: [{
|
2900
|
-
declarations: [SkyPercentPipe],
|
2901
|
-
providers: [SkyPercentPipe],
|
2902
|
-
imports: [i4.CommonModule, SkyCoreResourcesModule],
|
2903
|
-
exports: [SkyPercentPipe],
|
2904
|
-
}]
|
2905
|
-
}] });
|
2906
|
-
|
2907
|
-
function notifySubscribers(subscribers, item) {
|
2908
|
-
var e_1, _a;
|
2909
|
-
try {
|
2910
|
-
for (var subscribers_1 = __values(subscribers), subscribers_1_1 = subscribers_1.next(); !subscribers_1_1.done; subscribers_1_1 = subscribers_1.next()) {
|
2911
|
-
var subscriber = subscribers_1_1.value;
|
2912
|
-
subscriber.next(item);
|
2913
|
-
}
|
2914
|
-
}
|
2915
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
2916
|
-
finally {
|
2917
|
-
try {
|
2918
|
-
if (subscribers_1_1 && !subscribers_1_1.done && (_a = subscribers_1.return)) _a.call(subscribers_1);
|
2919
|
-
}
|
2920
|
-
finally { if (e_1) throw e_1.error; }
|
2921
|
-
}
|
2922
|
-
}
|
2923
|
-
var SkyScrollableHostService = /** @class */ (function () {
|
2924
|
-
function SkyScrollableHostService(mutationObserverSvc, windowRef) {
|
2925
|
-
this.mutationObserverSvc = mutationObserverSvc;
|
2926
|
-
this.windowRef = windowRef;
|
2927
|
-
}
|
2928
|
-
/**
|
2929
|
-
* Returns the given element's current scrollable host
|
2930
|
-
* @param elementRef The element whose scrollable host is being requested
|
2931
|
-
* @returns The current scrollable host
|
2932
|
-
*/
|
2933
|
-
SkyScrollableHostService.prototype.getScrollableHost = function (elementRef) {
|
2934
|
-
return this.findScrollableHost(elementRef.nativeElement);
|
2935
|
-
};
|
2936
|
-
/**
|
2937
|
-
* Returns an observable which emits the given element's current scrollable host
|
2938
|
-
* @param elementRef The element whose scrollable host is being requested
|
2939
|
-
* @param completionObservable An observable which alerts the internal observers that they should complete
|
2940
|
-
* @returns An observable which emits the current scrollable host
|
2941
|
-
* @internal
|
2942
|
-
*/
|
2943
|
-
SkyScrollableHostService.prototype.watchScrollableHost = function (elementRef) {
|
2944
|
-
var _this = this;
|
2945
|
-
var subscribers = [];
|
2946
|
-
var parentMutationObserver;
|
2947
|
-
var documentHiddenElementMutationObserver;
|
2948
|
-
return new rxjs.Observable(function (subscriber) {
|
2949
|
-
subscribers.push(subscriber);
|
2950
|
-
var scrollableHost = _this.findScrollableHost(elementRef.nativeElement);
|
2951
|
-
if (subscribers.length === 1) {
|
2952
|
-
parentMutationObserver = _this.mutationObserverSvc.create(function () {
|
2953
|
-
var newScrollableHost = _this.findScrollableHost(elementRef.nativeElement);
|
2954
|
-
if (newScrollableHost !== scrollableHost &&
|
2955
|
-
elementRef.nativeElement.offsetParent) {
|
2956
|
-
scrollableHost = newScrollableHost;
|
2957
|
-
_this.observeForScrollableHostChanges(scrollableHost, parentMutationObserver);
|
2958
|
-
notifySubscribers(subscribers, scrollableHost);
|
2959
|
-
}
|
2960
|
-
});
|
2961
|
-
_this.observeForScrollableHostChanges(scrollableHost, parentMutationObserver);
|
2962
|
-
documentHiddenElementMutationObserver = _this.mutationObserverSvc.create(function () {
|
2963
|
-
if (!elementRef.nativeElement.offsetParent) {
|
2964
|
-
scrollableHost = undefined;
|
2965
|
-
_this.observeForScrollableHostChanges(scrollableHost, parentMutationObserver);
|
2966
|
-
notifySubscribers(subscribers, scrollableHost);
|
2967
|
-
}
|
2968
|
-
});
|
2969
|
-
_this.observeDocumentHiddenElementChanges(documentHiddenElementMutationObserver);
|
2970
|
-
}
|
2971
|
-
subscriber.next(scrollableHost);
|
2972
|
-
subscriber.add(function () {
|
2973
|
-
var subIndex = subscribers.indexOf(subscriber);
|
2974
|
-
/* sanity check */
|
2975
|
-
/* istanbul ignore else */
|
2976
|
-
if (subIndex >= 0) {
|
2977
|
-
subscribers.splice(subIndex, 1);
|
2978
|
-
}
|
2979
|
-
if (subscribers.length === 0) {
|
2980
|
-
documentHiddenElementMutationObserver.disconnect();
|
2981
|
-
parentMutationObserver.disconnect();
|
2982
|
-
}
|
2983
|
-
});
|
2984
|
-
});
|
2985
|
-
};
|
2986
|
-
/**
|
2987
|
-
* 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.
|
2988
|
-
* @param elementRef The element whose scrollable host scroll events are being requested
|
2989
|
-
* @param completionObservable An observable which alerts the internal observers that they should complete
|
2990
|
-
* @returns An observable which emits when the elements scrollable host is scrolled or is changed
|
2991
|
-
*/
|
2992
|
-
SkyScrollableHostService.prototype.watchScrollableHostScrollEvents = function (elementRef) {
|
2993
|
-
var _this = this;
|
2994
|
-
var subscribers = [];
|
2995
|
-
var scrollableHost;
|
2996
|
-
var newScrollableHostObservable = new rxjs.Subject();
|
2997
|
-
var scrollableHostSubscription;
|
2998
|
-
var scrollEventSubscription;
|
2999
|
-
return new rxjs.Observable(function (subscriber) {
|
3000
|
-
subscribers.push(subscriber);
|
3001
|
-
if (subscribers.length === 1) {
|
3002
|
-
scrollableHostSubscription = _this.watchScrollableHost(elementRef).subscribe(function (newScrollableHost) {
|
3003
|
-
newScrollableHostObservable.next();
|
3004
|
-
newScrollableHostObservable.complete();
|
3005
|
-
if (scrollableHost && scrollableHost !== newScrollableHost) {
|
3006
|
-
notifySubscribers(subscribers);
|
3007
|
-
}
|
3008
|
-
scrollableHost = newScrollableHost;
|
3009
|
-
newScrollableHostObservable = new rxjs.Subject();
|
3010
|
-
if (newScrollableHost) {
|
3011
|
-
scrollEventSubscription = rxjs.fromEvent(newScrollableHost, 'scroll')
|
3012
|
-
.pipe(operators.takeUntil(newScrollableHostObservable))
|
3013
|
-
.subscribe(function () {
|
3014
|
-
notifySubscribers(subscribers);
|
3015
|
-
});
|
3016
|
-
}
|
3017
|
-
});
|
3018
|
-
}
|
3019
|
-
subscriber.add(function () {
|
3020
|
-
var subIndex = subscribers.indexOf(subscriber);
|
3021
|
-
/* sanity check */
|
3022
|
-
/* istanbul ignore else */
|
3023
|
-
if (subIndex >= 0) {
|
3024
|
-
subscribers.splice(subIndex, 1);
|
3025
|
-
}
|
3026
|
-
if (subscribers.length === 0) {
|
3027
|
-
scrollableHostSubscription.unsubscribe();
|
3028
|
-
scrollEventSubscription.unsubscribe();
|
3029
|
-
newScrollableHostObservable.complete();
|
3030
|
-
}
|
3031
|
-
});
|
3032
|
-
});
|
3033
|
-
};
|
3034
|
-
SkyScrollableHostService.prototype.findScrollableHost = function (element) {
|
3035
|
-
var regex = /(auto|scroll)/;
|
3036
|
-
var windowObj = this.windowRef.nativeWindow;
|
3037
|
-
var bodyObj = windowObj.document.body;
|
3038
|
-
/* Sanity check */
|
3039
|
-
if (!element) {
|
3040
|
-
return windowObj;
|
3041
|
-
}
|
3042
|
-
var style = windowObj.getComputedStyle(element);
|
3043
|
-
var parent = element;
|
3044
|
-
do {
|
3045
|
-
parent = parent.parentNode;
|
3046
|
-
/* Sanity check for if this function is called for an element which has been removed from the DOM */
|
3047
|
-
if (!(parent instanceof HTMLElement)) {
|
3048
|
-
return windowObj;
|
3049
|
-
}
|
3050
|
-
style = windowObj.getComputedStyle(parent);
|
3051
|
-
} while (!regex.test(style.overflow) &&
|
3052
|
-
!regex.test(style.overflowY) &&
|
3053
|
-
parent !== bodyObj);
|
3054
|
-
if (parent === bodyObj) {
|
3055
|
-
return windowObj;
|
3056
|
-
}
|
3057
|
-
return parent;
|
3058
|
-
};
|
3059
|
-
SkyScrollableHostService.prototype.observeDocumentHiddenElementChanges = function (mutationObserver) {
|
3060
|
-
mutationObserver.observe(document.documentElement, {
|
3061
|
-
attributes: true,
|
3062
|
-
attributeFilter: ['class', 'style', 'hidden'],
|
3063
|
-
childList: true,
|
3064
|
-
subtree: true,
|
3065
|
-
});
|
3066
|
-
};
|
3067
|
-
SkyScrollableHostService.prototype.observeForScrollableHostChanges = function (element, mutationObserver) {
|
3068
|
-
mutationObserver.disconnect();
|
3069
|
-
if (element instanceof HTMLElement) {
|
3070
|
-
mutationObserver.observe(element, {
|
3071
|
-
attributes: true,
|
3072
|
-
attributeFilter: ['class', 'style'],
|
3073
|
-
childList: true,
|
3074
|
-
subtree: true,
|
3075
|
-
});
|
3076
|
-
}
|
3077
|
-
else {
|
3078
|
-
mutationObserver.observe(document.documentElement, {
|
3079
|
-
attributes: true,
|
3080
|
-
attributeFilter: ['class', 'style'],
|
3081
|
-
childList: true,
|
3082
|
-
subtree: true,
|
3083
|
-
});
|
3084
|
-
}
|
3085
|
-
};
|
3086
|
-
return SkyScrollableHostService;
|
3087
|
-
}());
|
3088
|
-
SkyScrollableHostService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyScrollableHostService, deps: [{ token: MutationObserverService }, { token: SkyAppWindowRef }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
3089
|
-
SkyScrollableHostService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyScrollableHostService, providedIn: 'root' });
|
3090
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyScrollableHostService, decorators: [{
|
3091
|
-
type: i0.Injectable,
|
3092
|
-
args: [{
|
3093
|
-
providedIn: 'root',
|
3094
|
-
}]
|
3095
|
-
}], ctorParameters: function () { return [{ type: MutationObserverService }, { type: SkyAppWindowRef }]; } });
|
3096
|
-
|
3097
|
-
/**
|
3098
|
-
* Provides a method for setting a formatted title on the current window.
|
3099
|
-
*/
|
3100
|
-
var SkyAppTitleService = /** @class */ (function () {
|
3101
|
-
function SkyAppTitleService(title) {
|
3102
|
-
this.title = title;
|
3103
|
-
}
|
3104
|
-
/**
|
3105
|
-
* Sets the title on the current window.
|
3106
|
-
* @param args An array of title parts. The parts will be concatenated with a hyphen between
|
3107
|
-
* each part.
|
3108
|
-
*/
|
3109
|
-
SkyAppTitleService.prototype.setTitle = function (args) {
|
3110
|
-
if (args && args.titleParts) {
|
3111
|
-
this.title.setTitle(args.titleParts.join(' - '));
|
3112
|
-
}
|
3113
|
-
};
|
3114
|
-
return SkyAppTitleService;
|
3115
|
-
}());
|
3116
|
-
SkyAppTitleService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppTitleService, deps: [{ token: i1__namespace$1.Title }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
3117
|
-
SkyAppTitleService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppTitleService, providedIn: 'root' });
|
3118
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppTitleService, decorators: [{
|
3119
|
-
type: i0.Injectable,
|
3120
|
-
args: [{
|
3121
|
-
providedIn: 'root',
|
3122
|
-
}]
|
3123
|
-
}], ctorParameters: function () { return [{ type: i1__namespace$1.Title }]; } });
|
3124
|
-
|
3125
|
-
var SkyUIConfigService = /** @class */ (function () {
|
3126
|
-
function SkyUIConfigService() {
|
3127
|
-
}
|
3128
|
-
SkyUIConfigService.prototype.getConfig = function (key, defaultConfig) {
|
3129
|
-
return rxjs.of(defaultConfig);
|
3130
|
-
};
|
3131
|
-
/* istanbul ignore next */
|
3132
|
-
SkyUIConfigService.prototype.setConfig = function (key, value) {
|
3133
|
-
return rxjs.of({});
|
3134
|
-
};
|
3135
|
-
return SkyUIConfigService;
|
3136
|
-
}());
|
3137
|
-
SkyUIConfigService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyUIConfigService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
3138
|
-
SkyUIConfigService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyUIConfigService, providedIn: 'root' });
|
3139
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyUIConfigService, decorators: [{
|
3140
|
-
type: i0.Injectable,
|
3141
|
-
args: [{
|
3142
|
-
providedIn: 'root',
|
3143
|
-
}]
|
3144
|
-
}] });
|
3145
|
-
|
3146
|
-
var SkyViewkeeperHostOptions = /** @class */ (function () {
|
3147
|
-
function SkyViewkeeperHostOptions() {
|
3148
|
-
}
|
3149
|
-
return SkyViewkeeperHostOptions;
|
3150
|
-
}());
|
3151
|
-
SkyViewkeeperHostOptions.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyViewkeeperHostOptions, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
3152
|
-
SkyViewkeeperHostOptions.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyViewkeeperHostOptions });
|
3153
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyViewkeeperHostOptions, decorators: [{
|
3154
|
-
type: i0.Injectable
|
3155
|
-
}] });
|
3156
|
-
|
3157
|
-
var CLS_VIEWKEEPER_FIXED = 'sky-viewkeeper-fixed';
|
3158
|
-
var EVT_AFTER_VIEWKEEPER_SYNC = 'afterViewkeeperSync';
|
3159
|
-
var styleEl;
|
3160
|
-
var nextIdIndex;
|
3161
|
-
function ensureStyleEl() {
|
3162
|
-
if (!styleEl) {
|
3163
|
-
styleEl = document.createElement('style');
|
3164
|
-
var css = document.createTextNode("\n." + CLS_VIEWKEEPER_FIXED + " {\n position: fixed !important;\n z-index: 999;\n opacity: 0.95;\n overflow: hidden;\n}\n\n.sky-theme-modern ." + CLS_VIEWKEEPER_FIXED + " {\n box-shadow: 0px 1px 8px -1px rgba(0, 0, 0, 0.3);\n opacity: initial;\n}\n");
|
3165
|
-
styleEl.appendChild(css);
|
3166
|
-
document.head.appendChild(styleEl);
|
3167
|
-
}
|
3168
|
-
}
|
3169
|
-
function nextId() {
|
3170
|
-
nextIdIndex = (nextIdIndex || 0) + 1;
|
3171
|
-
return 'viewkeeper-' + nextIdIndex;
|
3172
|
-
}
|
3173
|
-
function getOffset(el, scrollableHost) {
|
3174
|
-
var rect = el.getBoundingClientRect();
|
3175
|
-
var parent = scrollableHost ? scrollableHost : document.documentElement;
|
3176
|
-
return {
|
3177
|
-
top: rect.top + parent.scrollTop,
|
3178
|
-
left: rect.left + parent.scrollLeft,
|
3179
|
-
};
|
3180
|
-
}
|
3181
|
-
function px(value) {
|
3182
|
-
var pxValue = value ? value.toString() : '';
|
3183
|
-
if (typeof value === 'number') {
|
3184
|
-
pxValue = value + 'px';
|
3185
|
-
}
|
3186
|
-
return pxValue;
|
3187
|
-
}
|
3188
|
-
function setElPosition(el, left, top, width, marginTop) {
|
3189
|
-
el.style.top = px(top);
|
3190
|
-
el.style.left = px(left);
|
3191
|
-
el.style.marginTop = px(marginTop);
|
3192
|
-
/*istanbul ignore else*/
|
3193
|
-
/* sanity check */
|
3194
|
-
if (width !== null) {
|
3195
|
-
el.style.width = px(width);
|
3196
|
-
}
|
3197
|
-
}
|
3198
|
-
function getHeightWithMargin(el) {
|
3199
|
-
var computedStyle = getComputedStyle(el);
|
3200
|
-
return (el.offsetHeight +
|
3201
|
-
parseInt(computedStyle.marginTop, 10) +
|
3202
|
-
parseInt(computedStyle.marginBottom, 10));
|
3203
|
-
}
|
3204
|
-
function createCustomEvent(name) {
|
3205
|
-
var evt = document.createEvent('CustomEvent');
|
3206
|
-
evt.initCustomEvent(name, false, false, undefined);
|
3207
|
-
return evt;
|
3208
|
-
}
|
3209
|
-
var SkyViewkeeper = /** @class */ (function () {
|
3210
|
-
function SkyViewkeeper(options) {
|
3211
|
-
var _this = this;
|
3212
|
-
options = options || /* istanbul ignore next */ {};
|
3213
|
-
this.setWidth = options.setWidth;
|
3214
|
-
this.id = nextId();
|
3215
|
-
this.el = options.el;
|
3216
|
-
this.boundaryEl = options.boundaryEl;
|
3217
|
-
this.scrollableHost = options.scrollableHost;
|
3218
|
-
this.verticalOffset = options.verticalOffset || 0;
|
3219
|
-
this.verticalOffsetEl = options.verticalOffsetEl;
|
3220
|
-
this.viewportMarginTop = options.viewportMarginTop || 0;
|
3221
|
-
this.syncElPositionHandler = function () { return _this.syncElPosition(); };
|
3222
|
-
if (this.verticalOffsetEl) {
|
3223
|
-
this.verticalOffsetEl.addEventListener(EVT_AFTER_VIEWKEEPER_SYNC, this.syncElPositionHandler);
|
3224
|
-
}
|
3225
|
-
window.addEventListener('scroll', this.syncElPositionHandler, true);
|
3226
|
-
window.addEventListener('resize', this.syncElPositionHandler);
|
3227
|
-
window.addEventListener('orientationchange', this.syncElPositionHandler);
|
3228
|
-
ensureStyleEl();
|
3229
|
-
this.syncElPosition();
|
3230
|
-
}
|
3231
|
-
Object.defineProperty(SkyViewkeeper.prototype, "viewportMarginTop", {
|
3232
|
-
get: function () {
|
3233
|
-
if (this.scrollableHost) {
|
3234
|
-
return 0;
|
3235
|
-
}
|
3236
|
-
else {
|
3237
|
-
return this._viewportMarginTop;
|
3238
|
-
}
|
3239
|
-
},
|
3240
|
-
set: function (margin) {
|
3241
|
-
this._viewportMarginTop = margin;
|
3242
|
-
},
|
3243
|
-
enumerable: false,
|
3244
|
-
configurable: true
|
3245
|
-
});
|
3246
|
-
SkyViewkeeper.prototype.syncElPosition = function () {
|
3247
|
-
var verticalOffset = this.calculateVerticalOffset();
|
3248
|
-
// When the element isn't visible, its size can't be calculated, so don't attempt syncing position in this case.
|
3249
|
-
if (this.el.offsetWidth === 0 && this.el.offsetHeight === 0) {
|
3250
|
-
return;
|
3251
|
-
}
|
3252
|
-
var boundaryInfo = this.getBoundaryInfo();
|
3253
|
-
var fixedStyles = this.getFixedStyles(boundaryInfo, verticalOffset);
|
3254
|
-
var doFixEl = this.shouldFixEl(boundaryInfo, verticalOffset);
|
3255
|
-
if (this.needsUpdating(doFixEl, fixedStyles)) {
|
3256
|
-
if (doFixEl) {
|
3257
|
-
this.fixEl(boundaryInfo, fixedStyles);
|
3258
|
-
}
|
3259
|
-
else {
|
3260
|
-
this.unfixEl();
|
3261
|
-
}
|
3262
|
-
}
|
3263
|
-
var evt = createCustomEvent(EVT_AFTER_VIEWKEEPER_SYNC);
|
3264
|
-
this.el.dispatchEvent(evt);
|
3265
|
-
};
|
3266
|
-
SkyViewkeeper.prototype.destroy = function () {
|
3267
|
-
if (!this.isDestroyed) {
|
3268
|
-
window.removeEventListener('scroll', this.syncElPositionHandler, true);
|
3269
|
-
window.removeEventListener('resize', this.syncElPositionHandler);
|
3270
|
-
window.removeEventListener('orientationchange', this.syncElPositionHandler);
|
3271
|
-
this.unfixEl();
|
3272
|
-
if (this.verticalOffsetEl) {
|
3273
|
-
this.verticalOffsetEl.removeEventListener(EVT_AFTER_VIEWKEEPER_SYNC, this.syncElPositionHandler);
|
3274
|
-
}
|
3275
|
-
this.el = this.boundaryEl = this.verticalOffsetEl = undefined;
|
3276
|
-
this.isDestroyed = true;
|
3277
|
-
}
|
3278
|
-
};
|
3279
|
-
SkyViewkeeper.prototype.getSpacerId = function () {
|
3280
|
-
return this.id + '-spacer';
|
3281
|
-
};
|
3282
|
-
SkyViewkeeper.prototype.unfixEl = function () {
|
3283
|
-
var spacerEl = document.getElementById(this.getSpacerId());
|
3284
|
-
if (spacerEl) {
|
3285
|
-
spacerEl.parentElement.removeChild(spacerEl);
|
3286
|
-
}
|
3287
|
-
this.el.classList.remove(CLS_VIEWKEEPER_FIXED);
|
3288
|
-
this.currentElFixedLeft =
|
3289
|
-
this.currentElFixedTop =
|
3290
|
-
this.currentElFixedWidth =
|
3291
|
-
undefined;
|
3292
|
-
var width;
|
3293
|
-
if (this.setWidth) {
|
3294
|
-
width = 'auto';
|
3295
|
-
}
|
3296
|
-
setElPosition(this.el, '', '', width, '');
|
3297
|
-
};
|
3298
|
-
SkyViewkeeper.prototype.calculateVerticalOffset = function () {
|
3299
|
-
var offset = this.verticalOffset;
|
3300
|
-
if (this.verticalOffsetEl) {
|
3301
|
-
var verticalOffsetElTopStyle = this.verticalOffsetEl.style.top;
|
3302
|
-
var verticalOffsetElTop = parseInt(verticalOffsetElTopStyle, 10) || 0;
|
3303
|
-
offset += this.verticalOffsetEl.offsetHeight + verticalOffsetElTop;
|
3304
|
-
}
|
3305
|
-
else if (this.scrollableHost) {
|
3306
|
-
offset += this.scrollableHost.getBoundingClientRect().top;
|
3307
|
-
}
|
3308
|
-
return offset;
|
3309
|
-
};
|
3310
|
-
SkyViewkeeper.prototype.shouldFixEl = function (boundaryInfo, verticalOffset) {
|
3311
|
-
var anchorTop;
|
3312
|
-
if (boundaryInfo.spacerEl) {
|
3313
|
-
anchorTop = getOffset(boundaryInfo.spacerEl, this.scrollableHost).top;
|
3314
|
-
}
|
3315
|
-
else {
|
3316
|
-
anchorTop = getOffset(this.el, this.scrollableHost).top;
|
3317
|
-
}
|
3318
|
-
var doFixEl = boundaryInfo.scrollTop + verticalOffset + this.viewportMarginTop >
|
3319
|
-
anchorTop;
|
3320
|
-
return doFixEl;
|
3321
|
-
};
|
3322
|
-
SkyViewkeeper.prototype.getFixedStyles = function (boundaryInfo, verticalOffset) {
|
3323
|
-
// If the element needs to be fixed, this will calculate its position. The position
|
3324
|
-
// will be 0 (fully visible) unless the user is scrolling the boundary out of view.
|
3325
|
-
// In that case, the element should begin to scroll out of view with the
|
3326
|
-
// rest of the boundary by setting its top position to a negative value.
|
3327
|
-
var elFixedTop = Math.min(boundaryInfo.boundaryBottom -
|
3328
|
-
boundaryInfo.elHeight -
|
3329
|
-
boundaryInfo.scrollTop, verticalOffset);
|
3330
|
-
var elFixedWidth = boundaryInfo.boundaryEl.getBoundingClientRect().width;
|
3331
|
-
var elFixedLeft = boundaryInfo.boundaryOffset.left - boundaryInfo.scrollLeft;
|
3332
|
-
return {
|
3333
|
-
elFixedLeft: elFixedLeft,
|
3334
|
-
elFixedTop: elFixedTop,
|
3335
|
-
elFixedWidth: elFixedWidth,
|
3336
|
-
};
|
3337
|
-
};
|
3338
|
-
SkyViewkeeper.prototype.needsUpdating = function (doFixEl, fixedStyles) {
|
3339
|
-
if ((doFixEl &&
|
3340
|
-
this.currentElFixedLeft === fixedStyles.elFixedLeft &&
|
3341
|
-
this.currentElFixedTop === fixedStyles.elFixedTop &&
|
3342
|
-
this.currentElFixedWidth === fixedStyles.elFixedWidth) ||
|
3343
|
-
(!doFixEl &&
|
3344
|
-
!(this.currentElFixedLeft !== undefined &&
|
3345
|
-
this.currentElFixedLeft !== null))) {
|
3346
|
-
// The element is either currently fixed and its position and width do not need
|
3347
|
-
// to change, or the element is not currently fixed and does not need to be fixed.
|
3348
|
-
// No changes are needed.
|
3349
|
-
return false;
|
3350
|
-
}
|
3351
|
-
return true;
|
3352
|
-
};
|
3353
|
-
SkyViewkeeper.prototype.fixEl = function (boundaryInfo, fixedStyles) {
|
3354
|
-
var el = this.el;
|
3355
|
-
/* istanbul ignore else */
|
3356
|
-
/* sanity check */
|
3357
|
-
if (!boundaryInfo.spacerEl) {
|
3358
|
-
var spacerHeight = boundaryInfo.elHeight;
|
3359
|
-
var spacerEl = document.createElement('div');
|
3360
|
-
spacerEl.id = boundaryInfo.spacerId;
|
3361
|
-
spacerEl.style.height = px(spacerHeight);
|
3362
|
-
el.parentNode.insertBefore(spacerEl, el.nextSibling);
|
3363
|
-
}
|
3364
|
-
el.classList.add(CLS_VIEWKEEPER_FIXED);
|
3365
|
-
this.currentElFixedTop = fixedStyles.elFixedTop;
|
3366
|
-
this.currentElFixedLeft = fixedStyles.elFixedLeft;
|
3367
|
-
this.currentElFixedWidth = fixedStyles.elFixedWidth;
|
3368
|
-
var width;
|
3369
|
-
if (this.setWidth) {
|
3370
|
-
width = fixedStyles.elFixedWidth;
|
3371
|
-
}
|
3372
|
-
setElPosition(el, fixedStyles.elFixedLeft, fixedStyles.elFixedTop, width, this.viewportMarginTop);
|
3373
|
-
};
|
3374
|
-
SkyViewkeeper.prototype.getBoundaryInfo = function () {
|
3375
|
-
var spacerId = this.getSpacerId();
|
3376
|
-
var spacerEl = document.getElementById(spacerId);
|
3377
|
-
var boundaryEl = this.boundaryEl;
|
3378
|
-
var boundaryOffset = getOffset(boundaryEl, this.scrollableHost);
|
3379
|
-
var boundaryTop = boundaryOffset.top;
|
3380
|
-
var boundaryBottom = boundaryTop + boundaryEl.getBoundingClientRect().height;
|
3381
|
-
var scrollLeft = this.scrollableHost
|
3382
|
-
? this.scrollableHost.scrollLeft
|
3383
|
-
: document.documentElement.scrollLeft;
|
3384
|
-
var scrollTop = this.scrollableHost
|
3385
|
-
? this.scrollableHost.scrollTop
|
3386
|
-
: document.documentElement.scrollTop;
|
3387
|
-
var elHeight = getHeightWithMargin(this.el);
|
3388
|
-
return {
|
3389
|
-
boundaryBottom: boundaryBottom,
|
3390
|
-
boundaryOffset: boundaryOffset,
|
3391
|
-
boundaryEl: boundaryEl,
|
3392
|
-
elHeight: elHeight,
|
3393
|
-
scrollLeft: scrollLeft,
|
3394
|
-
scrollTop: scrollTop,
|
3395
|
-
spacerId: spacerId,
|
3396
|
-
spacerEl: spacerEl,
|
3397
|
-
};
|
3398
|
-
};
|
3399
|
-
return SkyViewkeeper;
|
3400
|
-
}());
|
3401
|
-
|
3402
|
-
/**
|
3403
|
-
* Provides methods for creating and destroying viewkeeper instances.
|
3404
|
-
*/
|
3405
|
-
var SkyViewkeeperService = /** @class */ (function () {
|
3406
|
-
function SkyViewkeeperService(hostOptions) {
|
3407
|
-
this.hostOptions = hostOptions;
|
3408
|
-
}
|
3409
|
-
/**
|
3410
|
-
*
|
3411
|
-
* @param options Creates a viewkeeper instance, applying host options where applicable.
|
3412
|
-
*/
|
3413
|
-
SkyViewkeeperService.prototype.create = function (options) {
|
3414
|
-
options = Object.assign({}, this.hostOptions || {}, options);
|
3415
|
-
return new SkyViewkeeper(options);
|
3416
|
-
};
|
3417
|
-
/**
|
3418
|
-
* Destroys a viewkeeper instance.
|
3419
|
-
* @param vk Viewkeeper instance to destroy.
|
3420
|
-
*/
|
3421
|
-
SkyViewkeeperService.prototype.destroy = function (vk) {
|
3422
|
-
vk.destroy();
|
3423
|
-
};
|
3424
|
-
return SkyViewkeeperService;
|
3425
|
-
}());
|
3426
|
-
SkyViewkeeperService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyViewkeeperService, deps: [{ token: SkyViewkeeperHostOptions, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
3427
|
-
SkyViewkeeperService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyViewkeeperService, providedIn: 'root' });
|
3428
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyViewkeeperService, decorators: [{
|
3429
|
-
type: i0.Injectable,
|
3430
|
-
args: [{
|
3431
|
-
providedIn: 'root',
|
3432
|
-
}]
|
3433
|
-
}], ctorParameters: function () {
|
3434
|
-
return [{ type: SkyViewkeeperHostOptions, decorators: [{
|
3435
|
-
type: i0.Optional
|
3436
|
-
}] }];
|
3437
|
-
} });
|
3438
|
-
|
3439
|
-
var SkyViewkeeperDirective = /** @class */ (function () {
|
3440
|
-
function SkyViewkeeperDirective(el, mutationObserverSvc, viewkeeperSvc, scrollableHostService) {
|
3441
|
-
this.el = el;
|
3442
|
-
this.mutationObserverSvc = mutationObserverSvc;
|
3443
|
-
this.viewkeeperSvc = viewkeeperSvc;
|
3444
|
-
this.scrollableHostService = scrollableHostService;
|
3445
|
-
this.viewkeepers = [];
|
3446
|
-
this.scrollableHostWatchUnsubscribe = undefined;
|
3447
|
-
}
|
3448
|
-
Object.defineProperty(SkyViewkeeperDirective.prototype, "skyViewkeeper", {
|
3449
|
-
get: function () {
|
3450
|
-
return this._skyViewkeeper;
|
3451
|
-
},
|
3452
|
-
set: function (value) {
|
3453
|
-
this._skyViewkeeper = value;
|
3454
|
-
this.detectElements();
|
3455
|
-
},
|
3456
|
-
enumerable: false,
|
3457
|
-
configurable: true
|
3458
|
-
});
|
3459
|
-
SkyViewkeeperDirective.prototype.ngOnInit = function () {
|
3460
|
-
var _this = this;
|
3461
|
-
this.observer = this.mutationObserverSvc.create(function () { return _this.detectElements(); });
|
3462
|
-
this.observer.observe(this.el.nativeElement, {
|
3463
|
-
childList: true,
|
3464
|
-
subtree: true,
|
3465
|
-
});
|
3466
|
-
};
|
3467
|
-
SkyViewkeeperDirective.prototype.ngOnDestroy = function () {
|
3468
|
-
this.observer.disconnect();
|
3469
|
-
this.destroyViewkeepers();
|
3470
|
-
};
|
3471
|
-
SkyViewkeeperDirective.prototype.destroyViewkeepers = function () {
|
3472
|
-
var e_1, _a;
|
3473
|
-
try {
|
3474
|
-
for (var _b = __values(this.viewkeepers), _c = _b.next(); !_c.done; _c = _b.next()) {
|
3475
|
-
var viewkeeper = _c.value;
|
3476
|
-
this.viewkeeperSvc.destroy(viewkeeper);
|
3477
|
-
}
|
3478
|
-
}
|
3479
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
3480
|
-
finally {
|
3481
|
-
try {
|
3482
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
3483
|
-
}
|
3484
|
-
finally { if (e_1) throw e_1.error; }
|
3485
|
-
}
|
3486
|
-
this.viewkeepers = [];
|
3487
|
-
};
|
3488
|
-
SkyViewkeeperDirective.prototype.getViewkeeperEls = function () {
|
3489
|
-
var e_2, _a;
|
3490
|
-
var viewkeeperEls;
|
3491
|
-
if (this.skyViewkeeper) {
|
3492
|
-
viewkeeperEls = [];
|
3493
|
-
try {
|
3494
|
-
for (var _b = __values(this.skyViewkeeper), _c = _b.next(); !_c.done; _c = _b.next()) {
|
3495
|
-
var item = _c.value;
|
3496
|
-
var matchingEls = Array.from(this.el.nativeElement.querySelectorAll(item));
|
3497
|
-
viewkeeperEls = __spreadArray(__spreadArray([], __read(viewkeeperEls)), __read(matchingEls));
|
3498
|
-
}
|
3499
|
-
}
|
3500
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
3501
|
-
finally {
|
3502
|
-
try {
|
3503
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
3504
|
-
}
|
3505
|
-
finally { if (e_2) throw e_2.error; }
|
3506
|
-
}
|
3507
|
-
}
|
3508
|
-
return viewkeeperEls;
|
3509
|
-
};
|
3510
|
-
SkyViewkeeperDirective.prototype.viewkeeperElsChanged = function (viewkeeperEls) {
|
3511
|
-
if (!viewkeeperEls !== !this.currentViewkeeperEls) {
|
3512
|
-
return true;
|
3513
|
-
}
|
3514
|
-
if (viewkeeperEls && this.currentViewkeeperEls) {
|
3515
|
-
if (viewkeeperEls.length !== this.currentViewkeeperEls.length) {
|
3516
|
-
return true;
|
3517
|
-
}
|
3518
|
-
for (var i = 0, n = viewkeeperEls.length; i < n; i++) {
|
3519
|
-
if (viewkeeperEls[i] !== this.currentViewkeeperEls[i]) {
|
3520
|
-
return true;
|
3521
|
-
}
|
3522
|
-
}
|
3523
|
-
}
|
3524
|
-
return false;
|
3525
|
-
};
|
3526
|
-
SkyViewkeeperDirective.prototype.detectElements = function () {
|
3527
|
-
var _this = this;
|
3528
|
-
var viewkeeperEls = this.getViewkeeperEls();
|
3529
|
-
if (this.viewkeeperElsChanged(viewkeeperEls)) {
|
3530
|
-
if (this.scrollableHostWatchUnsubscribe) {
|
3531
|
-
this.scrollableHostWatchUnsubscribe.next();
|
3532
|
-
this.scrollableHostWatchUnsubscribe = new rxjs.Subject();
|
3533
|
-
}
|
3534
|
-
else {
|
3535
|
-
this.scrollableHostWatchUnsubscribe = new rxjs.Subject();
|
3536
|
-
}
|
3537
|
-
this.scrollableHostService
|
3538
|
-
.watchScrollableHost(this.el)
|
3539
|
-
.pipe(operators.takeUntil(this.scrollableHostWatchUnsubscribe))
|
3540
|
-
.subscribe(function (scrollableHost) {
|
3541
|
-
var e_3, _a;
|
3542
|
-
_this.destroyViewkeepers();
|
3543
|
-
var previousViewkeeperEl;
|
3544
|
-
try {
|
3545
|
-
for (var viewkeeperEls_1 = __values(viewkeeperEls), viewkeeperEls_1_1 = viewkeeperEls_1.next(); !viewkeeperEls_1_1.done; viewkeeperEls_1_1 = viewkeeperEls_1.next()) {
|
3546
|
-
var viewkeeperEl = viewkeeperEls_1_1.value;
|
3547
|
-
_this.viewkeepers.push(_this.viewkeeperSvc.create({
|
3548
|
-
boundaryEl: _this.el.nativeElement,
|
3549
|
-
scrollableHost: scrollableHost instanceof HTMLElement
|
3550
|
-
? scrollableHost
|
3551
|
-
: undefined,
|
3552
|
-
el: viewkeeperEl,
|
3553
|
-
setWidth: true,
|
3554
|
-
verticalOffsetEl: previousViewkeeperEl,
|
3555
|
-
}));
|
3556
|
-
previousViewkeeperEl = viewkeeperEl;
|
3557
|
-
}
|
3558
|
-
}
|
3559
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
3560
|
-
finally {
|
3561
|
-
try {
|
3562
|
-
if (viewkeeperEls_1_1 && !viewkeeperEls_1_1.done && (_a = viewkeeperEls_1.return)) _a.call(viewkeeperEls_1);
|
3563
|
-
}
|
3564
|
-
finally { if (e_3) throw e_3.error; }
|
3565
|
-
}
|
3566
|
-
});
|
3567
|
-
this.currentViewkeeperEls = viewkeeperEls;
|
3568
|
-
}
|
3569
|
-
};
|
3570
|
-
return SkyViewkeeperDirective;
|
3571
|
-
}());
|
3572
|
-
SkyViewkeeperDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyViewkeeperDirective, deps: [{ token: i0__namespace.ElementRef }, { token: MutationObserverService }, { token: SkyViewkeeperService }, { token: SkyScrollableHostService, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
3573
|
-
SkyViewkeeperDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SkyViewkeeperDirective, selector: "[skyViewkeeper]", inputs: { skyViewkeeper: "skyViewkeeper" }, ngImport: i0__namespace });
|
3574
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyViewkeeperDirective, decorators: [{
|
3575
|
-
type: i0.Directive,
|
3576
|
-
args: [{
|
3577
|
-
selector: '[skyViewkeeper]',
|
3578
|
-
}]
|
3579
|
-
}], ctorParameters: function () {
|
3580
|
-
return [{ type: i0__namespace.ElementRef }, { type: MutationObserverService }, { type: SkyViewkeeperService }, { type: SkyScrollableHostService, decorators: [{
|
3581
|
-
type: i0.Optional
|
3582
|
-
}] }];
|
3583
|
-
}, propDecorators: { skyViewkeeper: [{
|
3584
|
-
type: i0.Input
|
3585
|
-
}] } });
|
3586
|
-
|
3587
|
-
var SkyViewkeeperModule = /** @class */ (function () {
|
3588
|
-
function SkyViewkeeperModule() {
|
3589
|
-
}
|
3590
|
-
return SkyViewkeeperModule;
|
3591
|
-
}());
|
3592
|
-
SkyViewkeeperModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyViewkeeperModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
3593
|
-
SkyViewkeeperModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyViewkeeperModule, declarations: [SkyViewkeeperDirective], exports: [SkyViewkeeperDirective] });
|
3594
|
-
SkyViewkeeperModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyViewkeeperModule });
|
3595
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyViewkeeperModule, decorators: [{
|
3596
|
-
type: i0.NgModule,
|
3597
|
-
args: [{
|
3598
|
-
declarations: [SkyViewkeeperDirective],
|
3599
|
-
exports: [SkyViewkeeperDirective],
|
3600
|
-
}]
|
3601
|
-
}] });
|
3602
|
-
|
3603
|
-
/**
|
3604
|
-
* Generated bundle index. Do not edit.
|
3605
|
-
*/
|
3606
|
-
|
3607
|
-
exports.MutationObserverService = MutationObserverService;
|
3608
|
-
exports.NumericOptions = NumericOptions;
|
3609
|
-
exports.SkyAffixModule = SkyAffixModule;
|
3610
|
-
exports.SkyAffixService = SkyAffixService;
|
3611
|
-
exports.SkyAffixer = SkyAffixer;
|
3612
|
-
exports.SkyAppFormat = SkyAppFormat;
|
3613
|
-
exports.SkyAppTitleService = SkyAppTitleService;
|
3614
|
-
exports.SkyAppWindowRef = SkyAppWindowRef;
|
3615
|
-
exports.SkyCoreAdapterModule = SkyCoreAdapterModule;
|
3616
|
-
exports.SkyCoreAdapterService = SkyCoreAdapterService;
|
3617
|
-
exports.SkyDockItem = SkyDockItem;
|
3618
|
-
exports.SkyDockModule = SkyDockModule;
|
3619
|
-
exports.SkyDockService = SkyDockService;
|
3620
|
-
exports.SkyDynamicComponentModule = SkyDynamicComponentModule;
|
3621
|
-
exports.SkyDynamicComponentService = SkyDynamicComponentService;
|
3622
|
-
exports.SkyIdModule = SkyIdModule;
|
3623
|
-
exports.SkyLogModule = SkyLogModule;
|
3624
|
-
exports.SkyLogService = SkyLogService;
|
3625
|
-
exports.SkyMediaQueryModule = SkyMediaQueryModule;
|
3626
|
-
exports.SkyMediaQueryService = SkyMediaQueryService;
|
3627
|
-
exports.SkyNumericModule = SkyNumericModule;
|
3628
|
-
exports.SkyNumericPipe = SkyNumericPipe;
|
3629
|
-
exports.SkyNumericService = SkyNumericService;
|
3630
|
-
exports.SkyOverlayInstance = SkyOverlayInstance;
|
3631
|
-
exports.SkyOverlayModule = SkyOverlayModule;
|
3632
|
-
exports.SkyOverlayService = SkyOverlayService;
|
3633
|
-
exports.SkyPercentPipe = SkyPercentPipe;
|
3634
|
-
exports.SkyPercentPipeModule = SkyPercentPipeModule;
|
3635
|
-
exports.SkyScrollableHostService = SkyScrollableHostService;
|
3636
|
-
exports.SkyUIConfigService = SkyUIConfigService;
|
3637
|
-
exports.SkyViewkeeperHostOptions = SkyViewkeeperHostOptions;
|
3638
|
-
exports.SkyViewkeeperModule = SkyViewkeeperModule;
|
3639
|
-
exports.SkyViewkeeperService = SkyViewkeeperService;
|
3640
|
-
exports.getWindow = getWindow;
|
3641
|
-
exports["λ1"] = SkyAffixDirective;
|
3642
|
-
exports["λ2"] = SkyIdDirective;
|
3643
|
-
exports["λ3"] = SkyViewkeeperDirective;
|
3644
|
-
|
3645
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
3646
|
-
|
3647
|
-
}));
|
3648
|
-
//# sourceMappingURL=skyux-core.umd.js.map
|