@skyux/core 9.0.0-alpha.7 → 9.0.0-alpha.9
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 +1139 -1056
- package/esm2022/index.mjs +3 -3
- package/esm2022/lib/modules/dock/dock.component.mjs +16 -23
- package/esm2022/lib/modules/dock/dock.module.mjs +7 -11
- package/esm2022/lib/modules/dock/dock.service.mjs +3 -3
- package/esm2022/lib/modules/dynamic-component/dynamic-component.service.mjs +18 -3
- package/esm2022/lib/modules/numeric/numeric.service.mjs +3 -3
- package/esm2022/lib/modules/overlay/overlay-config.mjs +1 -1
- package/esm2022/lib/modules/overlay/overlay.component.mjs +39 -40
- package/esm2022/lib/modules/overlay/overlay.module.mjs +7 -9
- package/esm2022/lib/modules/overlay/overlay.service.mjs +27 -5
- package/esm2022/lib/modules/shared/sky-core-resources.module.mjs +4 -2
- package/fesm2022/skyux-core.mjs +314 -285
- package/fesm2022/skyux-core.mjs.map +1 -1
- package/index.d.ts +2 -2
- package/lib/modules/dock/dock.component.d.ts +2 -4
- package/lib/modules/dock/dock.module.d.ts +4 -3
- package/lib/modules/dynamic-component/dynamic-component.service.d.ts +9 -0
- package/lib/modules/overlay/overlay-config.d.ts +5 -0
- package/lib/modules/overlay/overlay.component.d.ts +4 -8
- package/lib/modules/overlay/overlay.module.d.ts +4 -3
- package/lib/modules/overlay/overlay.service.d.ts +12 -0
- package/package.json +2 -2
package/fesm2022/skyux-core.mjs
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import { NgModule, Injectable, EventEmitter, Directive, Input, Output,
|
3
|
-
import * as
|
2
|
+
import { NgModule, Injectable, EventEmitter, Directive, Input, Output, inject, EnvironmentInjector, createEnvironmentInjector, createComponent, ChangeDetectorRef, ElementRef, ViewContainerRef, Component, ChangeDetectionStrategy, ViewChild, InjectionToken, Optional, Inject, Pipe, HostBinding, ApplicationRef } from '@angular/core';
|
3
|
+
import * as i1$1 from '@angular/common';
|
4
4
|
import { CommonModule, DOCUMENT } from '@angular/common';
|
5
5
|
import { Subject, fromEvent, ReplaySubject, BehaviorSubject, Observable, of, concat, animationFrameScheduler } from 'rxjs';
|
6
6
|
import { takeUntil, debounceTime, finalize, switchMap, map } from 'rxjs/operators';
|
7
7
|
import * as i1 from '@skyux/i18n';
|
8
|
-
import { getLibStringForLocale, SkyI18nModule, SKY_LIB_RESOURCES_PROVIDERS, SkyIntlNumberFormatStyle, SkyIntlNumberFormatter } from '@skyux/i18n';
|
9
|
-
import
|
10
|
-
import
|
11
|
-
import * as i1$1 from '@angular/platform-browser';
|
8
|
+
import { SkyLibResourcesService, getLibStringForLocale, SkyI18nModule, SKY_LIB_RESOURCES_PROVIDERS, SkyIntlNumberFormatStyle, SkyIntlNumberFormatter } from '@skyux/i18n';
|
9
|
+
import { Router, NavigationStart } from '@angular/router';
|
10
|
+
import * as i1$2 from '@angular/platform-browser';
|
12
11
|
|
13
12
|
/**
|
14
13
|
* @deprecated The `SkyCoreAdapterService` no longer needs the `SkyCoreAdapterModule`.
|
@@ -988,6 +987,181 @@ var SkyDockLocation;
|
|
988
987
|
SkyDockLocation[SkyDockLocation["ElementBottom"] = 2] = "ElementBottom";
|
989
988
|
})(SkyDockLocation || (SkyDockLocation = {}));
|
990
989
|
|
990
|
+
/**
|
991
|
+
* @deprecated The `SkyDockModule` is no longer needed and can be removed from your application.
|
992
|
+
*/
|
993
|
+
class SkyDockModule {
|
994
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyDockModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
995
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.1", ngImport: i0, type: SkyDockModule }); }
|
996
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyDockModule }); }
|
997
|
+
}
|
998
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyDockModule, decorators: [{
|
999
|
+
type: NgModule,
|
1000
|
+
args: [{}]
|
1001
|
+
}] });
|
1002
|
+
|
1003
|
+
/**
|
1004
|
+
* The location on the page where the dynamic component should be rendered.
|
1005
|
+
*/
|
1006
|
+
var SkyDynamicComponentLocation;
|
1007
|
+
(function (SkyDynamicComponentLocation) {
|
1008
|
+
/**
|
1009
|
+
* Renders the dynamic component before a given element.
|
1010
|
+
*/
|
1011
|
+
SkyDynamicComponentLocation[SkyDynamicComponentLocation["BeforeElement"] = 0] = "BeforeElement";
|
1012
|
+
/**
|
1013
|
+
* Renders the dynamic component as the last element inside the BODY element.
|
1014
|
+
*/
|
1015
|
+
SkyDynamicComponentLocation[SkyDynamicComponentLocation["BodyBottom"] = 1] = "BodyBottom";
|
1016
|
+
/**
|
1017
|
+
* Renders the dynamic component as the first element inside the BODY element.
|
1018
|
+
*/
|
1019
|
+
SkyDynamicComponentLocation[SkyDynamicComponentLocation["BodyTop"] = 2] = "BodyTop";
|
1020
|
+
/**
|
1021
|
+
* Renders the dynamic component as the last element inside a given element.
|
1022
|
+
*/
|
1023
|
+
SkyDynamicComponentLocation[SkyDynamicComponentLocation["ElementBottom"] = 3] = "ElementBottom";
|
1024
|
+
/**
|
1025
|
+
* Renders the dynamic component as the first element inside a given element.
|
1026
|
+
*/
|
1027
|
+
SkyDynamicComponentLocation[SkyDynamicComponentLocation["ElementTop"] = 4] = "ElementTop";
|
1028
|
+
})(SkyDynamicComponentLocation || (SkyDynamicComponentLocation = {}));
|
1029
|
+
|
1030
|
+
/**
|
1031
|
+
* @internal
|
1032
|
+
*/
|
1033
|
+
function getWindow() {
|
1034
|
+
return window;
|
1035
|
+
}
|
1036
|
+
/**
|
1037
|
+
* The application window reference service references the global window variable.
|
1038
|
+
* After users inject SkyAppWindowRef into a component, they can use the service to interact with
|
1039
|
+
* window properties and event handlers by referencing its nativeWindow property.
|
1040
|
+
*/
|
1041
|
+
class SkyAppWindowRef {
|
1042
|
+
/**
|
1043
|
+
* The global `window` variable.
|
1044
|
+
*/
|
1045
|
+
get nativeWindow() {
|
1046
|
+
return getWindow();
|
1047
|
+
}
|
1048
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyAppWindowRef, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
1049
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyAppWindowRef, providedIn: 'root' }); }
|
1050
|
+
}
|
1051
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyAppWindowRef, decorators: [{
|
1052
|
+
type: Injectable,
|
1053
|
+
args: [{
|
1054
|
+
providedIn: 'root',
|
1055
|
+
}]
|
1056
|
+
}] });
|
1057
|
+
|
1058
|
+
/**
|
1059
|
+
* Angular service for creating and rendering a dynamic component.
|
1060
|
+
* @internal
|
1061
|
+
*/
|
1062
|
+
class SkyDynamicComponentService {
|
1063
|
+
#applicationRef;
|
1064
|
+
#renderer;
|
1065
|
+
#windowRef;
|
1066
|
+
#environmentInjector = inject(EnvironmentInjector);
|
1067
|
+
constructor(applicationRef, windowRef, rendererFactory) {
|
1068
|
+
this.#applicationRef = applicationRef;
|
1069
|
+
this.#windowRef = windowRef;
|
1070
|
+
// Based on suggestions from https://github.com/angular/angular/issues/17824
|
1071
|
+
// for accessing an instance of Renderer2 in a service since Renderer2 can't
|
1072
|
+
// be injected into a service. Passing undefined for both parameters results
|
1073
|
+
// in the default renderer which is what we want here.
|
1074
|
+
this.#renderer = rendererFactory.createRenderer(undefined, null);
|
1075
|
+
}
|
1076
|
+
/**
|
1077
|
+
* Creates an instance of the specified component and adds it to the specified location
|
1078
|
+
* on the page.
|
1079
|
+
*/
|
1080
|
+
createComponent(componentType, options) {
|
1081
|
+
options ||= {
|
1082
|
+
location: SkyDynamicComponentLocation.BodyBottom,
|
1083
|
+
};
|
1084
|
+
const environmentInjector = createEnvironmentInjector(options.providers ?? [], options.environmentInjector ?? this.#environmentInjector);
|
1085
|
+
let componentRef;
|
1086
|
+
if (options.viewContainerRef) {
|
1087
|
+
componentRef = options.viewContainerRef.createComponent(componentType, {
|
1088
|
+
environmentInjector,
|
1089
|
+
});
|
1090
|
+
}
|
1091
|
+
else {
|
1092
|
+
componentRef = createComponent(componentType, {
|
1093
|
+
environmentInjector,
|
1094
|
+
});
|
1095
|
+
this.#applicationRef.attachView(componentRef.hostView);
|
1096
|
+
const el = this.#getRootNode(componentRef);
|
1097
|
+
const bodyEl = this.#windowRef.nativeWindow.document.body;
|
1098
|
+
switch (options.location) {
|
1099
|
+
case SkyDynamicComponentLocation.BeforeElement:
|
1100
|
+
if (!options.referenceEl) {
|
1101
|
+
throw new Error('[SkyDynamicComponentService] Could not create a component at location `SkyDynamicComponentLocation.BeforeElement` because a reference element was not provided.');
|
1102
|
+
}
|
1103
|
+
this.#renderer.insertBefore(options.referenceEl.parentElement, el, options.referenceEl);
|
1104
|
+
break;
|
1105
|
+
case SkyDynamicComponentLocation.ElementTop:
|
1106
|
+
if (!options.referenceEl) {
|
1107
|
+
throw new Error('[SkyDynamicComponentService] Could not create a component at location `SkyDynamicComponentLocation.ElementTop` because a reference element was not provided.');
|
1108
|
+
}
|
1109
|
+
this.#renderer.insertBefore(options.referenceEl, el, options.referenceEl.firstChild);
|
1110
|
+
break;
|
1111
|
+
case SkyDynamicComponentLocation.ElementBottom:
|
1112
|
+
this.#renderer.appendChild(options.referenceEl, el);
|
1113
|
+
break;
|
1114
|
+
case SkyDynamicComponentLocation.BodyTop:
|
1115
|
+
this.#renderer.insertBefore(bodyEl, el, bodyEl.firstChild);
|
1116
|
+
break;
|
1117
|
+
default:
|
1118
|
+
this.#renderer.appendChild(bodyEl, el);
|
1119
|
+
break;
|
1120
|
+
}
|
1121
|
+
}
|
1122
|
+
return componentRef;
|
1123
|
+
}
|
1124
|
+
/**
|
1125
|
+
* Removes a component ref from the page
|
1126
|
+
* @param componentRef Component ref for the component being removed
|
1127
|
+
*/
|
1128
|
+
removeComponent(componentRef) {
|
1129
|
+
if (!componentRef) {
|
1130
|
+
return;
|
1131
|
+
}
|
1132
|
+
this.#applicationRef.detachView(componentRef.hostView);
|
1133
|
+
componentRef.destroy();
|
1134
|
+
}
|
1135
|
+
#getRootNode(componentRef) {
|
1136
|
+
// Technique for retrieving the component's root node taken from here:
|
1137
|
+
// https://malcoded.com/posts/angular-dynamic-components
|
1138
|
+
return componentRef.hostView.rootNodes[0];
|
1139
|
+
}
|
1140
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyDynamicComponentService, deps: [{ token: i0.ApplicationRef }, { token: SkyAppWindowRef }, { token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
1141
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyDynamicComponentService, providedIn: 'root' }); }
|
1142
|
+
}
|
1143
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyDynamicComponentService, decorators: [{
|
1144
|
+
type: Injectable,
|
1145
|
+
args: [{
|
1146
|
+
providedIn: 'root',
|
1147
|
+
}]
|
1148
|
+
}], ctorParameters: function () { return [{ type: i0.ApplicationRef }, { type: SkyAppWindowRef }, { type: i0.RendererFactory2 }]; } });
|
1149
|
+
/**
|
1150
|
+
* Angular service for creating and rendering a dynamic component.
|
1151
|
+
* @internal
|
1152
|
+
* @deprecated Use `SkyDynamicComponentService` to create a standalone component instead.
|
1153
|
+
*/
|
1154
|
+
class SkyDynamicComponentLegacyService extends SkyDynamicComponentService {
|
1155
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyDynamicComponentLegacyService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
1156
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyDynamicComponentLegacyService, providedIn: 'any' }); }
|
1157
|
+
}
|
1158
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyDynamicComponentLegacyService, decorators: [{
|
1159
|
+
type: Injectable,
|
1160
|
+
args: [{
|
1161
|
+
providedIn: 'any',
|
1162
|
+
}]
|
1163
|
+
}] });
|
1164
|
+
|
991
1165
|
/**
|
992
1166
|
* @internal
|
993
1167
|
*/
|
@@ -1098,29 +1272,22 @@ function sortByStackOrder(a, b) {
|
|
1098
1272
|
* @internal
|
1099
1273
|
*/
|
1100
1274
|
class SkyDockComponent {
|
1101
|
-
#changeDetector;
|
1102
|
-
#domAdapter;
|
1103
|
-
#elementRef;
|
1104
|
-
#injector;
|
1105
1275
|
#itemRefs = [];
|
1106
1276
|
#options;
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
}
|
1277
|
+
#changeDetector = inject(ChangeDetectorRef);
|
1278
|
+
#domAdapter = inject(SkyDockDomAdapterService);
|
1279
|
+
#dynamicComponentSvc = inject(SkyDynamicComponentService);
|
1280
|
+
#elementRef = inject(ElementRef);
|
1281
|
+
#environmentInjector = inject(EnvironmentInjector);
|
1113
1282
|
insertComponent(component, config = {}) {
|
1114
1283
|
/*istanbul ignore if: untestable*/
|
1115
1284
|
if (!this.target) {
|
1116
1285
|
throw Error('[SkyDockComponent] Could not insert the component because the target element could not be found.');
|
1117
1286
|
}
|
1118
|
-
const
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
const componentRef = this.target.createComponent(component, {
|
1123
|
-
injector,
|
1287
|
+
const componentRef = this.#dynamicComponentSvc.createComponent(component, {
|
1288
|
+
environmentInjector: this.#environmentInjector,
|
1289
|
+
providers: config.providers,
|
1290
|
+
viewContainerRef: this.target,
|
1124
1291
|
});
|
1125
1292
|
const stackOrder = config.stackOrder !== null && config.stackOrder !== undefined
|
1126
1293
|
? config.stackOrder
|
@@ -1182,13 +1349,13 @@ class SkyDockComponent {
|
|
1182
1349
|
}
|
1183
1350
|
return this.#itemRefs[0].stackOrder + 1;
|
1184
1351
|
}
|
1185
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyDockComponent, deps: [
|
1186
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.1", type: SkyDockComponent, selector: "sky-dock", providers: [SkyDockDomAdapterService], viewQueries: [{ propertyName: "target", first: true, predicate: ["target"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<ng-container #target></ng-container>\n", styles: [":host{display:flex;flex-direction:column;width:100%}:host:not(.sky-dock-unbound){position:fixed;left:var(--sky-viewport-left, 0);bottom:var(--sky-viewport-bottom, 0);right:var(--sky-viewport-right, 0);width:auto}:host.sky-dock-sticky{position:sticky}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
1352
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyDockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
1353
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.1", type: SkyDockComponent, isStandalone: true, selector: "sky-dock", providers: [SkyDockDomAdapterService], viewQueries: [{ propertyName: "target", first: true, predicate: ["target"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<ng-container #target></ng-container>\n", styles: [":host{display:flex;flex-direction:column;width:100%}:host:not(.sky-dock-unbound){position:fixed;left:var(--sky-viewport-left, 0);bottom:var(--sky-viewport-bottom, 0);right:var(--sky-viewport-right, 0);width:auto}:host.sky-dock-sticky{position:sticky}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
1187
1354
|
}
|
1188
1355
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyDockComponent, decorators: [{
|
1189
1356
|
type: Component,
|
1190
|
-
args: [{ selector: 'sky-dock', providers: [SkyDockDomAdapterService], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container #target></ng-container>\n", styles: [":host{display:flex;flex-direction:column;width:100%}:host:not(.sky-dock-unbound){position:fixed;left:var(--sky-viewport-left, 0);bottom:var(--sky-viewport-bottom, 0);right:var(--sky-viewport-right, 0);width:auto}:host.sky-dock-sticky{position:sticky}\n"] }]
|
1191
|
-
}],
|
1357
|
+
args: [{ standalone: true, selector: 'sky-dock', providers: [SkyDockDomAdapterService], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container #target></ng-container>\n", styles: [":host{display:flex;flex-direction:column;width:100%}:host:not(.sky-dock-unbound){position:fixed;left:var(--sky-viewport-left, 0);bottom:var(--sky-viewport-bottom, 0);right:var(--sky-viewport-right, 0);width:auto}:host.sky-dock-sticky{position:sticky}\n"] }]
|
1358
|
+
}], propDecorators: { target: [{
|
1192
1359
|
type: ViewChild,
|
1193
1360
|
args: ['target', {
|
1194
1361
|
read: ViewContainerRef,
|
@@ -1196,167 +1363,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImpor
|
|
1196
1363
|
}]
|
1197
1364
|
}] } });
|
1198
1365
|
|
1199
|
-
class SkyDockModule {
|
1200
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyDockModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
1201
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.1", ngImport: i0, type: SkyDockModule, declarations: [SkyDockComponent], imports: [CommonModule] }); }
|
1202
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyDockModule, providers: [SkyMutationObserverService], imports: [CommonModule] }); }
|
1203
|
-
}
|
1204
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyDockModule, decorators: [{
|
1205
|
-
type: NgModule,
|
1206
|
-
args: [{
|
1207
|
-
imports: [CommonModule],
|
1208
|
-
declarations: [SkyDockComponent],
|
1209
|
-
providers: [SkyMutationObserverService],
|
1210
|
-
}]
|
1211
|
-
}] });
|
1212
|
-
|
1213
|
-
/**
|
1214
|
-
* The location on the page where the dynamic component should be rendered.
|
1215
|
-
*/
|
1216
|
-
var SkyDynamicComponentLocation;
|
1217
|
-
(function (SkyDynamicComponentLocation) {
|
1218
|
-
/**
|
1219
|
-
* Renders the dynamic component before a given element.
|
1220
|
-
*/
|
1221
|
-
SkyDynamicComponentLocation[SkyDynamicComponentLocation["BeforeElement"] = 0] = "BeforeElement";
|
1222
|
-
/**
|
1223
|
-
* Renders the dynamic component as the last element inside the BODY element.
|
1224
|
-
*/
|
1225
|
-
SkyDynamicComponentLocation[SkyDynamicComponentLocation["BodyBottom"] = 1] = "BodyBottom";
|
1226
|
-
/**
|
1227
|
-
* Renders the dynamic component as the first element inside the BODY element.
|
1228
|
-
*/
|
1229
|
-
SkyDynamicComponentLocation[SkyDynamicComponentLocation["BodyTop"] = 2] = "BodyTop";
|
1230
|
-
/**
|
1231
|
-
* Renders the dynamic component as the last element inside a given element.
|
1232
|
-
*/
|
1233
|
-
SkyDynamicComponentLocation[SkyDynamicComponentLocation["ElementBottom"] = 3] = "ElementBottom";
|
1234
|
-
/**
|
1235
|
-
* Renders the dynamic component as the first element inside a given element.
|
1236
|
-
*/
|
1237
|
-
SkyDynamicComponentLocation[SkyDynamicComponentLocation["ElementTop"] = 4] = "ElementTop";
|
1238
|
-
})(SkyDynamicComponentLocation || (SkyDynamicComponentLocation = {}));
|
1239
|
-
|
1240
|
-
/**
|
1241
|
-
* @internal
|
1242
|
-
*/
|
1243
|
-
function getWindow() {
|
1244
|
-
return window;
|
1245
|
-
}
|
1246
|
-
/**
|
1247
|
-
* The application window reference service references the global window variable.
|
1248
|
-
* After users inject SkyAppWindowRef into a component, they can use the service to interact with
|
1249
|
-
* window properties and event handlers by referencing its nativeWindow property.
|
1250
|
-
*/
|
1251
|
-
class SkyAppWindowRef {
|
1252
|
-
/**
|
1253
|
-
* The global `window` variable.
|
1254
|
-
*/
|
1255
|
-
get nativeWindow() {
|
1256
|
-
return getWindow();
|
1257
|
-
}
|
1258
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyAppWindowRef, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
1259
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyAppWindowRef, providedIn: 'root' }); }
|
1260
|
-
}
|
1261
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyAppWindowRef, decorators: [{
|
1262
|
-
type: Injectable,
|
1263
|
-
args: [{
|
1264
|
-
providedIn: 'root',
|
1265
|
-
}]
|
1266
|
-
}] });
|
1267
|
-
|
1268
|
-
/**
|
1269
|
-
* Angular service for creating and rendering a dynamic component.
|
1270
|
-
* @internal
|
1271
|
-
*/
|
1272
|
-
class SkyDynamicComponentService {
|
1273
|
-
#applicationRef;
|
1274
|
-
#renderer;
|
1275
|
-
#windowRef;
|
1276
|
-
#environmentInjector = inject(EnvironmentInjector);
|
1277
|
-
constructor(applicationRef, windowRef, rendererFactory) {
|
1278
|
-
this.#applicationRef = applicationRef;
|
1279
|
-
this.#windowRef = windowRef;
|
1280
|
-
// Based on suggestions from https://github.com/angular/angular/issues/17824
|
1281
|
-
// for accessing an instance of Renderer2 in a service since Renderer2 can't
|
1282
|
-
// be injected into a service. Passing undefined for both parameters results
|
1283
|
-
// in the default renderer which is what we want here.
|
1284
|
-
this.#renderer = rendererFactory.createRenderer(undefined, null);
|
1285
|
-
}
|
1286
|
-
/**
|
1287
|
-
* Creates an instance of the specified component and adds it to the specified location
|
1288
|
-
* on the page.
|
1289
|
-
*/
|
1290
|
-
createComponent(componentType, options) {
|
1291
|
-
options ||= {
|
1292
|
-
location: SkyDynamicComponentLocation.BodyBottom,
|
1293
|
-
};
|
1294
|
-
const environmentInjector = createEnvironmentInjector(options.providers ?? [], options.environmentInjector ?? this.#environmentInjector);
|
1295
|
-
let componentRef;
|
1296
|
-
if (options.viewContainerRef) {
|
1297
|
-
componentRef = options.viewContainerRef.createComponent(componentType, {
|
1298
|
-
environmentInjector,
|
1299
|
-
});
|
1300
|
-
}
|
1301
|
-
else {
|
1302
|
-
componentRef = createComponent(componentType, {
|
1303
|
-
environmentInjector,
|
1304
|
-
});
|
1305
|
-
this.#applicationRef.attachView(componentRef.hostView);
|
1306
|
-
const el = this.#getRootNode(componentRef);
|
1307
|
-
const bodyEl = this.#windowRef.nativeWindow.document.body;
|
1308
|
-
switch (options.location) {
|
1309
|
-
case SkyDynamicComponentLocation.BeforeElement:
|
1310
|
-
if (!options.referenceEl) {
|
1311
|
-
throw new Error('[SkyDynamicComponentService] Could not create a component at location `SkyDynamicComponentLocation.BeforeElement` because a reference element was not provided.');
|
1312
|
-
}
|
1313
|
-
this.#renderer.insertBefore(options.referenceEl.parentElement, el, options.referenceEl);
|
1314
|
-
break;
|
1315
|
-
case SkyDynamicComponentLocation.ElementTop:
|
1316
|
-
if (!options.referenceEl) {
|
1317
|
-
throw new Error('[SkyDynamicComponentService] Could not create a component at location `SkyDynamicComponentLocation.ElementTop` because a reference element was not provided.');
|
1318
|
-
}
|
1319
|
-
this.#renderer.insertBefore(options.referenceEl, el, options.referenceEl.firstChild);
|
1320
|
-
break;
|
1321
|
-
case SkyDynamicComponentLocation.ElementBottom:
|
1322
|
-
this.#renderer.appendChild(options.referenceEl, el);
|
1323
|
-
break;
|
1324
|
-
case SkyDynamicComponentLocation.BodyTop:
|
1325
|
-
this.#renderer.insertBefore(bodyEl, el, bodyEl.firstChild);
|
1326
|
-
break;
|
1327
|
-
default:
|
1328
|
-
this.#renderer.appendChild(bodyEl, el);
|
1329
|
-
break;
|
1330
|
-
}
|
1331
|
-
}
|
1332
|
-
return componentRef;
|
1333
|
-
}
|
1334
|
-
/**
|
1335
|
-
* Removes a component ref from the page
|
1336
|
-
* @param componentRef Component ref for the component being removed
|
1337
|
-
*/
|
1338
|
-
removeComponent(componentRef) {
|
1339
|
-
if (!componentRef) {
|
1340
|
-
return;
|
1341
|
-
}
|
1342
|
-
this.#applicationRef.detachView(componentRef.hostView);
|
1343
|
-
componentRef.destroy();
|
1344
|
-
}
|
1345
|
-
#getRootNode(componentRef) {
|
1346
|
-
// Technique for retrieving the component's root node taken from here:
|
1347
|
-
// https://malcoded.com/posts/angular-dynamic-components
|
1348
|
-
return componentRef.hostView.rootNodes[0];
|
1349
|
-
}
|
1350
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyDynamicComponentService, deps: [{ token: i0.ApplicationRef }, { token: SkyAppWindowRef }, { token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
1351
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyDynamicComponentService, providedIn: 'any' }); }
|
1352
|
-
}
|
1353
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyDynamicComponentService, decorators: [{
|
1354
|
-
type: Injectable,
|
1355
|
-
args: [{
|
1356
|
-
providedIn: 'any',
|
1357
|
-
}]
|
1358
|
-
}], ctorParameters: function () { return [{ type: i0.ApplicationRef }, { type: SkyAppWindowRef }, { type: i0.RendererFactory2 }]; } });
|
1359
|
-
|
1360
1366
|
/**
|
1361
1367
|
* This service docks components to specific areas on the page.
|
1362
1368
|
*/
|
@@ -1433,12 +1439,12 @@ class SkyDockService {
|
|
1433
1439
|
SkyDockService.dockRef = undefined;
|
1434
1440
|
}
|
1435
1441
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyDockService, deps: [{ token: SkyDynamicComponentService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
1436
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyDockService, providedIn: '
|
1442
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyDockService, providedIn: 'root' }); }
|
1437
1443
|
}
|
1438
1444
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyDockService, decorators: [{
|
1439
1445
|
type: Injectable,
|
1440
1446
|
args: [{
|
1441
|
-
providedIn: '
|
1447
|
+
providedIn: 'root',
|
1442
1448
|
}]
|
1443
1449
|
}], ctorParameters: function () { return [{ type: SkyDynamicComponentService }]; } });
|
1444
1450
|
|
@@ -1927,6 +1933,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImpor
|
|
1927
1933
|
}]
|
1928
1934
|
}], ctorParameters: function () { return [{ type: i0.NgZone }]; } });
|
1929
1935
|
|
1936
|
+
/* istanbul ignore file */
|
1930
1937
|
/**
|
1931
1938
|
* NOTICE: DO NOT MODIFY THIS FILE!
|
1932
1939
|
* The contents of this file were automatically generated by
|
@@ -1941,6 +1948,7 @@ const RESOURCES = {
|
|
1941
1948
|
skyux_numeric_trillions_symbol: { message: 'T' },
|
1942
1949
|
},
|
1943
1950
|
};
|
1951
|
+
SkyLibResourcesService.addResources(RESOURCES);
|
1944
1952
|
class SkyCoreResourcesProvider {
|
1945
1953
|
getString(localeInfo, name) {
|
1946
1954
|
return getLibStringForLocale(RESOURCES, localeInfo.locale, name);
|
@@ -2260,12 +2268,12 @@ class SkyNumericService {
|
|
2260
2268
|
return this.#resourcesSvc.getStringForLocale({ locale: 'en_US' }, key);
|
2261
2269
|
}
|
2262
2270
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyNumericService, deps: [{ token: i1.SkyLibResourcesService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
2263
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyNumericService, providedIn: '
|
2271
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyNumericService, providedIn: 'root' }); }
|
2264
2272
|
}
|
2265
2273
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyNumericService, decorators: [{
|
2266
2274
|
type: Injectable,
|
2267
2275
|
args: [{
|
2268
|
-
providedIn: '
|
2276
|
+
providedIn: 'root',
|
2269
2277
|
}]
|
2270
2278
|
}], ctorParameters: function () { return [{ type: i1.SkyLibResourcesService }]; } });
|
2271
2279
|
|
@@ -2419,10 +2427,60 @@ class SkyOverlayInstance {
|
|
2419
2427
|
}
|
2420
2428
|
}
|
2421
2429
|
|
2430
|
+
/**
|
2431
|
+
* @deprecated The `SkyOverlayModule` is no longer needed and can be removed from your application.
|
2432
|
+
*/
|
2433
|
+
class SkyOverlayModule {
|
2434
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyOverlayModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
2435
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.1", ngImport: i0, type: SkyOverlayModule }); }
|
2436
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyOverlayModule }); }
|
2437
|
+
}
|
2438
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyOverlayModule, decorators: [{
|
2439
|
+
type: NgModule,
|
2440
|
+
args: [{}]
|
2441
|
+
}] });
|
2442
|
+
|
2422
2443
|
/**
|
2423
2444
|
* @internal
|
2424
2445
|
*/
|
2425
|
-
|
2446
|
+
class SkyOverlayAdapterService {
|
2447
|
+
#renderer;
|
2448
|
+
#styleElement;
|
2449
|
+
constructor(rendererFactory) {
|
2450
|
+
this.#renderer = rendererFactory.createRenderer(undefined, null);
|
2451
|
+
}
|
2452
|
+
restrictBodyScroll() {
|
2453
|
+
// Create a style element to avoid overwriting any existing inline body styles.
|
2454
|
+
const styleElement = this.#renderer.createElement('style');
|
2455
|
+
const textNode = this.#renderer.createText('body { overflow: hidden }');
|
2456
|
+
// Apply a `data-` attribute to make unit testing easier.
|
2457
|
+
this.#renderer.setAttribute(styleElement, 'data-test-selector', 'sky-overlay-restrict-scroll-styles');
|
2458
|
+
this.#renderer.appendChild(styleElement, textNode);
|
2459
|
+
this.#renderer.appendChild(document.head, styleElement);
|
2460
|
+
if (this.#styleElement) {
|
2461
|
+
this.#destroyStyleElement();
|
2462
|
+
}
|
2463
|
+
this.#styleElement = styleElement;
|
2464
|
+
}
|
2465
|
+
releaseBodyScroll() {
|
2466
|
+
this.#destroyStyleElement();
|
2467
|
+
}
|
2468
|
+
#destroyStyleElement() {
|
2469
|
+
/* istanbul ignore else */
|
2470
|
+
if (this.#styleElement &&
|
2471
|
+
this.#styleElement.parentElement === document.head) {
|
2472
|
+
this.#renderer.removeChild(document.head, this.#styleElement);
|
2473
|
+
}
|
2474
|
+
}
|
2475
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyOverlayAdapterService, deps: [{ token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
2476
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyOverlayAdapterService, providedIn: 'root' }); }
|
2477
|
+
}
|
2478
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyOverlayAdapterService, decorators: [{
|
2479
|
+
type: Injectable,
|
2480
|
+
args: [{
|
2481
|
+
providedIn: 'root',
|
2482
|
+
}]
|
2483
|
+
}], ctorParameters: function () { return [{ type: i0.RendererFactory2 }]; } });
|
2426
2484
|
|
2427
2485
|
/**
|
2428
2486
|
* Contextual information for each overlay.
|
@@ -2434,6 +2492,11 @@ class SkyOverlayContext {
|
|
2434
2492
|
}
|
2435
2493
|
}
|
2436
2494
|
|
2495
|
+
/**
|
2496
|
+
* @internal
|
2497
|
+
*/
|
2498
|
+
const SKY_STACKING_CONTEXT = new InjectionToken('SkyStackingContext');
|
2499
|
+
|
2437
2500
|
const POSITION_DEFAULT = 'fixed';
|
2438
2501
|
/**
|
2439
2502
|
* Omnibar is 1000.
|
@@ -2461,16 +2524,17 @@ class SkyOverlayComponent {
|
|
2461
2524
|
}
|
2462
2525
|
#backdropClick;
|
2463
2526
|
#backdropClickObs;
|
2464
|
-
#changeDetector;
|
2465
2527
|
#closed;
|
2466
2528
|
#closedObs;
|
2529
|
+
#ngUnsubscribe;
|
2530
|
+
#routerSubscription;
|
2531
|
+
#changeDetector;
|
2467
2532
|
#context;
|
2468
2533
|
#coreAdapter;
|
2469
|
-
#
|
2470
|
-
#
|
2534
|
+
#environmentInjector;
|
2535
|
+
#idSvc;
|
2471
2536
|
#router;
|
2472
|
-
|
2473
|
-
constructor(changeDetector, injector, coreAdapter, context, idSvc, router) {
|
2537
|
+
constructor() {
|
2474
2538
|
this.wrapperClass = '';
|
2475
2539
|
this.enablePointerEvents = false;
|
2476
2540
|
this.showBackdrop = false;
|
@@ -2478,12 +2542,13 @@ class SkyOverlayComponent {
|
|
2478
2542
|
this.clipPath$ = new ReplaySubject(1);
|
2479
2543
|
this.position = POSITION_DEFAULT;
|
2480
2544
|
this.#ngUnsubscribe = new Subject();
|
2481
|
-
this.#changeDetector =
|
2482
|
-
this.#
|
2483
|
-
this.#coreAdapter =
|
2484
|
-
this.#
|
2485
|
-
this.#
|
2486
|
-
this
|
2545
|
+
this.#changeDetector = inject(ChangeDetectorRef);
|
2546
|
+
this.#context = inject(SkyOverlayContext);
|
2547
|
+
this.#coreAdapter = inject(SkyCoreAdapterService);
|
2548
|
+
this.#environmentInjector = inject(EnvironmentInjector);
|
2549
|
+
this.#idSvc = inject(SkyIdService);
|
2550
|
+
this.#router = inject(Router, { optional: true });
|
2551
|
+
this.id = this.#idSvc.generateId();
|
2487
2552
|
this.#backdropClick = new Subject();
|
2488
2553
|
this.#closed = new Subject();
|
2489
2554
|
this.#backdropClickObs = this.#backdropClick.asObservable();
|
@@ -2512,22 +2577,19 @@ class SkyOverlayComponent {
|
|
2512
2577
|
throw new Error('[SkyOverlayComponent] Could not attach the component because the target element could not be found.');
|
2513
2578
|
}
|
2514
2579
|
this.targetRef.clear();
|
2515
|
-
const
|
2516
|
-
|
2517
|
-
|
2518
|
-
|
2519
|
-
|
2520
|
-
|
2521
|
-
|
2522
|
-
.pipe(takeUntil(this.#ngUnsubscribe)),
|
2523
|
-
},
|
2580
|
+
const environmentInjector = createEnvironmentInjector([
|
2581
|
+
{
|
2582
|
+
provide: SKY_STACKING_CONTEXT,
|
2583
|
+
useValue: {
|
2584
|
+
zIndex: new BehaviorSubject(parseInt(this.zIndex, 10))
|
2585
|
+
.asObservable()
|
2586
|
+
.pipe(takeUntil(this.#ngUnsubscribe)),
|
2524
2587
|
},
|
2525
|
-
|
2526
|
-
|
2527
|
-
|
2528
|
-
});
|
2588
|
+
},
|
2589
|
+
...providers,
|
2590
|
+
], this.#environmentInjector);
|
2529
2591
|
const componentRef = this.targetRef.createComponent(component, {
|
2530
|
-
|
2592
|
+
environmentInjector,
|
2531
2593
|
});
|
2532
2594
|
// Run an initial change detection cycle after the component has been created.
|
2533
2595
|
componentRef.changeDetectorRef.detectChanges();
|
@@ -2539,7 +2601,9 @@ class SkyOverlayComponent {
|
|
2539
2601
|
throw new Error('[SkyOverlayComponent] Could not attach the template because the target element could not be found.');
|
2540
2602
|
}
|
2541
2603
|
this.targetRef.clear();
|
2542
|
-
return this.targetRef.createEmbeddedView(templateRef, context
|
2604
|
+
return this.targetRef.createEmbeddedView(templateRef, context, {
|
2605
|
+
injector: this.#environmentInjector,
|
2606
|
+
});
|
2543
2607
|
}
|
2544
2608
|
updateClipPath(clipPath) {
|
2545
2609
|
this.clipPath$.next(clipPath);
|
@@ -2585,15 +2649,13 @@ class SkyOverlayComponent {
|
|
2585
2649
|
this.#routerSubscription = undefined;
|
2586
2650
|
}
|
2587
2651
|
}
|
2588
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyOverlayComponent, deps: [
|
2589
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.1", type: SkyOverlayComponent, selector: "sky-overlay", host: { properties: { "id": "this.id" } }, viewQueries: [{ propertyName: "overlayContentRef", first: true, predicate: ["overlayContentRef"], descendants: true, read: ElementRef, static: true }, { propertyName: "overlayRef", first: true, predicate: ["overlayRef"], descendants: true, read: ElementRef, static: true }, { propertyName: "targetRef", first: true, predicate: ["target"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<div\n [class]=\"'sky-overlay-position-' + position + ' ' + wrapperClass\"\n [style.z-index]=\"zIndex\"\n [style.clip-path]=\"clipPath$ | async\"\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{inset:0;width:100%;height:100%;display:flex;pointer-events:auto}.sky-overlay-position-absolute{position:absolute}.sky-overlay-position-fixed{position:fixed}.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);inset:0;width:100%;height:100%;position:absolute}.enable-pointer-events-pass-through,.enable-pointer-events-pass-through .sky-overlay-backdrop{pointer-events:none}.enable-pointer-events-pass-through .sky-overlay-content{pointer-events:auto}\n"], dependencies: [{ kind: "directive", type:
|
2652
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyOverlayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
2653
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.1", type: SkyOverlayComponent, isStandalone: true, selector: "sky-overlay", host: { properties: { "id": "this.id" } }, viewQueries: [{ propertyName: "overlayContentRef", first: true, predicate: ["overlayContentRef"], descendants: true, read: ElementRef, static: true }, { propertyName: "overlayRef", first: true, predicate: ["overlayRef"], descendants: true, read: ElementRef, static: true }, { propertyName: "targetRef", first: true, predicate: ["target"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<div\n [class]=\"'sky-overlay-position-' + position + ' ' + wrapperClass\"\n [style.z-index]=\"zIndex\"\n [style.clip-path]=\"clipPath$ | async\"\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{inset:0;width:100%;height:100%;display:flex;pointer-events:auto}.sky-overlay-position-absolute{position:absolute}.sky-overlay-position-fixed{position:fixed}.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);inset:0;width:100%;height:100%;position:absolute}.enable-pointer-events-pass-through,.enable-pointer-events-pass-through .sky-overlay-backdrop{pointer-events:none}.enable-pointer-events-pass-through .sky-overlay-content{pointer-events:auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
2590
2654
|
}
|
2591
2655
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyOverlayComponent, decorators: [{
|
2592
2656
|
type: Component,
|
2593
|
-
args: [{ selector: 'sky-overlay', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n [class]=\"'sky-overlay-position-' + position + ' ' + wrapperClass\"\n [style.z-index]=\"zIndex\"\n [style.clip-path]=\"clipPath$ | async\"\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{inset:0;width:100%;height:100%;display:flex;pointer-events:auto}.sky-overlay-position-absolute{position:absolute}.sky-overlay-position-fixed{position:fixed}.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);inset:0;width:100%;height:100%;position:absolute}.enable-pointer-events-pass-through,.enable-pointer-events-pass-through .sky-overlay-backdrop{pointer-events:none}.enable-pointer-events-pass-through .sky-overlay-content{pointer-events:auto}\n"] }]
|
2594
|
-
}], ctorParameters: function () { return [
|
2595
|
-
type: Optional
|
2596
|
-
}] }]; }, propDecorators: { id: [{
|
2657
|
+
args: [{ standalone: true, selector: 'sky-overlay', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule], template: "<div\n [class]=\"'sky-overlay-position-' + position + ' ' + wrapperClass\"\n [style.z-index]=\"zIndex\"\n [style.clip-path]=\"clipPath$ | async\"\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{inset:0;width:100%;height:100%;display:flex;pointer-events:auto}.sky-overlay-position-absolute{position:absolute}.sky-overlay-position-fixed{position:fixed}.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);inset:0;width:100%;height:100%;position:absolute}.enable-pointer-events-pass-through,.enable-pointer-events-pass-through .sky-overlay-backdrop{pointer-events:none}.enable-pointer-events-pass-through .sky-overlay-content{pointer-events:auto}\n"] }]
|
2658
|
+
}], ctorParameters: function () { return []; }, propDecorators: { id: [{
|
2597
2659
|
type: HostBinding,
|
2598
2660
|
args: ['id']
|
2599
2661
|
}], overlayContentRef: [{
|
@@ -2616,61 +2678,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImpor
|
|
2616
2678
|
}]
|
2617
2679
|
}] } });
|
2618
2680
|
|
2619
|
-
class SkyOverlayModule {
|
2620
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyOverlayModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
2621
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.1", ngImport: i0, type: SkyOverlayModule, declarations: [SkyOverlayComponent], imports: [CommonModule] }); }
|
2622
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyOverlayModule, imports: [CommonModule] }); }
|
2623
|
-
}
|
2624
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyOverlayModule, decorators: [{
|
2625
|
-
type: NgModule,
|
2626
|
-
args: [{
|
2627
|
-
imports: [CommonModule],
|
2628
|
-
declarations: [SkyOverlayComponent],
|
2629
|
-
}]
|
2630
|
-
}] });
|
2631
|
-
|
2632
|
-
/**
|
2633
|
-
* @internal
|
2634
|
-
*/
|
2635
|
-
class SkyOverlayAdapterService {
|
2636
|
-
#renderer;
|
2637
|
-
#styleElement;
|
2638
|
-
constructor(rendererFactory) {
|
2639
|
-
this.#renderer = rendererFactory.createRenderer(undefined, null);
|
2640
|
-
}
|
2641
|
-
restrictBodyScroll() {
|
2642
|
-
// Create a style element to avoid overwriting any existing inline body styles.
|
2643
|
-
const styleElement = this.#renderer.createElement('style');
|
2644
|
-
const textNode = this.#renderer.createText('body { overflow: hidden }');
|
2645
|
-
// Apply a `data-` attribute to make unit testing easier.
|
2646
|
-
this.#renderer.setAttribute(styleElement, 'data-test-selector', 'sky-overlay-restrict-scroll-styles');
|
2647
|
-
this.#renderer.appendChild(styleElement, textNode);
|
2648
|
-
this.#renderer.appendChild(document.head, styleElement);
|
2649
|
-
if (this.#styleElement) {
|
2650
|
-
this.#destroyStyleElement();
|
2651
|
-
}
|
2652
|
-
this.#styleElement = styleElement;
|
2653
|
-
}
|
2654
|
-
releaseBodyScroll() {
|
2655
|
-
this.#destroyStyleElement();
|
2656
|
-
}
|
2657
|
-
#destroyStyleElement() {
|
2658
|
-
/* istanbul ignore else */
|
2659
|
-
if (this.#styleElement &&
|
2660
|
-
this.#styleElement.parentElement === document.head) {
|
2661
|
-
this.#renderer.removeChild(document.head, this.#styleElement);
|
2662
|
-
}
|
2663
|
-
}
|
2664
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyOverlayAdapterService, deps: [{ token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
2665
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyOverlayAdapterService, providedIn: 'root' }); }
|
2666
|
-
}
|
2667
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyOverlayAdapterService, decorators: [{
|
2668
|
-
type: Injectable,
|
2669
|
-
args: [{
|
2670
|
-
providedIn: 'root',
|
2671
|
-
}]
|
2672
|
-
}], ctorParameters: function () { return [{ type: i0.RendererFactory2 }]; } });
|
2673
|
-
|
2674
2681
|
/**
|
2675
2682
|
* This service is used to create new overlays.
|
2676
2683
|
* @internal
|
@@ -2679,8 +2686,11 @@ class SkyOverlayService {
|
|
2679
2686
|
static { this.overlays = []; }
|
2680
2687
|
#adapter = inject(SkyOverlayAdapterService);
|
2681
2688
|
#applicationRef = inject(ApplicationRef);
|
2682
|
-
#dynamicComponentSvc
|
2689
|
+
#dynamicComponentSvc;
|
2683
2690
|
#environmentInjector = inject(EnvironmentInjector);
|
2691
|
+
constructor(dynamicComponentSvc) {
|
2692
|
+
this.#dynamicComponentSvc = dynamicComponentSvc;
|
2693
|
+
}
|
2684
2694
|
/**
|
2685
2695
|
* Creates an empty overlay. Use the returned `SkyOverlayInstance` to append content.
|
2686
2696
|
* @param config Configuration for the overlay.
|
@@ -2764,7 +2774,7 @@ class SkyOverlayService {
|
|
2764
2774
|
}
|
2765
2775
|
}
|
2766
2776
|
}
|
2767
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyOverlayService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
2777
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyOverlayService, deps: [{ token: SkyDynamicComponentService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
2768
2778
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyOverlayService, providedIn: 'root' }); }
|
2769
2779
|
}
|
2770
2780
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyOverlayService, decorators: [{
|
@@ -2772,7 +2782,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImpor
|
|
2772
2782
|
args: [{
|
2773
2783
|
providedIn: 'root',
|
2774
2784
|
}]
|
2775
|
-
}] });
|
2785
|
+
}], ctorParameters: function () { return [{ type: SkyDynamicComponentService }]; } });
|
2786
|
+
/**
|
2787
|
+
* This service is used to create new overlays.
|
2788
|
+
* @internal
|
2789
|
+
* @deprecated Use `SkyOverlayService` to open a standalone component instead.
|
2790
|
+
*/
|
2791
|
+
class SkyOverlayLegacyService extends SkyOverlayService {
|
2792
|
+
/* istanbul ignore next */
|
2793
|
+
constructor(dynamicComponentSvc) {
|
2794
|
+
super(dynamicComponentSvc);
|
2795
|
+
}
|
2796
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyOverlayLegacyService, deps: [{ token: SkyDynamicComponentLegacyService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
2797
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyOverlayLegacyService, providedIn: 'any' }); }
|
2798
|
+
}
|
2799
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyOverlayLegacyService, decorators: [{
|
2800
|
+
type: Injectable,
|
2801
|
+
args: [{
|
2802
|
+
providedIn: 'any',
|
2803
|
+
}]
|
2804
|
+
}], ctorParameters: function () { return [{ type: SkyDynamicComponentLegacyService }]; } });
|
2776
2805
|
|
2777
2806
|
class SkyPercentPipe {
|
2778
2807
|
get defaultLocale() {
|
@@ -3280,7 +3309,7 @@ class SkyAppTitleService {
|
|
3280
3309
|
this.#title.setTitle(args.titleParts.join(' - '));
|
3281
3310
|
}
|
3282
3311
|
}
|
3283
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyAppTitleService, deps: [{ token: i1$
|
3312
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyAppTitleService, deps: [{ token: i1$2.Title }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
3284
3313
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyAppTitleService, providedIn: 'root' }); }
|
3285
3314
|
}
|
3286
3315
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SkyAppTitleService, decorators: [{
|
@@ -3288,7 +3317,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImpor
|
|
3288
3317
|
args: [{
|
3289
3318
|
providedIn: 'root',
|
3290
3319
|
}]
|
3291
|
-
}], ctorParameters: function () { return [{ type: i1$
|
3320
|
+
}], ctorParameters: function () { return [{ type: i1$2.Title }]; } });
|
3292
3321
|
|
3293
3322
|
/**
|
3294
3323
|
* Trims whitespace in each text node that is a direct descendent of the current element.
|
@@ -3849,5 +3878,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImpor
|
|
3849
3878
|
* Generated bundle index. Do not edit.
|
3850
3879
|
*/
|
3851
3880
|
|
3852
|
-
export { NumericOptions, SKY_LOG_LEVEL, SKY_STACKING_CONTEXT, SkyAffixAutoFitContext, SkyAffixModule, SkyAffixService, SkyAffixer, SkyAppFormat, SkyAppTitleService, SkyAppWindowRef, SkyCoreAdapterModule, SkyCoreAdapterService, SkyDefaultInputProvider, SkyDockItem, SkyDockLocation, SkyDockModule, SkyDockService, SkyDynamicComponentLocation, SkyDynamicComponentModule, SkyDynamicComponentService, SkyIdModule, SkyIdService, SkyLayoutHostService, SkyLiveAnnouncerService, SkyLogModule, SkyLogService, SkyMediaBreakpoints, SkyMediaQueryModule, SkyMediaQueryService, SkyMutationObserverService, SkyNumericModule, SkyNumericPipe, SkyNumericService, SkyOverlayInstance, SkyOverlayModule, SkyOverlayService, SkyPercentPipe, SkyPercentPipeModule, SkyResizeObserverMediaQueryService, SkyResizeObserverService, SkyScrollableHostService, SkyTrimModule, SkyUIConfigService, SkyViewkeeperHostOptions, SkyViewkeeperModule, SkyViewkeeperService, SkyAffixDirective as λ1, SkyIdDirective as λ2, SkyViewkeeperDirective as λ3, SkyTrimDirective as λ4 };
|
3881
|
+
export { NumericOptions, SKY_LOG_LEVEL, SKY_STACKING_CONTEXT, SkyAffixAutoFitContext, SkyAffixModule, SkyAffixService, SkyAffixer, SkyAppFormat, SkyAppTitleService, SkyAppWindowRef, SkyCoreAdapterModule, SkyCoreAdapterService, SkyDefaultInputProvider, SkyDockItem, SkyDockLocation, SkyDockModule, SkyDockService, SkyDynamicComponentLegacyService, SkyDynamicComponentLocation, SkyDynamicComponentModule, SkyDynamicComponentService, SkyIdModule, SkyIdService, SkyLayoutHostService, SkyLiveAnnouncerService, SkyLogModule, SkyLogService, SkyMediaBreakpoints, SkyMediaQueryModule, SkyMediaQueryService, SkyMutationObserverService, SkyNumericModule, SkyNumericPipe, SkyNumericService, SkyOverlayInstance, SkyOverlayLegacyService, SkyOverlayModule, SkyOverlayService, SkyPercentPipe, SkyPercentPipeModule, SkyResizeObserverMediaQueryService, SkyResizeObserverService, SkyScrollableHostService, SkyTrimModule, SkyUIConfigService, SkyViewkeeperHostOptions, SkyViewkeeperModule, SkyViewkeeperService, SkyAffixDirective as λ1, SkyIdDirective as λ2, SkyViewkeeperDirective as λ3, SkyTrimDirective as λ4 };
|
3853
3882
|
//# sourceMappingURL=skyux-core.mjs.map
|