@skyux/modals 8.7.2 → 9.0.0-alpha.1
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 +56 -56
- package/esm2022/lib/modules/confirm/confirm.component.mjs +112 -0
- package/{esm2020 → esm2022}/lib/modules/confirm/confirm.module.mjs +13 -13
- package/esm2022/lib/modules/confirm/confirm.service.mjs +54 -0
- package/esm2022/lib/modules/modal/modal-adapter.service.mjs +99 -0
- package/esm2022/lib/modules/modal/modal-component-adapter.service.mjs +101 -0
- package/{esm2020 → esm2022}/lib/modules/modal/modal-configuration.mjs +4 -4
- package/{esm2020 → esm2022}/lib/modules/modal/modal-content.component.mjs +4 -4
- package/esm2022/lib/modules/modal/modal-errors.service.mjs +21 -0
- package/{esm2020 → esm2022}/lib/modules/modal/modal-footer.component.mjs +4 -4
- package/{esm2020 → esm2022}/lib/modules/modal/modal-header.component.mjs +4 -4
- package/{esm2020 → esm2022}/lib/modules/modal/modal-host-context.mjs +4 -4
- package/esm2022/lib/modules/modal/modal-host.component.mjs +163 -0
- package/esm2022/lib/modules/modal/modal-host.service.mjs +62 -0
- package/esm2022/lib/modules/modal/modal-instance.mjs +123 -0
- package/esm2022/lib/modules/modal/modal-is-dirty.directive.mjs +94 -0
- package/esm2022/lib/modules/modal/modal-scroll-shadow.directive.mjs +129 -0
- package/esm2022/lib/modules/modal/modal.component.mjs +229 -0
- package/{esm2020 → esm2022}/lib/modules/modal/modal.module.mjs +29 -29
- package/esm2022/lib/modules/modal/modal.service.mjs +97 -0
- package/esm2022/lib/modules/shared/sky-modals-resources.module.mjs +61 -0
- package/esm2022/testing/confirm/confirm-button-harness.mjs +46 -0
- package/esm2022/testing/confirm/confirm-harness.mjs +90 -0
- package/esm2022/testing/modal/modal-harness.mjs +75 -0
- package/esm2022/testing/modal-fixture.mjs +143 -0
- package/{fesm2020 → fesm2022}/skyux-modals-testing.mjs +60 -73
- package/{fesm2020 → fesm2022}/skyux-modals-testing.mjs.map +1 -1
- package/fesm2022/skyux-modals.mjs +1502 -0
- package/{fesm2015 → fesm2022}/skyux-modals.mjs.map +1 -1
- package/lib/modules/modal/modal-is-dirty.directive.d.ts +1 -1
- package/lib/modules/modal/modal.component.d.ts +1 -1
- package/package.json +16 -24
- package/esm2020/lib/modules/confirm/confirm.component.mjs +0 -114
- package/esm2020/lib/modules/confirm/confirm.service.mjs +0 -57
- package/esm2020/lib/modules/modal/modal-adapter.service.mjs +0 -101
- package/esm2020/lib/modules/modal/modal-component-adapter.service.mjs +0 -104
- package/esm2020/lib/modules/modal/modal-errors.service.mjs +0 -24
- package/esm2020/lib/modules/modal/modal-host.component.mjs +0 -164
- package/esm2020/lib/modules/modal/modal-host.service.mjs +0 -65
- package/esm2020/lib/modules/modal/modal-instance.mjs +0 -127
- package/esm2020/lib/modules/modal/modal-is-dirty.directive.mjs +0 -93
- package/esm2020/lib/modules/modal/modal-scroll-shadow.directive.mjs +0 -127
- package/esm2020/lib/modules/modal/modal.component.mjs +0 -228
- package/esm2020/lib/modules/modal/modal.service.mjs +0 -99
- package/esm2020/lib/modules/shared/sky-modals-resources.module.mjs +0 -61
- package/esm2020/testing/confirm/confirm-button-harness.mjs +0 -46
- package/esm2020/testing/confirm/confirm-harness.mjs +0 -97
- package/esm2020/testing/modal/modal-harness.mjs +0 -81
- package/esm2020/testing/modal-fixture.mjs +0 -145
- package/fesm2015/skyux-modals-testing.mjs +0 -409
- package/fesm2015/skyux-modals-testing.mjs.map +0 -1
- package/fesm2015/skyux-modals.mjs +0 -1522
- package/fesm2020/skyux-modals.mjs +0 -1510
- package/fesm2020/skyux-modals.mjs.map +0 -1
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/confirm/confirm-button-action.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/confirm/confirm-button-config.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/confirm/confirm-button-style-type.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/confirm/confirm-button.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/confirm/confirm-closed-event-args.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/confirm/confirm-config-token.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/confirm/confirm-config.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/confirm/confirm-instance.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/confirm/confirm-type.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/modal/modal-before-close-handler.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/modal/modal-close-args.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/modal/modal-error.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/modal/modal-host-context-args.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/modal/modal-scroll-shadow-event-args.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/modal/modal.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/skyux-modals.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/confirm/confirm-button-harness-filters.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/modal/modal-harness-filters.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/skyux-modals-testing.mjs +0 -0
package/documentation.json
CHANGED
|
@@ -4665,54 +4665,54 @@
|
|
|
4665
4665
|
},
|
|
4666
4666
|
"codeExamples": [
|
|
4667
4667
|
{
|
|
4668
|
-
"fileName": "
|
|
4669
|
-
"filePath": "/projects/modals/documentation/code-examples/
|
|
4670
|
-
"rawContents": "
|
|
4668
|
+
"fileName": "modal-demo.module.ts",
|
|
4669
|
+
"filePath": "/projects/modals/documentation/code-examples/modal/modal-demo.module.ts",
|
|
4670
|
+
"rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { SkyInputBoxModule } from '@skyux/forms';\nimport { SkyModalModule } from '@skyux/modals';\n\nimport { ModalDemoModalComponent } from './modal-demo-modal.component';\nimport { ModalDemoComponent } from './modal-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n SkyInputBoxModule,\n SkyModalModule,\n ],\n declarations: [ModalDemoComponent, ModalDemoModalComponent],\n exports: [ModalDemoComponent],\n})\nexport class ModalDemoModule {}\n"
|
|
4671
4671
|
},
|
|
4672
4672
|
{
|
|
4673
|
-
"fileName": "
|
|
4674
|
-
"filePath": "/projects/modals/documentation/code-examples/
|
|
4675
|
-
"rawContents": "import {
|
|
4673
|
+
"fileName": "modal-demo.component.ts",
|
|
4674
|
+
"filePath": "/projects/modals/documentation/code-examples/modal/modal-demo.component.ts",
|
|
4675
|
+
"rawContents": "import { Component, OnDestroy } from '@angular/core';\nimport { SkyWaitService } from '@skyux/indicators';\nimport { SkyModalConfigurationInterface, SkyModalService } from '@skyux/modals';\n\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { ModalDemoContext } from './modal-demo-context';\nimport { ModalDemoData } from './modal-demo-data';\nimport { ModalDemoDataService } from './modal-demo-data.service';\nimport { ModalDemoModalComponent } from './modal-demo-modal.component';\n\n@Component({\n selector: 'app-modal-demo',\n templateUrl: './modal-demo.component.html',\n})\nexport class ModalDemoComponent implements OnDestroy {\n public modalSize = 'medium';\n\n public demoValue: string | null | undefined;\n\n #ngUnsubscribe = new Subject<void>();\n\n #modalSvc: SkyModalService;\n #waitSvc: SkyWaitService;\n #dataSvc: ModalDemoDataService;\n\n constructor(\n modalSvc: SkyModalService,\n waitSvc: SkyWaitService,\n dataSvc: ModalDemoDataService\n ) {\n this.#modalSvc = modalSvc;\n this.#waitSvc = waitSvc;\n this.#dataSvc = dataSvc;\n }\n\n public onOpenModalClick(): void {\n // Display a blocking wait while data is loaded from the data service.\n this.#waitSvc\n .blockingWrap(this.#dataSvc.load())\n .pipe(takeUntil(this.#ngUnsubscribe))\n .subscribe((data) => {\n const options: SkyModalConfigurationInterface = {\n providers: [\n {\n provide: ModalDemoContext,\n useValue: new ModalDemoContext(data),\n },\n ],\n size: this.modalSize,\n };\n\n // Show the modal after data is loaded.\n const instance = this.#modalSvc.open(ModalDemoModalComponent, options);\n\n instance.closed.subscribe((result) => {\n if (result.reason === 'save') {\n // Display the updated value.\n const data = result.data as ModalDemoData;\n this.demoValue = data.value1;\n }\n });\n });\n }\n\n public ngOnDestroy(): void {\n this.#ngUnsubscribe.next();\n this.#ngUnsubscribe.complete();\n }\n}\n"
|
|
4676
4676
|
},
|
|
4677
4677
|
{
|
|
4678
|
-
"fileName": "
|
|
4679
|
-
"filePath": "/projects/modals/documentation/code-examples/
|
|
4680
|
-
"rawContents": "import {
|
|
4678
|
+
"fileName": "modal-demo.component.spec.ts",
|
|
4679
|
+
"filePath": "/projects/modals/documentation/code-examples/modal/modal-demo.component.spec.ts",
|
|
4680
|
+
"rawContents": "import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';\nimport { ComponentFixture, TestBed } from '@angular/core/testing';\nimport { SkyWaitService } from '@skyux/indicators';\nimport { SkyModalService } from '@skyux/modals';\nimport { SkyModalHarness } from '@skyux/modals/testing';\n\nimport { Observable, of } from 'rxjs';\n\nimport { ModalDemoDataService } from './modal-demo-data.service';\nimport { ModalDemoComponent } from './modal-demo.component';\nimport { ModalDemoModule } from './modal-demo.module';\n\nclass mockWaitSvc {\n public blockingWrap(data: unknown): Observable<unknown> {\n return of(data);\n }\n}\n\ndescribe('Basic modal', () => {\n async function setupTest(): Promise<{\n modalHarness: SkyModalHarness;\n fixture: ComponentFixture<ModalDemoComponent>;\n }> {\n const fixture = TestBed.createComponent(ModalDemoComponent);\n fixture.componentInstance.onOpenModalClick();\n fixture.detectChanges();\n\n const loader = TestbedHarnessEnvironment.documentRootLoader(fixture);\n const modalHarness = await loader.getHarness(\n SkyModalHarness.with({\n dataSkyId: 'modal-demo',\n })\n );\n\n return { modalHarness, fixture };\n }\n\n beforeEach(() => {\n TestBed.configureTestingModule({\n imports: [ModalDemoModule],\n providers: [\n SkyModalService,\n { provide: SkyWaitService, useClass: mockWaitSvc },\n ModalDemoDataService,\n ],\n });\n });\n\n it('should open the correct modal', async () => {\n const { modalHarness, fixture } = await setupTest();\n\n fixture.detectChanges();\n\n await expectAsync(modalHarness.getAriaRole()).toBeResolvedTo('dialog');\n await expectAsync(modalHarness.getSize()).toBeResolvedTo('medium');\n await expectAsync(modalHarness.isFullPage()).toBeResolvedTo(false);\n });\n});\n"
|
|
4681
4681
|
},
|
|
4682
4682
|
{
|
|
4683
|
-
"fileName": "
|
|
4684
|
-
"filePath": "/projects/modals/documentation/code-examples/
|
|
4685
|
-
"rawContents": "
|
|
4683
|
+
"fileName": "modal-demo.component.html",
|
|
4684
|
+
"filePath": "/projects/modals/documentation/code-examples/modal/modal-demo.component.html",
|
|
4685
|
+
"rawContents": "<button\n class=\"sky-btn sky-btn-default\"\n type=\"button\"\n (click)=\"onOpenModalClick()\"\n>\n Open modal demo\n</button>\n<div *ngIf=\"demoValue\">The user entered {{ demoValue }}</div>\n"
|
|
4686
4686
|
},
|
|
4687
4687
|
{
|
|
4688
|
-
"fileName": "modal-demo-
|
|
4689
|
-
"filePath": "/projects/modals/documentation/code-examples/
|
|
4690
|
-
"rawContents": "import {
|
|
4688
|
+
"fileName": "modal-demo-modal.component.ts",
|
|
4689
|
+
"filePath": "/projects/modals/documentation/code-examples/modal/modal-demo-modal.component.ts",
|
|
4690
|
+
"rawContents": "import { Component, inject } from '@angular/core';\nimport { FormControl, FormGroup } from '@angular/forms';\nimport { SkyWaitService } from '@skyux/indicators';\nimport { SkyModalInstance } from '@skyux/modals';\n\nimport { ModalDemoContext } from './modal-demo-context';\nimport { ModalDemoDataService } from './modal-demo-data.service';\n\n@Component({\n selector: 'app-modal-demo-modal',\n templateUrl: './modal-demo-modal.component.html',\n})\nexport class ModalDemoModalComponent {\n protected demoForm: FormGroup<{\n value1: FormControl<string | null | undefined>;\n }>;\n\n #instance = inject(SkyModalInstance);\n #waitSvc = inject(SkyWaitService);\n #context = inject(ModalDemoContext);\n #dataSvc = inject(ModalDemoDataService);\n\n constructor() {\n this.demoForm = new FormGroup({\n value1: new FormControl(this.#context.data.value1),\n });\n }\n\n public saveForm(): void {\n // Use the data service to save the data.\n\n this.#waitSvc\n .blockingWrap(this.#dataSvc.save(this.demoForm.value))\n .subscribe((data) => {\n // Notify the modal instance that data was saved and return the saved data.\n this.#instance.save(data);\n });\n }\n\n public cancelForm(): void {\n this.#instance.cancel();\n }\n}\n"
|
|
4691
4691
|
},
|
|
4692
4692
|
{
|
|
4693
|
-
"fileName": "modal-demo-
|
|
4694
|
-
"filePath": "/projects/modals/documentation/code-examples/
|
|
4695
|
-
"rawContents": "
|
|
4693
|
+
"fileName": "modal-demo-modal.component.html",
|
|
4694
|
+
"filePath": "/projects/modals/documentation/code-examples/modal/modal-demo-modal.component.html",
|
|
4695
|
+
"rawContents": "<form [formGroup]=\"demoForm\" (submit)=\"saveForm()\">\n <sky-modal data-sky-id=\"modal-demo\" [isDirty]=\"demoForm.dirty\">\n <sky-modal-header> Modal title </sky-modal-header>\n <sky-modal-content>\n <sky-input-box labelText=\"An input inside a modal\">\n <input formControlName=\"value1\" type=\"text\" />\n </sky-input-box>\n </sky-modal-content>\n <sky-modal-footer>\n <button class=\"sky-btn sky-btn-primary\" type=\"submit\">Save</button>\n <button class=\"sky-btn sky-btn-link\" type=\"button\" (click)=\"cancelForm()\">\n Cancel\n </button>\n </sky-modal-footer>\n </sky-modal>\n</form>\n"
|
|
4696
4696
|
},
|
|
4697
4697
|
{
|
|
4698
4698
|
"fileName": "modal-demo-data.ts",
|
|
4699
|
-
"filePath": "/projects/modals/documentation/code-examples/
|
|
4699
|
+
"filePath": "/projects/modals/documentation/code-examples/modal/modal-demo-data.ts",
|
|
4700
4700
|
"rawContents": "export interface ModalDemoData {\n value1?: string | null;\n}\n"
|
|
4701
4701
|
},
|
|
4702
4702
|
{
|
|
4703
|
-
"fileName": "modal-demo-
|
|
4704
|
-
"filePath": "/projects/modals/documentation/code-examples/
|
|
4705
|
-
"rawContents": "
|
|
4703
|
+
"fileName": "modal-demo-data.service.ts",
|
|
4704
|
+
"filePath": "/projects/modals/documentation/code-examples/modal/modal-demo-data.service.ts",
|
|
4705
|
+
"rawContents": "import { Injectable } from '@angular/core';\n\nimport { Observable, of } from 'rxjs';\nimport { delay } from 'rxjs/operators';\n\nimport { ModalDemoData } from './modal-demo-data';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ModalDemoDataService {\n #data: ModalDemoData = {\n value1: 'Hello world',\n };\n\n public load(): Observable<ModalDemoData> {\n // Simulate a network request to get data.\n return of(this.#data).pipe(delay(1000));\n }\n\n public save(data: ModalDemoData): Observable<ModalDemoData> {\n this.#data = data;\n\n // Simulate a network request to save data.\n return of(this.#data).pipe(delay(1000));\n }\n}\n"
|
|
4706
4706
|
},
|
|
4707
4707
|
{
|
|
4708
|
-
"fileName": "modal-demo-
|
|
4709
|
-
"filePath": "/projects/modals/documentation/code-examples/
|
|
4710
|
-
"rawContents": "import {
|
|
4708
|
+
"fileName": "modal-demo-context.ts",
|
|
4709
|
+
"filePath": "/projects/modals/documentation/code-examples/modal/modal-demo-context.ts",
|
|
4710
|
+
"rawContents": "import { ModalDemoData } from './modal-demo-data';\n\nexport class ModalDemoContext {\n constructor(public data: ModalDemoData) {}\n}\n"
|
|
4711
4711
|
},
|
|
4712
4712
|
{
|
|
4713
|
-
"fileName": "modal-demo.
|
|
4714
|
-
"filePath": "/projects/modals/documentation/code-examples/inline-help/modal-demo.
|
|
4715
|
-
"rawContents": "
|
|
4713
|
+
"fileName": "modal-demo.module.ts",
|
|
4714
|
+
"filePath": "/projects/modals/documentation/code-examples/inline-help/modal-demo.module.ts",
|
|
4715
|
+
"rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { SkyInputBoxModule } from '@skyux/forms';\nimport { SkyHelpInlineModule } from '@skyux/indicators';\nimport { SkyModalModule } from '@skyux/modals';\n\nimport { ModalDemoModalComponent } from './modal-demo-modal.component';\nimport { ModalDemoComponent } from './modal-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n SkyInputBoxModule,\n SkyModalModule,\n SkyHelpInlineModule,\n ],\n declarations: [ModalDemoComponent, ModalDemoModalComponent],\n exports: [ModalDemoComponent],\n})\nexport class ModalDemoModule {}\n"
|
|
4716
4716
|
},
|
|
4717
4717
|
{
|
|
4718
4718
|
"fileName": "modal-demo.component.ts",
|
|
@@ -4720,54 +4720,54 @@
|
|
|
4720
4720
|
"rawContents": "import { Component, OnDestroy } from '@angular/core';\nimport { SkyWaitService } from '@skyux/indicators';\nimport { SkyModalConfigurationInterface, SkyModalService } from '@skyux/modals';\n\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { ModalDemoContext } from './modal-demo-context';\nimport { ModalDemoData } from './modal-demo-data';\nimport { ModalDemoDataService } from './modal-demo-data.service';\nimport { ModalDemoModalComponent } from './modal-demo-modal.component';\n\n@Component({\n selector: 'app-modal-demo',\n templateUrl: './modal-demo.component.html',\n})\nexport class ModalDemoComponent implements OnDestroy {\n public modalSize = 'medium';\n\n public demoValue: string | null | undefined;\n\n #ngUnsubscribe = new Subject<void>();\n\n #modalSvc: SkyModalService;\n #waitSvc: SkyWaitService;\n #dataSvc: ModalDemoDataService;\n\n constructor(\n modalSvc: SkyModalService,\n waitSvc: SkyWaitService,\n dataSvc: ModalDemoDataService\n ) {\n this.#modalSvc = modalSvc;\n this.#waitSvc = waitSvc;\n this.#dataSvc = dataSvc;\n }\n\n public onOpenModalClick(): void {\n // Display a blocking wait while data is loaded from the data service.\n this.#waitSvc\n .blockingWrap(this.#dataSvc.load())\n .pipe(takeUntil(this.#ngUnsubscribe))\n .subscribe((data) => {\n const options: SkyModalConfigurationInterface = {\n providers: [\n {\n provide: ModalDemoContext,\n useValue: new ModalDemoContext(data),\n },\n ],\n size: this.modalSize,\n };\n\n // Show the modal after data is loaded.\n const instance = this.#modalSvc.open(ModalDemoModalComponent, options);\n\n instance.closed.subscribe((result) => {\n if (result.reason === 'save') {\n // Display the updated value.\n const data = result.data as ModalDemoData;\n this.demoValue = data.value1;\n }\n });\n });\n }\n\n public ngOnDestroy(): void {\n this.#ngUnsubscribe.next();\n this.#ngUnsubscribe.complete();\n }\n}\n"
|
|
4721
4721
|
},
|
|
4722
4722
|
{
|
|
4723
|
-
"fileName": "modal-demo.
|
|
4724
|
-
"filePath": "/projects/modals/documentation/code-examples/inline-help/modal-demo.
|
|
4725
|
-
"rawContents": "
|
|
4723
|
+
"fileName": "modal-demo.component.html",
|
|
4724
|
+
"filePath": "/projects/modals/documentation/code-examples/inline-help/modal-demo.component.html",
|
|
4725
|
+
"rawContents": "<button\n class=\"sky-btn sky-btn-default\"\n type=\"button\"\n (click)=\"onOpenModalClick()\"\n>\n Open modal with inline help\n</button>\n"
|
|
4726
4726
|
},
|
|
4727
4727
|
{
|
|
4728
|
-
"fileName": "modal-demo-
|
|
4729
|
-
"filePath": "/projects/modals/documentation/code-examples/
|
|
4730
|
-
"rawContents": "import {
|
|
4728
|
+
"fileName": "modal-demo-modal.component.ts",
|
|
4729
|
+
"filePath": "/projects/modals/documentation/code-examples/inline-help/modal-demo-modal.component.ts",
|
|
4730
|
+
"rawContents": "import { Component } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup } from '@angular/forms';\nimport { SkyWaitService } from '@skyux/indicators';\nimport { SkyModalInstance } from '@skyux/modals';\n\nimport { ModalDemoContext } from './modal-demo-context';\nimport { ModalDemoDataService } from './modal-demo-data.service';\n\n@Component({\n selector: 'app-modal-demo-modal',\n templateUrl: './modal-demo-modal.component.html',\n})\nexport class ModalDemoModalComponent {\n public demoForm: FormGroup<{\n value1: FormControl<string | null | undefined>;\n }>;\n\n #dataSvc: ModalDemoDataService;\n #instance: SkyModalInstance;\n #waitSvc: SkyWaitService;\n\n constructor(\n instance: SkyModalInstance,\n waitSvc: SkyWaitService,\n dataSvc: ModalDemoDataService,\n context: ModalDemoContext,\n fb: FormBuilder\n ) {\n this.#instance = instance;\n this.#waitSvc = waitSvc;\n this.#dataSvc = dataSvc;\n\n const value1 = fb.control(context.data.value1);\n this.demoForm = fb.group({ value1 });\n }\n\n public onActionClick(): void {\n alert('Help inline button clicked!');\n }\n\n public saveForm(): void {\n // Use the data service to save the data.\n\n this.#waitSvc\n .blockingWrap(this.#dataSvc.save(this.demoForm.value))\n .subscribe((data) => {\n // Notify the modal instance that data was saved and return the saved data.\n this.#instance.save(data);\n });\n }\n\n public cancelForm(): void {\n this.#instance.cancel();\n }\n}\n"
|
|
4731
4731
|
},
|
|
4732
4732
|
{
|
|
4733
|
-
"fileName": "modal-demo-
|
|
4734
|
-
"filePath": "/projects/modals/documentation/code-examples/
|
|
4735
|
-
"rawContents": "
|
|
4733
|
+
"fileName": "modal-demo-modal.component.html",
|
|
4734
|
+
"filePath": "/projects/modals/documentation/code-examples/inline-help/modal-demo-modal.component.html",
|
|
4735
|
+
"rawContents": "<form [formGroup]=\"demoForm\" (submit)=\"saveForm()\">\n <sky-modal>\n <sky-modal-header>\n Modal title\n <sky-help-inline\n class=\"sky-control-help\"\n (actionClick)=\"onActionClick()\"\n ></sky-help-inline>\n </sky-modal-header>\n <sky-modal-content>\n <sky-input-box labelText=\"An input inside a modal\">\n <input formControlName=\"value1\" type=\"text\" />\n </sky-input-box>\n </sky-modal-content>\n <sky-modal-footer>\n <button class=\"sky-btn sky-btn-primary\" type=\"submit\">Save</button>\n <button class=\"sky-btn sky-btn-link\" type=\"button\" (click)=\"cancelForm()\">\n Cancel\n </button>\n </sky-modal-footer>\n </sky-modal>\n</form>\n"
|
|
4736
4736
|
},
|
|
4737
4737
|
{
|
|
4738
4738
|
"fileName": "modal-demo-data.ts",
|
|
4739
|
-
"filePath": "/projects/modals/documentation/code-examples/
|
|
4739
|
+
"filePath": "/projects/modals/documentation/code-examples/inline-help/modal-demo-data.ts",
|
|
4740
4740
|
"rawContents": "export interface ModalDemoData {\n value1?: string | null;\n}\n"
|
|
4741
4741
|
},
|
|
4742
4742
|
{
|
|
4743
|
-
"fileName": "modal-demo-
|
|
4744
|
-
"filePath": "/projects/modals/documentation/code-examples/
|
|
4745
|
-
"rawContents": "
|
|
4743
|
+
"fileName": "modal-demo-data.service.ts",
|
|
4744
|
+
"filePath": "/projects/modals/documentation/code-examples/inline-help/modal-demo-data.service.ts",
|
|
4745
|
+
"rawContents": "import { Injectable } from '@angular/core';\n\nimport { Observable, of } from 'rxjs';\nimport { delay } from 'rxjs/operators';\n\nimport { ModalDemoData } from './modal-demo-data';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ModalDemoDataService {\n #data: ModalDemoData = {\n value1: 'Hello world',\n };\n\n public load(): Observable<ModalDemoData> {\n // Simulate a network request to get data.\n return of(this.#data).pipe(delay(1000));\n }\n\n public save(data: ModalDemoData): Observable<ModalDemoData> {\n this.#data = data;\n\n // Simulate a network request to save data.\n return of(this.#data).pipe(delay(1000));\n }\n}\n"
|
|
4746
4746
|
},
|
|
4747
4747
|
{
|
|
4748
|
-
"fileName": "modal-demo-
|
|
4749
|
-
"filePath": "/projects/modals/documentation/code-examples/
|
|
4750
|
-
"rawContents": "import {
|
|
4748
|
+
"fileName": "modal-demo-context.ts",
|
|
4749
|
+
"filePath": "/projects/modals/documentation/code-examples/inline-help/modal-demo-context.ts",
|
|
4750
|
+
"rawContents": "import { ModalDemoData } from './modal-demo-data';\n\nexport class ModalDemoContext {\n constructor(public data: ModalDemoData) {}\n}\n"
|
|
4751
4751
|
},
|
|
4752
4752
|
{
|
|
4753
|
-
"fileName": "
|
|
4754
|
-
"filePath": "/projects/modals/documentation/code-examples/
|
|
4755
|
-
"rawContents": "
|
|
4753
|
+
"fileName": "confirm-demo.module.ts",
|
|
4754
|
+
"filePath": "/projects/modals/documentation/code-examples/confirm/confirm-demo.module.ts",
|
|
4755
|
+
"rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { SkyConfirmModule } from '@skyux/modals';\n\nimport { ConfirmDemoComponent } from './confirm-demo.component';\n\n@NgModule({\n imports: [CommonModule, FormsModule, SkyConfirmModule],\n declarations: [ConfirmDemoComponent],\n exports: [ConfirmDemoComponent],\n})\nexport class ConfirmDemoModule {}\n"
|
|
4756
4756
|
},
|
|
4757
4757
|
{
|
|
4758
|
-
"fileName": "
|
|
4759
|
-
"filePath": "/projects/modals/documentation/code-examples/
|
|
4760
|
-
"rawContents": "import {
|
|
4758
|
+
"fileName": "confirm-demo.component.ts",
|
|
4759
|
+
"filePath": "/projects/modals/documentation/code-examples/confirm/confirm-demo.component.ts",
|
|
4760
|
+
"rawContents": "import { Component } from '@angular/core';\nimport {\n SkyConfirmButtonConfig,\n SkyConfirmInstance,\n SkyConfirmService,\n SkyConfirmType,\n} from '@skyux/modals';\n\n@Component({\n selector: 'app-confirm-demo',\n templateUrl: './confirm-demo.component.html',\n})\nexport class ConfirmDemoComponent {\n public selectedAction: string | undefined;\n\n public selectedText: string | undefined;\n\n #confirmSvc: SkyConfirmService;\n\n constructor(confirmSvc: SkyConfirmService) {\n this.#confirmSvc = confirmSvc;\n }\n\n public openOKConfirm(): void {\n const dialog: SkyConfirmInstance = this.#confirmSvc.open({\n message:\n 'Cannot delete invoice because it has vendor, credit memo, or purchase order activity.',\n type: SkyConfirmType.OK,\n });\n\n dialog.closed.subscribe((result) => {\n this.selectedText = undefined;\n this.selectedAction = result.action;\n });\n }\n\n public openTwoActionConfirm(): void {\n const buttons: SkyConfirmButtonConfig[] = [\n { text: 'Finalize', action: 'save', styleType: 'primary' },\n { text: 'Cancel', action: 'cancel', styleType: 'link' },\n ];\n\n const dialog: SkyConfirmInstance = this.#confirmSvc.open({\n message: 'Finalize report cards?',\n body: 'Grades cannot be changed once the report cards are finalized.',\n type: SkyConfirmType.Custom,\n buttons,\n });\n\n dialog.closed.subscribe((result) => {\n this.selectedAction = result.action;\n\n for (const button of buttons) {\n if (button.action === result.action) {\n this.selectedText = button.text;\n break;\n }\n }\n });\n }\n\n public openThreeActionConfirm(): void {\n const buttons: SkyConfirmButtonConfig[] = [\n { text: 'Save', action: 'save', styleType: 'primary' },\n { text: 'Delete', action: 'delete' },\n { text: 'Keep working', action: 'cancel', styleType: 'link' },\n ];\n\n const dialog: SkyConfirmInstance = this.#confirmSvc.open({\n message: 'Save your changes before leaving?',\n type: SkyConfirmType.Custom,\n buttons,\n });\n\n dialog.closed.subscribe((result) => {\n this.selectedAction = result.action;\n\n for (const button of buttons) {\n if (button.action === result.action) {\n this.selectedText = button.text;\n break;\n }\n }\n });\n }\n\n public openDeleteConfirm(): void {\n const buttons: SkyConfirmButtonConfig[] = [\n { text: 'Delete', action: 'delete', styleType: 'danger' },\n { text: 'Cancel', action: 'cancel', styleType: 'link' },\n ];\n\n const dialog: SkyConfirmInstance = this.#confirmSvc.open({\n message: 'Delete this account?',\n body: 'Deleting this account may affect processes that are currently running.',\n type: SkyConfirmType.Custom,\n buttons,\n });\n\n dialog.closed.subscribe((result) => {\n this.selectedAction = result.action;\n\n for (const button of buttons) {\n if (button.action === result.action) {\n this.selectedText = button.text;\n break;\n }\n }\n });\n }\n}\n"
|
|
4761
4761
|
},
|
|
4762
4762
|
{
|
|
4763
|
-
"fileName": "
|
|
4764
|
-
"filePath": "/projects/modals/documentation/code-examples/
|
|
4765
|
-
"rawContents": "import {
|
|
4763
|
+
"fileName": "confirm-demo.component.spec.ts",
|
|
4764
|
+
"filePath": "/projects/modals/documentation/code-examples/confirm/confirm-demo.component.spec.ts",
|
|
4765
|
+
"rawContents": "import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';\nimport { ComponentFixture, TestBed } from '@angular/core/testing';\nimport { RouterTestingModule } from '@angular/router/testing';\nimport { SkyConfirmHarness } from '@skyux/modals/testing';\n\nimport { ConfirmDemoComponent } from './confirm-demo.component';\nimport { ConfirmDemoModule } from './confirm-demo.module';\n\ndescribe('Confirm demo', () => {\n async function setupTest(confirmBtnClass: string): Promise<{\n confirmHarness: SkyConfirmHarness;\n fixture: ComponentFixture<ConfirmDemoComponent>;\n }> {\n const fixture = TestBed.createComponent(ConfirmDemoComponent);\n const openBtn = fixture.nativeElement.querySelector(confirmBtnClass);\n\n openBtn.click();\n\n const rootLoader = TestbedHarnessEnvironment.documentRootLoader(fixture);\n\n const confirmHarness = await rootLoader.getHarness(SkyConfirmHarness);\n return { confirmHarness, fixture };\n }\n\n beforeEach(() => {\n TestBed.configureTestingModule({\n imports: [ConfirmDemoModule, RouterTestingModule],\n });\n });\n\n it('should show the correct text when OK is clicked on an OK confirm', async () => {\n const { confirmHarness, fixture } = await setupTest('.ok-confirm-btn');\n\n await confirmHarness.clickOkButton();\n\n const displayedTextEl: HTMLElement =\n fixture.nativeElement.querySelector('.displayed-text');\n\n expect(displayedTextEl.innerText).toEqual('You selected the \"ok\" action.');\n await expectAsync(confirmHarness.getMessageText()).toBeResolvedTo(\n 'Cannot delete invoice because it has vendor, credit memo, or purchase order activity.'\n );\n });\n\n it('should show the correct text when \"Finalize\" is clicked on a custom confirm', async () => {\n const { confirmHarness, fixture } = await setupTest(\n '.two-action-confirm-btn'\n );\n\n await confirmHarness.clickCustomButton({ text: 'Finalize' });\n\n const displayedTextEl: HTMLElement =\n fixture.nativeElement.querySelector('.displayed-text');\n\n expect(displayedTextEl.innerText).toEqual(\n 'You selected the \"Finalize\" button, which has an action of \"save.\"'\n );\n await expectAsync(confirmHarness.getMessageText()).toBeResolvedTo(\n 'Finalize report cards?'\n );\n await expectAsync(confirmHarness.getBodyText()).toBeResolvedTo(\n 'Grades cannot be changed once the report cards are finalized.'\n );\n });\n});\n"
|
|
4766
4766
|
},
|
|
4767
4767
|
{
|
|
4768
|
-
"fileName": "
|
|
4769
|
-
"filePath": "/projects/modals/documentation/code-examples/
|
|
4770
|
-
"rawContents": "
|
|
4768
|
+
"fileName": "confirm-demo.component.html",
|
|
4769
|
+
"filePath": "/projects/modals/documentation/code-examples/confirm/confirm-demo.component.html",
|
|
4770
|
+
"rawContents": "<button\n aria-haspopup=\"dialog\"\n class=\"sky-btn sky-btn-default sky-margin-inline-default ok-confirm-btn\"\n type=\"button\"\n (click)=\"openOKConfirm()\"\n>\n OK confirm\n</button>\n\n<button\n aria-haspopup=\"dialog\"\n class=\"sky-btn sky-btn-default sky-margin-inline-default two-action-confirm-btn\"\n type=\"button\"\n (click)=\"openTwoActionConfirm()\"\n>\n Confirm with two actions\n</button>\n\n<button\n aria-haspopup=\"dialog\"\n class=\"sky-btn sky-btn-default sky-margin-inline-default\"\n type=\"button\"\n (click)=\"openThreeActionConfirm()\"\n>\n Confirm with three actions\n</button>\n\n<button\n aria-haspopup=\"dialog\"\n class=\"sky-btn sky-btn-default sky-margin-inline-default\"\n type=\"button\"\n (click)=\"openDeleteConfirm()\"\n>\n Confirm with delete button\n</button>\n\n<p *ngIf=\"selectedAction && selectedText\" class=\"displayed-text\">\n You selected the \"{{ selectedText }}\" button, which has an action of \"{{\n selectedAction\n }}.\"\n</p>\n<p *ngIf=\"selectedAction && !selectedText\" class=\"displayed-text\">\n You selected the \"{{ selectedAction }}\" action.\n</p>\n"
|
|
4771
4771
|
}
|
|
4772
4772
|
]
|
|
4773
4773
|
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { Component, Inject } from '@angular/core';
|
|
2
|
+
import { ReplaySubject } from 'rxjs';
|
|
3
|
+
import { take } from 'rxjs/operators';
|
|
4
|
+
import { SKY_CONFIRM_CONFIG } from './confirm-config-token';
|
|
5
|
+
import { SkyConfirmType } from './confirm-type';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
import * as i1 from "../modal/modal-instance";
|
|
8
|
+
import * as i2 from "@skyux/i18n";
|
|
9
|
+
import * as i3 from "@skyux/core";
|
|
10
|
+
import * as i4 from "@angular/common";
|
|
11
|
+
import * as i5 from "../modal/modal.component";
|
|
12
|
+
import * as i6 from "../modal/modal-content.component";
|
|
13
|
+
import * as i7 from "@skyux/theme";
|
|
14
|
+
export class SkyConfirmComponent {
|
|
15
|
+
#config;
|
|
16
|
+
#modal;
|
|
17
|
+
#resourcesService;
|
|
18
|
+
constructor(config, modal, resourcesService, idService) {
|
|
19
|
+
this.preserveWhiteSpace = false;
|
|
20
|
+
this.isOkType = false;
|
|
21
|
+
this.#config = config;
|
|
22
|
+
this.#modal = modal;
|
|
23
|
+
this.#resourcesService = resourcesService;
|
|
24
|
+
if (config.type === SkyConfirmType.Custom &&
|
|
25
|
+
config.buttons &&
|
|
26
|
+
config.buttons.length > 0) {
|
|
27
|
+
this.buttons = this.#getCustomButtons(config.buttons);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
this.#getPresetButtons()
|
|
31
|
+
.pipe(take(1))
|
|
32
|
+
.subscribe((buttons) => {
|
|
33
|
+
this.buttons = buttons;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
this.message = config.message;
|
|
37
|
+
this.body = config.body;
|
|
38
|
+
// Using the service here instead of the directive due to the confirm component's "body" container being conditional and thus a template variable being unavailable at an outer scope
|
|
39
|
+
this.bodyId = idService.generateId();
|
|
40
|
+
this.preserveWhiteSpace = !!config.preserveWhiteSpace;
|
|
41
|
+
this.isOkType = config.type === SkyConfirmType.OK;
|
|
42
|
+
}
|
|
43
|
+
close(button) {
|
|
44
|
+
const result = {
|
|
45
|
+
action: button.action,
|
|
46
|
+
};
|
|
47
|
+
this.#modal.close(result);
|
|
48
|
+
}
|
|
49
|
+
#getPresetButtons() {
|
|
50
|
+
const emitter = new ReplaySubject(1);
|
|
51
|
+
this.#resourcesService
|
|
52
|
+
.getStrings({
|
|
53
|
+
cancel: 'skyux_confirm_dialog_default_cancel_text',
|
|
54
|
+
no: 'skyux_confirm_dialog_default_no_text',
|
|
55
|
+
ok: 'skyux_confirm_dialog_default_ok_text',
|
|
56
|
+
yes: 'skyux_confirm_dialog_default_yes_text',
|
|
57
|
+
})
|
|
58
|
+
.subscribe((values) => {
|
|
59
|
+
const confirmButtons = [];
|
|
60
|
+
switch (this.#config.type) {
|
|
61
|
+
case SkyConfirmType.YesNoCancel:
|
|
62
|
+
case SkyConfirmType.YesCancel:
|
|
63
|
+
confirmButtons.push({
|
|
64
|
+
text: values.yes,
|
|
65
|
+
autofocus: true,
|
|
66
|
+
styleType: 'primary',
|
|
67
|
+
action: 'yes',
|
|
68
|
+
});
|
|
69
|
+
if (this.#config.type === SkyConfirmType.YesNoCancel) {
|
|
70
|
+
confirmButtons.push({
|
|
71
|
+
text: values.no,
|
|
72
|
+
styleType: 'default',
|
|
73
|
+
action: 'no',
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
confirmButtons.push({
|
|
77
|
+
text: values.cancel,
|
|
78
|
+
styleType: 'link',
|
|
79
|
+
action: 'cancel',
|
|
80
|
+
});
|
|
81
|
+
break;
|
|
82
|
+
default:
|
|
83
|
+
confirmButtons.push({
|
|
84
|
+
text: values.ok,
|
|
85
|
+
autofocus: true,
|
|
86
|
+
styleType: 'primary',
|
|
87
|
+
action: 'ok',
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
emitter.next(confirmButtons);
|
|
91
|
+
});
|
|
92
|
+
return emitter.asObservable();
|
|
93
|
+
}
|
|
94
|
+
#getCustomButtons(buttonConfig) {
|
|
95
|
+
return buttonConfig.map((config) => ({
|
|
96
|
+
text: config.text,
|
|
97
|
+
action: config.action,
|
|
98
|
+
styleType: config.styleType || 'default',
|
|
99
|
+
autofocus: config.autofocus || false,
|
|
100
|
+
}));
|
|
101
|
+
}
|
|
102
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyConfirmComponent, deps: [{ token: SKY_CONFIRM_CONFIG }, { token: i1.SkyModalInstance }, { token: i2.SkyLibResourcesService }, { token: i3.SkyIdService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
103
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SkyConfirmComponent, selector: "sky-confirm", ngImport: i0, template: "<div class=\"sky-confirm\" [ngClass]=\"{ 'sky-confirm-type-ok': isOkType }\">\n <sky-modal\n ariaRole=\"alertdialog\"\n [ariaLabelledBy]=\"confirmMessage.id\"\n [ariaDescribedBy]=\"body ? bodyId : undefined\"\n >\n <sky-modal-content class=\"sky-confirm-content\">\n <!--\n The following \"magic comment\" keeps Prettier from adding line breaks\n inside the div and causing leading and trailing whitespace when\n `preserveWhiteSpace` is `true`.\n https://prettier.io/blog/2018/11/07/1.15.0.html#whitespace-sensitive-formatting\n -->\n <!-- display: inline -->\n <div\n class=\"sky-confirm-message\"\n [ngClass]=\"{\n 'sky-confirm-preserve-white-space': preserveWhiteSpace\n }\"\n [skyThemeClass]=\"{\n 'sky-font-display-4': 'default',\n 'sky-font-heading-1 sky-font-display-3': 'modern'\n }\"\n skyId\n #confirmMessage=\"skyId\"\n >{{ message }}</div\n >\n\n <!--\n The following \"magic comment\" keeps Prettier from adding line breaks\n inside the div and causing leading and trailing whitespace when\n `preserveWhiteSpace` is `true`.\n https://prettier.io/blog/2018/11/07/1.15.0.html#whitespace-sensitive-formatting\n -->\n <!-- display: inline -->\n <div\n *ngIf=\"body\"\n class=\"sky-confirm-body\"\n [id]=\"bodyId\"\n [ngClass]=\"{\n 'sky-confirm-preserve-white-space': preserveWhiteSpace\n }\"\n >{{ body }}</div\n >\n\n <div class=\"sky-confirm-buttons\">\n <button\n *ngFor=\"let button of buttons\"\n type=\"button\"\n class=\"sky-btn\"\n [ngClass]=\"'sky-btn-' + button.styleType\"\n [skyThemeClass]=\"{\n 'sky-margin-inline-sm': 'modern',\n 'sky-margin-inline-compact': 'default'\n }\"\n (click)=\"close(button)\"\n [attr.autofocus]=\"button.autofocus ? 'autofocus' : null\"\n >\n {{ button.text }}\n </button>\n </div>\n </sky-modal-content>\n </sky-modal>\n</div>\n", styles: [".sky-confirm{--sky-confirm-body-margin-top: var(--sky-margin-stacked-sm);--sky-confirm-buttons-margin-top: var(--sky-margin-stacked-xl);--sky-confirm-content-padding: 0;--sky-confirm-message-padding-bottom: 0}:host-context(.sky-theme-modern) .sky-confirm{--sky-confirm-body-margin-top: 0;--sky-confirm-buttons-margin-top: var(--sky-margin-stacked-lg);--sky-confirm-content-padding: var(--sky-margin-stacked-lg) var(--sky-margin-inline-xl);--sky-confirm-message-padding-bottom: var(--sky-margin-stacked-lg)}.sky-theme-modern .sky-confirm{--sky-confirm-body-margin-top: 0;--sky-confirm-buttons-margin-top: var(--sky-margin-stacked-lg);--sky-confirm-content-padding: var(--sky-margin-stacked-lg) var(--sky-margin-inline-xl);--sky-confirm-message-padding-bottom: var(--sky-margin-stacked-lg)}.sky-confirm-content{padding:var(--sky-confirm-content-padding)}.sky-confirm-message{margin-top:var(--sky-margin-stacked-xs);padding-bottom:var(--sky-confirm-message-padding-bottom)}.sky-confirm-body{margin-top:var(--sky-confirm-body-margin-top)}.sky-confirm-buttons{margin-top:var(--sky-confirm-buttons-margin-top)}.sky-confirm-preserve-white-space{white-space:pre-wrap}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.λ2, selector: "[skyId]", exportAs: ["skyId"] }, { kind: "component", type: i5.SkyModalComponent, selector: "sky-modal", inputs: ["formErrors", "ariaRole", "tiledBody", "ariaDescribedBy", "ariaLabelledBy"] }, { kind: "component", type: i6.SkyModalContentComponent, selector: "sky-modal-content" }, { kind: "directive", type: i7.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }] }); }
|
|
104
|
+
}
|
|
105
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyConfirmComponent, decorators: [{
|
|
106
|
+
type: Component,
|
|
107
|
+
args: [{ selector: 'sky-confirm', template: "<div class=\"sky-confirm\" [ngClass]=\"{ 'sky-confirm-type-ok': isOkType }\">\n <sky-modal\n ariaRole=\"alertdialog\"\n [ariaLabelledBy]=\"confirmMessage.id\"\n [ariaDescribedBy]=\"body ? bodyId : undefined\"\n >\n <sky-modal-content class=\"sky-confirm-content\">\n <!--\n The following \"magic comment\" keeps Prettier from adding line breaks\n inside the div and causing leading and trailing whitespace when\n `preserveWhiteSpace` is `true`.\n https://prettier.io/blog/2018/11/07/1.15.0.html#whitespace-sensitive-formatting\n -->\n <!-- display: inline -->\n <div\n class=\"sky-confirm-message\"\n [ngClass]=\"{\n 'sky-confirm-preserve-white-space': preserveWhiteSpace\n }\"\n [skyThemeClass]=\"{\n 'sky-font-display-4': 'default',\n 'sky-font-heading-1 sky-font-display-3': 'modern'\n }\"\n skyId\n #confirmMessage=\"skyId\"\n >{{ message }}</div\n >\n\n <!--\n The following \"magic comment\" keeps Prettier from adding line breaks\n inside the div and causing leading and trailing whitespace when\n `preserveWhiteSpace` is `true`.\n https://prettier.io/blog/2018/11/07/1.15.0.html#whitespace-sensitive-formatting\n -->\n <!-- display: inline -->\n <div\n *ngIf=\"body\"\n class=\"sky-confirm-body\"\n [id]=\"bodyId\"\n [ngClass]=\"{\n 'sky-confirm-preserve-white-space': preserveWhiteSpace\n }\"\n >{{ body }}</div\n >\n\n <div class=\"sky-confirm-buttons\">\n <button\n *ngFor=\"let button of buttons\"\n type=\"button\"\n class=\"sky-btn\"\n [ngClass]=\"'sky-btn-' + button.styleType\"\n [skyThemeClass]=\"{\n 'sky-margin-inline-sm': 'modern',\n 'sky-margin-inline-compact': 'default'\n }\"\n (click)=\"close(button)\"\n [attr.autofocus]=\"button.autofocus ? 'autofocus' : null\"\n >\n {{ button.text }}\n </button>\n </div>\n </sky-modal-content>\n </sky-modal>\n</div>\n", styles: [".sky-confirm{--sky-confirm-body-margin-top: var(--sky-margin-stacked-sm);--sky-confirm-buttons-margin-top: var(--sky-margin-stacked-xl);--sky-confirm-content-padding: 0;--sky-confirm-message-padding-bottom: 0}:host-context(.sky-theme-modern) .sky-confirm{--sky-confirm-body-margin-top: 0;--sky-confirm-buttons-margin-top: var(--sky-margin-stacked-lg);--sky-confirm-content-padding: var(--sky-margin-stacked-lg) var(--sky-margin-inline-xl);--sky-confirm-message-padding-bottom: var(--sky-margin-stacked-lg)}.sky-theme-modern .sky-confirm{--sky-confirm-body-margin-top: 0;--sky-confirm-buttons-margin-top: var(--sky-margin-stacked-lg);--sky-confirm-content-padding: var(--sky-margin-stacked-lg) var(--sky-margin-inline-xl);--sky-confirm-message-padding-bottom: var(--sky-margin-stacked-lg)}.sky-confirm-content{padding:var(--sky-confirm-content-padding)}.sky-confirm-message{margin-top:var(--sky-margin-stacked-xs);padding-bottom:var(--sky-confirm-message-padding-bottom)}.sky-confirm-body{margin-top:var(--sky-confirm-body-margin-top)}.sky-confirm-buttons{margin-top:var(--sky-confirm-buttons-margin-top)}.sky-confirm-preserve-white-space{white-space:pre-wrap}\n"] }]
|
|
108
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
109
|
+
type: Inject,
|
|
110
|
+
args: [SKY_CONFIRM_CONFIG]
|
|
111
|
+
}] }, { type: i1.SkyModalInstance }, { type: i2.SkyLibResourcesService }, { type: i3.SkyIdService }]; } });
|
|
112
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlybS5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbXBvbmVudHMvbW9kYWxzL3NyYy9saWIvbW9kdWxlcy9jb25ma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J3NreXV4X2NvbmZpcm1fZGlhbG9nX2RlZmF1bHRfbm9fdGV4dCcsXG4gICAgICAgIG9rOiAnc2t5dXhfY29uZmlybV9kaWFsb2dfZGVmYXVsdF9va190ZXh0JyxcbiAgICAgICAgeWVzOiAnc2t5dXhfY29uZmlybV9kaWFsb2dfZGVmYXVsdF95ZXNfdGV4dCcsXG4gICAgICB9KVxuICAgICAgLnN1YnNjcmliZSgodmFsdWVzKSA9PiB7XG4gICAgICAgIGNvbnN0IGNvbmZpcm1CdXR0b25zOiBTa3lDb25maXJtQnV0dG9uW10gPSBbXTtcblxuICAgICAgICBzd2l0Y2ggKHRoaXMuI2NvbmZpZy50eXBlKSB7XG4gICAgICAgICAgY2FzZSBTa3lDb25maXJtVHlwZS5ZZXNOb0NhbmNlbDpcbiAgICAgICAgICBjYXNlIFNreUNvbmZpcm1UeXBlLlllc0NhbmNlbDpcbiAgICAgICAgICAgIGNvbmZpcm1CdXR0b25zLnB1c2goe1xuICAgICAgICAgICAgICB0ZXh0OiB2YWx1ZXMueWVzLFxuICAgICAgICAgICAgICBhdXRvZm9jdXM6IHRydWUsXG4gICAgICAgICAgICAgIHN0eWxlVHlwZTogJ3ByaW1hcnknLFxuICAgICAgICAgICAgICBhY3Rpb246ICd5ZXMnLFxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGlmICh0aGlzLiNjb25maWcudHlwZSA9PT0gU2t5Q29uZmlybVR5cGUuWWVzTm9DYW5jZWwpIHtcbiAgICAgICAgICAgICAgY29uZmlybUJ1dHRvbnMucHVzaCh7XG4gICAgICAgICAgICAgICAgdGV4dDogdmFsdWVzLm5vLFxuICAgICAgICAgICAgICAgIHN0eWxlVHlwZTogJ2RlZmF1bHQnLFxuICAgICAgICAgICAgICAgIGFjdGlvbjogJ25vJyxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGNvbmZpcm1CdXR0b25zLnB1c2goe1xuICAgICAgICAgICAgICB0ZXh0OiB2YWx1ZXMuY2FuY2VsLFxuICAgICAgICAgICAgICBzdHlsZVR5cGU6ICdsaW5rJyxcbiAgICAgICAgICAgICAgYWN0aW9uOiAnY2FuY2VsJyxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIGNvbmZpcm1CdXR0b25zLnB1c2goe1xuICAgICAgICAgICAgICB0ZXh0OiB2YWx1ZXMub2ssXG4gICAgICAgICAgICAgIGF1dG9mb2N1czogdHJ1ZSxcbiAgICAgICAgICAgICAgc3R5bGVUeXBlOiAncHJpbWFyeScsXG4gICAgICAgICAgICAgIGFjdGlvbjogJ29rJyxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgZW1pdHRlci5uZXh0KGNvbmZpcm1CdXR0b25zKTtcbiAgICAgIH0pO1xuXG4gICAgcmV0dXJuIGVtaXR0ZXIuYXNPYnNlcnZhYmxlKCk7XG4gIH1cblxuICAjZ2V0Q3VzdG9tQnV0dG9ucyhcbiAgICBidXR0b25Db25maWc6IFNreUNvbmZpcm1CdXR0b25Db25maWdbXVxuICApOiBTa3lDb25maXJtQnV0dG9uW10ge1xuICAgIHJldHVybiBidXR0b25Db25maWcubWFwKFxuICAgICAgKGNvbmZpZykgPT5cbiAgICAgICAgKHtcbiAgICAgICAgICB0ZXh0OiBjb25maWcudGV4dCxcbiAgICAgICAgICBhY3Rpb246IGNvbmZpZy5hY3Rpb24sXG4gICAgICAgICAgc3R5bGVUeXBlOiBjb25maWcuc3R5bGVUeXBlIHx8ICdkZWZhdWx0JyxcbiAgICAgICAgICBhdXRvZm9jdXM6IGNvbmZpZy5hdXRvZm9jdXMgfHwgZmFsc2UsXG4gICAgICAgIH0gYXMgU2t5Q29uZmlybUJ1dHRvbilcbiAgICApO1xuICB9XG59XG4iLCI8ZGl2IGNsYXNzPVwic2t5LWNvbmZpcm1cIiBbbmdDbGFzc109XC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gICAgICAgdHlwZT1cImJ1dHRvblwiXG4gICAgICAgICAgY2xhc3M9XCJza3ktYnRuXCJcbiAgICAgICAgICBbbmdDbGFzc109XCInc2t5LWJ0bi0nICsgYnV0dG9uLnN0eWxlVHlwZVwiXG4gICAgICAgICAgW3NreVRoZW1lQ2xhc3NdPVwie1xuICAgICAgICAgICAgJ3NreS1tYXJnaW4taW5saW5lLXNtJzogJ21vZGVybicsXG4gICAgICAgICAgICAnc2t5LW1hcmdpbi1pbmxpbmUtY29tcGFjdCc6ICdkZWZhdWx0J1xuICAgICAgICAgIH1cIlxuICAgICAgICAgIChjbGljayk9XCJjbG9zZShidXR0b24pXCJcbiAgICAgICAgICBbYXR0ci5hdXRvZm9jdXNdPVwiYnV0dG9uLmF1dG9mb2N1cyA/ICdhdXRvZm9jdXMnIDogbnVsbFwiXG4gICAgICAgID5cbiAgICAgICAgICB7eyBidXR0b24udGV4dCB9fVxuICAgICAgICA8L2J1dHRvbj5cbiAgICAgIDwvZGl2PlxuICAgIDwvc2t5LW1vZGFsLWNvbnRlbnQ+XG4gIDwvc2t5LW1vZGFsPlxuPC9kaXY+XG4iXX0=
|
|
@@ -7,19 +7,19 @@ import { SkyModalsResourcesModule } from '../shared/sky-modals-resources.module'
|
|
|
7
7
|
import { SkyConfirmComponent } from './confirm.component';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
export class SkyConfirmModule {
|
|
10
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyConfirmModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
11
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.7", ngImport: i0, type: SkyConfirmModule, declarations: [SkyConfirmComponent], imports: [CommonModule,
|
|
12
|
+
SkyIdModule,
|
|
13
|
+
SkyModalModule,
|
|
14
|
+
SkyModalsResourcesModule,
|
|
15
|
+
SkyThemeModule], exports: [SkyConfirmComponent] }); }
|
|
16
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyConfirmModule, imports: [CommonModule,
|
|
17
|
+
SkyIdModule,
|
|
18
|
+
SkyModalModule,
|
|
19
|
+
SkyModalsResourcesModule,
|
|
20
|
+
SkyThemeModule] }); }
|
|
10
21
|
}
|
|
11
|
-
|
|
12
|
-
SkyConfirmModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: SkyConfirmModule, declarations: [SkyConfirmComponent], imports: [CommonModule,
|
|
13
|
-
SkyIdModule,
|
|
14
|
-
SkyModalModule,
|
|
15
|
-
SkyModalsResourcesModule,
|
|
16
|
-
SkyThemeModule], exports: [SkyConfirmComponent] });
|
|
17
|
-
SkyConfirmModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyConfirmModule, imports: [CommonModule,
|
|
18
|
-
SkyIdModule,
|
|
19
|
-
SkyModalModule,
|
|
20
|
-
SkyModalsResourcesModule,
|
|
21
|
-
SkyThemeModule] });
|
|
22
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyConfirmModule, decorators: [{
|
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyConfirmModule, decorators: [{
|
|
23
23
|
type: NgModule,
|
|
24
24
|
args: [{
|
|
25
25
|
declarations: [SkyConfirmComponent],
|
|
@@ -33,4 +33,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
33
33
|
exports: [SkyConfirmComponent],
|
|
34
34
|
}]
|
|
35
35
|
}] });
|
|
36
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
36
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjoz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} from './confirm-config-token';
|
|
3
|
+
import { SkyConfirmInstance } from './confirm-instance';
|
|
4
|
+
import { SkyConfirmComponent } from './confirm.component';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
import * as i1 from "../modal/modal.service";
|
|
7
|
+
/**
|
|
8
|
+
* Launches a dialog.
|
|
9
|
+
*/
|
|
10
|
+
export class SkyConfirmService {
|
|
11
|
+
#modalService;
|
|
12
|
+
constructor(modalService) {
|
|
13
|
+
this.#modalService = modalService;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Opens a dialog using the specified options.
|
|
17
|
+
* @param config Specifies configuration options for the dialog.
|
|
18
|
+
*/
|
|
19
|
+
open(config) {
|
|
20
|
+
const modalInstance = this.#modalService.open(SkyConfirmComponent, {
|
|
21
|
+
providers: [
|
|
22
|
+
{
|
|
23
|
+
provide: SKY_CONFIRM_CONFIG,
|
|
24
|
+
useValue: config,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
});
|
|
28
|
+
const confirmInstance = new SkyConfirmInstance();
|
|
29
|
+
modalInstance.closed.subscribe((args) => {
|
|
30
|
+
let result = args.data;
|
|
31
|
+
// The modal was closed using the ESC key.
|
|
32
|
+
if (result === undefined) {
|
|
33
|
+
result = {
|
|
34
|
+
action: 'cancel',
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
confirmInstance.closed.emit(result);
|
|
38
|
+
confirmInstance.closed.complete();
|
|
39
|
+
});
|
|
40
|
+
return confirmInstance;
|
|
41
|
+
}
|
|
42
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyConfirmService, deps: [{ token: i1.SkyModalService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
43
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyConfirmService, providedIn: 'any' }); }
|
|
44
|
+
}
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyConfirmService, decorators: [{
|
|
46
|
+
type: Injectable,
|
|
47
|
+
args: [{
|
|
48
|
+
// Must be 'any' so that the modal component is created in the context of its module's injector.
|
|
49
|
+
// If set to 'root', the component's dependency injections would only be derived from the root
|
|
50
|
+
// injector and may loose context if the modal was opened from within a lazy-loaded module.
|
|
51
|
+
providedIn: 'any',
|
|
52
|
+
}]
|
|
53
|
+
}], ctorParameters: function () { return [{ type: i1.SkyModalService }]; } });
|
|
54
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlybS5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL21vZGFscy9zcmMvbGliL21vZHVsZXMvY29uZmlybS9jb25maXJtLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQVEzQyxPQUFPLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUM1RCxPQUFPLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUN4RCxPQUFPLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQzs7O0FBRTFEOztHQUVHO0FBT0gsTUFBTSxPQUFPLGlCQUFpQjtJQUM1QixhQUFhLENBQWtCO0lBRS9CLFlBQVksWUFBNkI7UUFDdkMsSUFBSSxDQUFDLGFBQWEsR0FBRyxZQUFZLENBQUM7SUFDcEMsQ0FBQztJQUVEOzs7T0FHRztJQUNJLElBQUksQ0FBQyxNQUF3QjtRQUNsQyxNQUFNLGFBQWEsR0FBcUIsSUFBSSxDQUFDLGFBQWEsQ0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