@skyux/modals 7.14.0 → 7.15.0

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.
@@ -408,7 +408,7 @@
408
408
  "kindString": "Class",
409
409
  "flags": {},
410
410
  "comment": {
411
- "shortText": "Closes the modal instance using the `closeModal` method."
411
+ "shortText": "Properties about the modal close action and a method to close the modal."
412
412
  },
413
413
  "children": [
414
414
  {
@@ -420,7 +420,7 @@
420
420
  "sources": [
421
421
  {
422
422
  "fileName": "projects/modals/src/modules/modal/modal-before-close-handler.ts",
423
- "line": 7,
423
+ "line": 20,
424
424
  "character": 2
425
425
  }
426
426
  ],
@@ -465,6 +465,57 @@
465
465
  }
466
466
  }
467
467
  ]
468
+ },
469
+ {
470
+ "id": 137,
471
+ "name": "closeArgs",
472
+ "kind": 1024,
473
+ "kindString": "Property",
474
+ "flags": {
475
+ "isPublic": true,
476
+ "isReadonly": true
477
+ },
478
+ "comment": {
479
+ "shortText": "The object that would be emitted by a modal's `closed` event. This object\ncan be used to determine whether to prompt the user for confirmation, such\nas when the user closes a modal form after entering data."
480
+ },
481
+ "sources": [
482
+ {
483
+ "fileName": "projects/modals/src/modules/modal/modal-before-close-handler.ts",
484
+ "line": 12,
485
+ "character": 18
486
+ }
487
+ ],
488
+ "type": {
489
+ "type": "reference",
490
+ "id": 139,
491
+ "name": "SkyModalCloseArgs"
492
+ }
493
+ },
494
+ {
495
+ "id": 138,
496
+ "name": "closeModal",
497
+ "kind": 1024,
498
+ "kindString": "Property",
499
+ "flags": {
500
+ "isPublic": true,
501
+ "isReadonly": true
502
+ },
503
+ "comment": {
504
+ "shortText": "Function to call to close the modal. Neglecting to call this function\neffectively cancels the close modal action."
505
+ },
506
+ "sources": [
507
+ {
508
+ "fileName": "projects/modals/src/modules/modal/modal-before-close-handler.ts",
509
+ "line": 18,
510
+ "character": 18
511
+ }
512
+ ],
513
+ "type": {
514
+ "type": "reference",
515
+ "qualifiedName": "Function",
516
+ "package": "typescript",
517
+ "name": "Function"
518
+ }
468
519
  }
469
520
  ],
470
521
  "groups": [
@@ -479,8 +530,8 @@
479
530
  "title": "Properties",
480
531
  "kind": 1024,
481
532
  "children": [
482
- 138,
483
- 137
533
+ 137,
534
+ 138
484
535
  ]
485
536
  }
486
537
  ],
@@ -3732,7 +3783,7 @@
3732
3783
  {
3733
3784
  "fileName": "modal-demo-modal.component.ts",
3734
3785
  "filePath": "/projects/modals/documentation/code-examples/modal/modal-demo-modal.component.ts",
3735
- "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 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"
3786
+ "rawContents": "import { Component, OnInit, inject } from '@angular/core';\nimport { FormControl, FormGroup } from '@angular/forms';\nimport { SkyWaitService } from '@skyux/indicators';\nimport {\n SkyConfirmService,\n SkyConfirmType,\n SkyModalBeforeCloseHandler,\n SkyModalInstance,\n} from '@skyux/modals';\n\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\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 implements OnInit {\n protected demoForm: FormGroup<{\n value1: FormControl<string | null | undefined>;\n }>;\n\n #ngUnsubscribe = new Subject<void>();\n\n #confirmSvc = inject(SkyConfirmService);\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 ngOnInit(): void {\n // Display a confirmation dialog based on how the modal is being closed.\n this.#instance.beforeClose\n .pipe(takeUntil(this.#ngUnsubscribe))\n .subscribe((args) => this.#confirmClose(args));\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 #confirmClose(args: SkyModalBeforeCloseHandler): void {\n if (args.closeArgs.reason === 'close' && this.demoForm.dirty) {\n // The user closed the form either by clicking the close button\n // or pressing Escape. Confirm that the user wants to discard\n // unsaved changes. Note that clicking Cancel does not require\n // confirmation.\n const confirm = this.#confirmSvc.open({\n message:\n 'You have unsaved changes that will be lost. Are you sure you want to close the form?',\n buttons: [\n {\n action: 'no',\n styleType: 'primary',\n text: 'No',\n },\n {\n action: 'yes',\n text: 'Yes',\n },\n ],\n type: SkyConfirmType.Custom,\n });\n\n confirm.closed\n .pipe(takeUntil(this.#ngUnsubscribe))\n .subscribe((confirmArgs) => {\n if (confirmArgs.action === 'yes') {\n args.closeModal();\n }\n });\n } else {\n args.closeModal();\n }\n }\n}\n"
3736
3787
  },
3737
3788
  {
3738
3789
  "fileName": "modal-demo.component.html",
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Closes the modal instance using the `closeModal` method.
2
+ * Properties about the modal close action and a method to close the modal.
3
3
  */
4
4
  export class SkyModalBeforeCloseHandler {
5
5
  constructor(closeModal, closeArgs) {
6
- this.closeModal = closeModal;
7
6
  this.closeArgs = closeArgs;
7
+ this.closeModal = closeModal;
8
8
  }
9
9
  }
10
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kYWwtYmVmb3JlLWNsb3NlLWhhbmRsZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbXBvbmVudHMvbW9kYWxzL3NyYy9saWIvbW9kdWxlcy9tb2RhbC9tb2RhbC1iZWZvcmUtY2xvc2UtaGFuZGxlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQTs7R0FFRztBQUNILE1BQU0sT0FBTywwQkFBMEI7SUFDckMsWUFDa0IsVUFBb0IsRUFDcEIsU0FBNEI7UUFENUIsZUFBVSxHQUFWLFVBQVUsQ0FBVTtRQUNwQixjQUFTLEdBQVQsU0FBUyxDQUFtQjtJQUMzQyxDQUFDO0NBQ0wiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBTa3lNb2RhbENsb3NlQXJncyB9IGZyb20gJy4vbW9kYWwtY2xvc2UtYXJncyc7XG5cbi8qKlxuICogQ2xvc2VzIHRoZSBtb2RhbCBpbnN0YW5jZSB1c2luZyB0aGUgYGNsb3NlTW9kYWxgIG1ldGhvZC5cbiAqL1xuZXhwb3J0IGNsYXNzIFNreU1vZGFsQmVmb3JlQ2xvc2VIYW5kbGVyIHtcbiAgY29uc3RydWN0b3IoXG4gICAgcHVibGljIHJlYWRvbmx5IGNsb3Nl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XB0IHRoZSB1c2VyIGZvciBjb25maXJtYXRpb24sIHN1Y2hcbiAgICogYXMgd2hlbiB0aGUgdXNlciBjbG9zZXMgYSBtb2RhbCBmb3JtIGFmdGVyIGVudGVyaW5nIGRhdGEuXG4gICAqL1xuICBwdWJsaWMgcmVhZG9ubHkgY2xvc2VBcmdzOiBTa3lNb2RhbENsb3NlQXJncztcblxuICAvKipcbiAgICogRnVuY3Rpb24gdG8gY2FsbCB0byBjbG9zZSB0aGUgbW9kYWwuIE5lZ2xlY3RpbmcgdG8gY2FsbCB0aGlzIGZ1bmN0aW9uXG4gICAqIGVmZmVjdGl2ZWx5IGNhbmNlbHMgdGhlIGNsb3NlIG1vZGFsIGFjdGlvbi5cbiAgICovXG4gIHB1YmxpYyByZWFkb25seSBjbG9zZU1vZGFsOiBGdW5jdGlvbjtcblxuICBjb25zdHJ1Y3RvcihjbG9zZU1vZGFsOiBGdW5jdGlvbiwgY2xvc2VBcmdzOiBTa3lNb2RhbENsb3NlQXJncykge1xuICAgIHRoaXMuY2xvc2VBcmdzID0gY2xvc2VBcmdzO1xuICAgIHRoaXMuY2xvc2VNb2RhbCA9IGNsb3NlTW9kYWw7XG4gIH1cbn1cbiJdfQ==
@@ -949,12 +949,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
949
949
  const SKY_CONFIRM_CONFIG = new InjectionToken('SkyConfirmConfig');
950
950
 
951
951
  /**
952
- * Closes the modal instance using the `closeModal` method.
952
+ * Properties about the modal close action and a method to close the modal.
953
953
  */
954
954
  class SkyModalBeforeCloseHandler {
955
955
  constructor(closeModal, closeArgs) {
956
- this.closeModal = closeModal;
957
956
  this.closeArgs = closeArgs;
957
+ this.closeModal = closeModal;
958
958
  }
959
959
  }
960
960