@skyux/modals 5.5.0 → 5.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/skyux-modals.umd.js +24 -25
- package/documentation.json +70 -302
- package/esm2015/lib/modules/confirm/confirm-config.js.map +1 -1
- package/esm2015/lib/modules/confirm/confirm-modal-context.js.map +1 -1
- package/esm2015/lib/modules/confirm/confirm.component.js +1 -1
- package/esm2015/lib/modules/confirm/confirm.component.js.map +1 -1
- package/esm2015/lib/modules/confirm/confirm.module.js +1 -1
- package/esm2015/lib/modules/confirm/confirm.module.js.map +1 -1
- package/esm2015/lib/modules/confirm/confirm.service.js +1 -1
- package/esm2015/lib/modules/confirm/confirm.service.js.map +1 -1
- package/esm2015/lib/modules/modal/modal-adapter.service.js.map +1 -1
- package/esm2015/lib/modules/modal/modal-close-args.js +0 -1
- package/esm2015/lib/modules/modal/modal-close-args.js.map +1 -1
- package/esm2015/lib/modules/modal/modal-component-adapter.service.js +11 -11
- package/esm2015/lib/modules/modal/modal-component-adapter.service.js.map +1 -1
- package/esm2015/lib/modules/modal/modal-configuration.js +0 -1
- package/esm2015/lib/modules/modal/modal-configuration.js.map +1 -1
- package/esm2015/lib/modules/modal/modal-host.component.js +3 -3
- package/esm2015/lib/modules/modal/modal-host.component.js.map +1 -1
- package/esm2015/lib/modules/modal/modal-host.service.js +1 -1
- package/esm2015/lib/modules/modal/modal-host.service.js.map +1 -1
- package/esm2015/lib/modules/modal/modal-instance.js +1 -1
- package/esm2015/lib/modules/modal/modal-instance.js.map +1 -1
- package/esm2015/lib/modules/modal/modal-scroll-shadow.directive.js +3 -3
- package/esm2015/lib/modules/modal/modal-scroll-shadow.directive.js.map +1 -1
- package/esm2015/lib/modules/modal/modal.component.js +6 -6
- package/esm2015/lib/modules/modal/modal.component.js.map +1 -1
- package/esm2015/lib/modules/modal/modal.module.js +1 -1
- package/esm2015/lib/modules/modal/modal.module.js.map +1 -1
- package/esm2015/lib/modules/modal/modal.service.js +4 -4
- package/esm2015/lib/modules/modal/modal.service.js.map +1 -1
- package/esm2015/lib/modules/shared/sky-modals-resources.module.js +1 -1
- package/esm2015/lib/modules/shared/sky-modals-resources.module.js.map +1 -1
- package/fesm2015/skyux-modals.js +40 -42
- package/fesm2015/skyux-modals.js.map +1 -1
- package/lib/modules/confirm/confirm-config.d.ts +1 -1
- package/lib/modules/modal/modal-close-args.d.ts +0 -1
- package/lib/modules/modal/modal-instance.d.ts +1 -1
- package/lib/modules/modal/modal-scroll-shadow.directive.d.ts +1 -1
- package/lib/modules/modal/modal.component.d.ts +2 -2
- package/package.json +14 -13
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
1
|
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { NgModule } from '@angular/core';
|
|
3
3
|
import { RouterModule } from '@angular/router';
|
|
4
4
|
import { SkyIconModule } from '@skyux/indicators';
|
|
5
5
|
import { SkyThemeModule } from '@skyux/theme';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/modals/src/lib/modules/modal/modal.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"modal.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/modals/src/lib/modules/modal/modal.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAEjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;;AA0BtD,MAAM,OAAO,cAAc;;4GAAd,cAAc;6GAAd,cAAc,iBAtBvB,iBAAiB;QACjB,wBAAwB;QACxB,uBAAuB;QACvB,uBAAuB;QACvB,qBAAqB;QACrB,6BAA6B,aAG7B,YAAY;QACZ,YAAY;QACZ,aAAa;QACb,wBAAwB;QACxB,cAAc,aAGd,iBAAiB;QACjB,wBAAwB;QACxB,uBAAuB;QACvB,uBAAuB;6GAId,cAAc,YAfhB;YACP,YAAY;YACZ,YAAY;YACZ,aAAa;YACb,wBAAwB;YACxB,cAAc;SACf;4FASU,cAAc;kBAxB1B,QAAQ;mBAAC;oBACR,YAAY,EAAE;wBACZ,iBAAiB;wBACjB,wBAAwB;wBACxB,uBAAuB;wBACvB,uBAAuB;wBACvB,qBAAqB;wBACrB,6BAA6B;qBAC9B;oBACD,OAAO,EAAE;wBACP,YAAY;wBACZ,YAAY;wBACZ,aAAa;wBACb,wBAAwB;wBACxB,cAAc;qBACf;oBACD,OAAO,EAAE;wBACP,iBAAiB;wBACjB,wBAAwB;wBACxB,uBAAuB;wBACvB,uBAAuB;qBACxB;oBACD,eAAe,EAAE,CAAC,qBAAqB,CAAC;iBACzC","sourcesContent":["import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SkyIconModule } from '@skyux/indicators';\nimport { SkyThemeModule } from '@skyux/theme';\n\nimport { SkyModalsResourcesModule } from '../shared/sky-modals-resources.module';\n\nimport { SkyModalContentComponent } from './modal-content.component';\nimport { SkyModalFooterComponent } from './modal-footer.component';\nimport { SkyModalHeaderComponent } from './modal-header.component';\nimport { SkyModalHostComponent } from './modal-host.component';\nimport { SkyModalScrollShadowDirective } from './modal-scroll-shadow.directive';\nimport { SkyModalComponent } from './modal.component';\n\n@NgModule({\n declarations: [\n SkyModalComponent,\n SkyModalContentComponent,\n SkyModalFooterComponent,\n SkyModalHeaderComponent,\n SkyModalHostComponent,\n SkyModalScrollShadowDirective,\n ],\n imports: [\n CommonModule,\n RouterModule,\n SkyIconModule,\n SkyModalsResourcesModule,\n SkyThemeModule,\n ],\n exports: [\n SkyModalComponent,\n SkyModalContentComponent,\n SkyModalFooterComponent,\n SkyModalHeaderComponent,\n ],\n entryComponents: [SkyModalHostComponent],\n})\nexport class SkyModalModule {}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core';
|
|
2
2
|
import { SkyDynamicComponentService } from '@skyux/core';
|
|
3
|
-
import { SkyModalInstance } from './modal-instance';
|
|
4
3
|
import { SkyModalHostComponent } from './modal-host.component';
|
|
4
|
+
import { SkyModalInstance } from './modal-instance';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
import * as i1 from "@skyux/core";
|
|
7
7
|
/**
|
|
@@ -31,9 +31,9 @@ export class SkyModalService {
|
|
|
31
31
|
* @param {SkyModalConfigurationInterface} config Populates the modal based on the `SkyModalConfigurationInterface` object.
|
|
32
32
|
*/
|
|
33
33
|
open(component, config) {
|
|
34
|
-
|
|
34
|
+
const modalInstance = new SkyModalInstance();
|
|
35
35
|
this.createHostComponent();
|
|
36
|
-
|
|
36
|
+
const params = this.getConfigFromParameter(config);
|
|
37
37
|
params.providers.push({
|
|
38
38
|
provide: SkyModalInstance,
|
|
39
39
|
useValue: modalInstance,
|
|
@@ -42,7 +42,7 @@ export class SkyModalService {
|
|
|
42
42
|
return modalInstance;
|
|
43
43
|
}
|
|
44
44
|
getConfigFromParameter(providersOrConfig) {
|
|
45
|
-
|
|
45
|
+
const defaultParams = {
|
|
46
46
|
providers: [],
|
|
47
47
|
fullPage: false,
|
|
48
48
|
size: 'medium',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/modals/src/lib/modules/modal/modal.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"modal.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/modals/src/lib/modules/modal/modal.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,UAAU,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;;;AAGpD;;;;GAIG;AAOH,MAAM,OAAO,eAAe;IAG1B,wFAAwF;IACxF,uCAAuC;IACvC,YAAoB,uBAAoD;QAApD,4BAAuB,GAAvB,uBAAuB,CAA6B;IAAG,CAAC;IAE5E;;;OAGG;IACI,OAAO;QACZ,IAAI,eAAe,CAAC,IAAI,EAAE;YACxB,IAAI,CAAC,uBAAuB,CAAC,eAAe,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;YACnE,eAAe,CAAC,IAAI,GAAG,SAAS,CAAC;SAClC;IACH,CAAC;IAED;;;;OAIG;IACI,IAAI,CACT,SAAc,EACd,MAA+C;QAE/C,MAAM,aAAa,GAAG,IAAI,gBAAgB,EAAE,CAAC;QAC7C,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC;QAEnD,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC;YACpB,OAAO,EAAE,gBAAgB;YACzB,QAAQ,EAAE,aAAa;SACxB,CAAC,CAAC;QAEH,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QAErE,OAAO,aAAa,CAAC;IACvB,CAAC;IAEO,sBAAsB,CAC5B,iBAAsB;QAEtB,MAAM,aAAa,GAAmC;YACpD,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,KAAK;YACf,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,KAAK;SACjB,CAAC;QACF,IAAI,MAAM,GAAmC,SAAS,CAAC;QACvD,IAAI,MAAM,GAAQ,SAAS,CAAC;QAE5B,qDAAqD;QACrD,MAAM,GAAG;YACP,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,aAAa,EAAE;gBAC7C,SAAS,EAAE,iBAAiB;aAC7B,CAAC;YACF,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,aAAa,EAAE,iBAAiB,CAAC;SAC5D,CAAC;QAEF,IAAI,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,EAAE;YAC7C,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;SAC/B;aAAM;YACL,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;SAC3B;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAEO,mBAAmB;QACzB,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE;YACzB,eAAe,CAAC,IAAI,GAAG,IAAI,CAAC,uBAAuB,CAAC,eAAe,CACjE,qBAAqB,CACtB,CAAC;SACH;IACH,CAAC;;6GA5EU,eAAe;iHAAf,eAAe,cAFd,KAAK;4FAEN,eAAe;kBAN3B,UAAU;mBAAC;oBACV,gGAAgG;oBAChG,8FAA8F;oBAC9F,2FAA2F;oBAC3F,UAAU,EAAE,KAAK;iBAClB","sourcesContent":["import { ComponentRef, Injectable } from '@angular/core';\nimport { SkyDynamicComponentService } from '@skyux/core';\n\nimport { SkyModalHostComponent } from './modal-host.component';\nimport { SkyModalInstance } from './modal-instance';\nimport { SkyModalConfigurationInterface } from './modal.interface';\n\n/**\n * A service that lauches modals. For information about how to test modals in SKY UX, see\n * [write unit tests for modals](https://developer.blackbaud.com/skyux/learn/get-started/advanced/unit-test-modals).\n * @dynamic\n */\n@Injectable({\n // Must be 'any' so that the modal component is created in the context of its module's injector.\n // If set to 'root', the component's dependency injections would only be derived from the root\n // injector and may loose context if the modal was opened from within a lazy-loaded module.\n providedIn: 'any',\n})\nexport class SkyModalService {\n private static host: ComponentRef<SkyModalHostComponent>;\n\n // TODO: In future breaking change - remove extra parameters as they are no longer used.\n /* tslint:disable:no-unused-variable */\n constructor(private dynamicComponentService?: SkyDynamicComponentService) {}\n\n /**\n * @private\n * Removes the modal host from the DOM.\n */\n public dispose(): void {\n if (SkyModalService.host) {\n this.dynamicComponentService.removeComponent(SkyModalService.host);\n SkyModalService.host = undefined;\n }\n }\n\n /**\n * Opens a modal using the specified component.\n * @param component Determines the component to render.\n * @param {SkyModalConfigurationInterface} config Populates the modal based on the `SkyModalConfigurationInterface` object.\n */\n public open(\n component: any,\n config?: SkyModalConfigurationInterface | any[]\n ): SkyModalInstance {\n const modalInstance = new SkyModalInstance();\n this.createHostComponent();\n const params = this.getConfigFromParameter(config);\n\n params.providers.push({\n provide: SkyModalInstance,\n useValue: modalInstance,\n });\n\n SkyModalService.host.instance.open(modalInstance, component, params);\n\n return modalInstance;\n }\n\n private getConfigFromParameter(\n providersOrConfig: any\n ): SkyModalConfigurationInterface {\n const defaultParams: SkyModalConfigurationInterface = {\n providers: [],\n fullPage: false,\n size: 'medium',\n tiledBody: false,\n };\n let params: SkyModalConfigurationInterface = undefined;\n let method: any = undefined;\n\n // Object Literal Lookup for backwards compatability.\n method = {\n 'providers?': Object.assign({}, defaultParams, {\n providers: providersOrConfig,\n }),\n config: Object.assign({}, defaultParams, providersOrConfig),\n };\n\n if (Array.isArray(providersOrConfig) === true) {\n params = method['providers?'];\n } else {\n params = method['config'];\n }\n\n return params;\n }\n\n private createHostComponent(): void {\n if (!SkyModalService.host) {\n SkyModalService.host = this.dynamicComponentService.createComponent(\n SkyModalHostComponent\n );\n }\n }\n}\n"]}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* To update this file, simply rerun the command.
|
|
6
6
|
*/
|
|
7
7
|
import { NgModule } from '@angular/core';
|
|
8
|
-
import {
|
|
8
|
+
import { SKY_LIB_RESOURCES_PROVIDERS, SkyI18nModule, getLibStringForLocale, } from '@skyux/i18n';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
10
|
const RESOURCES = {
|
|
11
11
|
'EN-US': {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sky-modals-resources.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/modals/src/lib/modules/shared/sky-modals-resources.module.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"sky-modals-resources.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/modals/src/lib/modules/shared/sky-modals-resources.module.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACL,2BAA2B,EAE3B,aAAa,EAGb,qBAAqB,GACtB,MAAM,aAAa,CAAC;;AAErB,MAAM,SAAS,GAA0C;IACvD,OAAO,EAAE;QACP,oCAAoC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QACvD,qCAAqC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;QACzD,oCAAoC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QACvD,wCAAwC,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC/D,iBAAiB,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;QAC7C,qBAAqB,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE;QAC/C,gCAAgC,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QACvD,iCAAiC,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;KACvD;CACF,CAAC;AAEF,MAAM,OAAO,0BAA0B;IAC9B,SAAS,CAAC,UAA4B,EAAE,IAAY;QACzD,OAAO,qBAAqB,CAAC,SAAS,EAAE,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACnE,CAAC;CACF;AAED;;GAEG;AAWH,MAAM,OAAO,wBAAwB;;sHAAxB,wBAAwB;uHAAxB,wBAAwB,YATzB,aAAa;uHASZ,wBAAwB,aARxB;QACT;YACE,OAAO,EAAE,2BAA2B;YACpC,QAAQ,EAAE,0BAA0B;YACpC,KAAK,EAAE,IAAI;SACZ;KACF,YAPS,aAAa;4FASZ,wBAAwB;kBAVpC,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,aAAa,CAAC;oBACxB,SAAS,EAAE;wBACT;4BACE,OAAO,EAAE,2BAA2B;4BACpC,QAAQ,EAAE,0BAA0B;4BACpC,KAAK,EAAE,IAAI;yBACZ;qBACF;iBACF","sourcesContent":["/**\n * NOTICE: DO NOT MODIFY THIS FILE!\n * The contents of this file were automatically generated by\n * the 'ng generate @skyux/i18n:lib-resources-module modules/shared/sky-modals' schematic.\n * To update this file, simply rerun the command.\n */\nimport { NgModule } from '@angular/core';\nimport {\n SKY_LIB_RESOURCES_PROVIDERS,\n SkyAppLocaleInfo,\n SkyI18nModule,\n SkyLibResources,\n SkyLibResourcesProvider,\n getLibStringForLocale,\n} from '@skyux/i18n';\n\nconst RESOURCES: { [locale: string]: SkyLibResources } = {\n 'EN-US': {\n skyux_confirm_dialog_default_ok_text: { message: 'OK' },\n skyux_confirm_dialog_default_yes_text: { message: 'Yes' },\n skyux_confirm_dialog_default_no_text: { message: 'No' },\n skyux_confirm_dialog_default_cancel_text: { message: 'Cancel' },\n skyux_modal_close: { message: 'Close modal' },\n skyux_modal_open_help: { message: 'Open Help' },\n skyux_modal_footer_cancel_button: { message: 'Cancel' },\n skyux_modal_footer_primary_button: { message: 'Save' },\n },\n};\n\nexport class SkyModalsResourcesProvider implements SkyLibResourcesProvider {\n public getString(localeInfo: SkyAppLocaleInfo, name: string): string {\n return getLibStringForLocale(RESOURCES, localeInfo.locale, name);\n }\n}\n\n/**\n * Import into any component library module that needs to use resource strings.\n */\n@NgModule({\n exports: [SkyI18nModule],\n providers: [\n {\n provide: SKY_LIB_RESOURCES_PROVIDERS,\n useClass: SkyModalsResourcesProvider,\n multi: true,\n },\n ],\n})\nexport class SkyModalsResourcesModule {}\n"]}
|
package/fesm2015/skyux-modals.js
CHANGED
|
@@ -199,6 +199,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
199
199
|
type: Injectable
|
|
200
200
|
}], ctorParameters: function () { return [{ type: i3.SkyAppWindowRef }]; } });
|
|
201
201
|
|
|
202
|
+
/**
|
|
203
|
+
* @internal
|
|
204
|
+
*/
|
|
205
|
+
class SkyModalConfiguration {
|
|
206
|
+
constructor() {
|
|
207
|
+
this.size = 'medium';
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
SkyModalConfiguration.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyModalConfiguration, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
211
|
+
SkyModalConfiguration.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyModalConfiguration, providedIn: 'any' });
|
|
212
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyModalConfiguration, decorators: [{
|
|
213
|
+
type: Injectable,
|
|
214
|
+
args: [{
|
|
215
|
+
providedIn: 'any',
|
|
216
|
+
}]
|
|
217
|
+
}], ctorParameters: function () { return []; } });
|
|
218
|
+
|
|
202
219
|
/**
|
|
203
220
|
* @internal
|
|
204
221
|
* @dynamic
|
|
@@ -214,7 +231,7 @@ class SkyModalHostService {
|
|
|
214
231
|
return SkyModalHostService.modalHosts.length;
|
|
215
232
|
}
|
|
216
233
|
static get fullPageModalCount() {
|
|
217
|
-
|
|
234
|
+
const fullPageModals = SkyModalHostService.modalHosts.filter((modal) => modal.fullPage);
|
|
218
235
|
return fullPageModals.length;
|
|
219
236
|
}
|
|
220
237
|
static get BASE_Z_INDEX() {
|
|
@@ -252,24 +269,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
252
269
|
}]
|
|
253
270
|
}], ctorParameters: function () { return []; } });
|
|
254
271
|
|
|
255
|
-
/**
|
|
256
|
-
* @internal
|
|
257
|
-
*/
|
|
258
|
-
class SkyModalConfiguration {
|
|
259
|
-
constructor() {
|
|
260
|
-
this.fullPage = this.fullPage;
|
|
261
|
-
this.size = 'medium';
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
SkyModalConfiguration.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyModalConfiguration, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
265
|
-
SkyModalConfiguration.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyModalConfiguration, providedIn: 'any' });
|
|
266
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyModalConfiguration, decorators: [{
|
|
267
|
-
type: Injectable,
|
|
268
|
-
args: [{
|
|
269
|
-
providedIn: 'any',
|
|
270
|
-
}]
|
|
271
|
-
}], ctorParameters: function () { return []; } });
|
|
272
|
-
|
|
273
272
|
/**
|
|
274
273
|
* @internal
|
|
275
274
|
*/
|
|
@@ -305,12 +304,12 @@ class SkyModalHostComponent {
|
|
|
305
304
|
});
|
|
306
305
|
adapter.setPageScroll(SkyModalHostService.openModalCount > 0);
|
|
307
306
|
adapter.toggleFullPageModalClass(SkyModalHostService.fullPageModalCount > 0);
|
|
308
|
-
|
|
307
|
+
const providers = params.providers || /* istanbul ignore next */ [];
|
|
309
308
|
const injector = Injector.create({
|
|
310
309
|
providers,
|
|
311
310
|
parent: this.injector,
|
|
312
311
|
});
|
|
313
|
-
|
|
312
|
+
const modalComponentRef = this.target.createComponent(factory, undefined, injector);
|
|
314
313
|
modalInstance.componentInstance = modalComponentRef.instance;
|
|
315
314
|
function closeModal() {
|
|
316
315
|
hostService.destroy();
|
|
@@ -483,12 +482,12 @@ class SkyModalComponentAdapterService {
|
|
|
483
482
|
this.coreAdapter = coreAdapter;
|
|
484
483
|
}
|
|
485
484
|
handleWindowChange(modalEl) {
|
|
486
|
-
|
|
487
|
-
|
|
485
|
+
const boundedHeightEl = modalEl.nativeElement.querySelector('.sky-modal');
|
|
486
|
+
const fullPageModalEl = modalEl.nativeElement.querySelector('.sky-modal-full-page');
|
|
488
487
|
/*
|
|
489
488
|
Set modal height equal to max height of window (accounting for padding above and below modal)
|
|
490
489
|
*/
|
|
491
|
-
|
|
490
|
+
const newHeight = window.innerHeight - 40;
|
|
492
491
|
boundedHeightEl.style.maxHeight = newHeight.toString() + 'px';
|
|
493
492
|
if (fullPageModalEl) {
|
|
494
493
|
this.setFullPageHeight(fullPageModalEl);
|
|
@@ -498,27 +497,27 @@ class SkyModalComponentAdapterService {
|
|
|
498
497
|
IE11 doesn't handle flex and max-height correctly so we have to explicitly add
|
|
499
498
|
max-height to the content that accounts for standard header and footer height.
|
|
500
499
|
*/
|
|
501
|
-
|
|
502
|
-
|
|
500
|
+
const modalContentEl = modalEl.nativeElement.querySelector('.sky-modal-content');
|
|
501
|
+
const contentHeight = newHeight - 114;
|
|
503
502
|
modalContentEl.style.maxHeight = contentHeight.toString() + 'px';
|
|
504
503
|
}
|
|
505
504
|
}
|
|
506
505
|
isFocusInFirstItem(event, list) {
|
|
507
506
|
/* istanbul ignore next */
|
|
508
507
|
/* sanity check */
|
|
509
|
-
|
|
508
|
+
const eventTarget = event.target || event.srcElement;
|
|
510
509
|
return list.length > 0 && eventTarget === list[0];
|
|
511
510
|
}
|
|
512
511
|
isFocusInLastItem(event, list) {
|
|
513
512
|
/* istanbul ignore next */
|
|
514
513
|
/* sanity check */
|
|
515
|
-
|
|
514
|
+
const eventTarget = event.target || event.srcElement;
|
|
516
515
|
return list.length > 0 && eventTarget === list[list.length - 1];
|
|
517
516
|
}
|
|
518
517
|
isModalFocused(event, modalEl) {
|
|
519
518
|
/* istanbul ignore next */
|
|
520
519
|
/* sanity check */
|
|
521
|
-
|
|
520
|
+
const eventTarget = event.target || event.srcElement;
|
|
522
521
|
return (modalEl &&
|
|
523
522
|
eventTarget === modalEl.nativeElement.querySelector('.sky-modal-dialog'));
|
|
524
523
|
}
|
|
@@ -541,9 +540,9 @@ class SkyModalComponentAdapterService {
|
|
|
541
540
|
/* handle the case where somehow there is a focused element already in the modal */
|
|
542
541
|
if (!(document.activeElement &&
|
|
543
542
|
modalEl.nativeElement.contains(document.activeElement))) {
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
543
|
+
const currentScrollX = window.pageXOffset;
|
|
544
|
+
const currentScrollY = window.pageYOffset;
|
|
545
|
+
const inputWithAutofocus = modalEl.nativeElement.querySelector('[autofocus]');
|
|
547
546
|
if (inputWithAutofocus) {
|
|
548
547
|
inputWithAutofocus.focus();
|
|
549
548
|
}
|
|
@@ -645,7 +644,7 @@ class SkyModalComponent {
|
|
|
645
644
|
/* istanbul ignore else */
|
|
646
645
|
/* sanity check */
|
|
647
646
|
if (SkyModalHostService.openModalCount > 0) {
|
|
648
|
-
|
|
647
|
+
const topModal = SkyModalHostService.topModal;
|
|
649
648
|
if (topModal && topModal === this.hostService) {
|
|
650
649
|
if (event.which === 27) {
|
|
651
650
|
// Escape key up
|
|
@@ -659,12 +658,12 @@ class SkyModalComponent {
|
|
|
659
658
|
/* istanbul ignore else */
|
|
660
659
|
/* sanity check */
|
|
661
660
|
if (SkyModalHostService.openModalCount > 0) {
|
|
662
|
-
|
|
661
|
+
const topModal = SkyModalHostService.topModal;
|
|
663
662
|
if (topModal && topModal === this.hostService) {
|
|
664
663
|
if (event.which === 9) {
|
|
665
664
|
// Tab pressed
|
|
666
665
|
let focusChanged = false;
|
|
667
|
-
|
|
666
|
+
const focusElementList = this.coreAdapter.getFocusableChildren(this.elRef.nativeElement);
|
|
668
667
|
if (event.shiftKey &&
|
|
669
668
|
(this.componentAdapter.isFocusInFirstItem(event, focusElementList) ||
|
|
670
669
|
this.componentAdapter.isModalFocused(event, this.elRef))) {
|
|
@@ -796,10 +795,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
796
795
|
}]
|
|
797
796
|
}] });
|
|
798
797
|
|
|
799
|
-
class SkyModalCloseArgs {
|
|
800
|
-
constructor() { }
|
|
801
|
-
}
|
|
802
|
-
|
|
803
798
|
class SkyModalBeforeCloseHandler {
|
|
804
799
|
constructor(closeModal, closeArgs) {
|
|
805
800
|
this.closeModal = closeModal;
|
|
@@ -807,6 +802,9 @@ class SkyModalBeforeCloseHandler {
|
|
|
807
802
|
}
|
|
808
803
|
}
|
|
809
804
|
|
|
805
|
+
class SkyModalCloseArgs {
|
|
806
|
+
}
|
|
807
|
+
|
|
810
808
|
// TODO: this class won't show in the generated docs until this work is done:
|
|
811
809
|
// https://github.com/blackbaud/skyux-docs-tools/issues/30
|
|
812
810
|
/**
|
|
@@ -1077,9 +1075,9 @@ class SkyModalService {
|
|
|
1077
1075
|
* @param {SkyModalConfigurationInterface} config Populates the modal based on the `SkyModalConfigurationInterface` object.
|
|
1078
1076
|
*/
|
|
1079
1077
|
open(component, config) {
|
|
1080
|
-
|
|
1078
|
+
const modalInstance = new SkyModalInstance();
|
|
1081
1079
|
this.createHostComponent();
|
|
1082
|
-
|
|
1080
|
+
const params = this.getConfigFromParameter(config);
|
|
1083
1081
|
params.providers.push({
|
|
1084
1082
|
provide: SkyModalInstance,
|
|
1085
1083
|
useValue: modalInstance,
|
|
@@ -1088,7 +1086,7 @@ class SkyModalService {
|
|
|
1088
1086
|
return modalInstance;
|
|
1089
1087
|
}
|
|
1090
1088
|
getConfigFromParameter(providersOrConfig) {
|
|
1091
|
-
|
|
1089
|
+
const defaultParams = {
|
|
1092
1090
|
providers: [],
|
|
1093
1091
|
fullPage: false,
|
|
1094
1092
|
size: 'medium',
|