@skyux/modals 5.9.4 → 6.0.0-beta.10

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.
Files changed (121) hide show
  1. package/documentation.json +34 -34
  2. package/esm2020/index.mjs +26 -0
  3. package/esm2020/lib/modules/confirm/confirm-button-action.mjs +2 -0
  4. package/esm2020/lib/modules/confirm/confirm-button-config.mjs +2 -0
  5. package/esm2020/lib/modules/confirm/confirm-button.mjs +2 -0
  6. package/esm2020/lib/modules/confirm/confirm-closed-event-args.mjs +2 -0
  7. package/esm2020/lib/modules/confirm/confirm-config.mjs +2 -0
  8. package/esm2020/lib/modules/confirm/confirm-instance.mjs +12 -0
  9. package/esm2020/lib/modules/confirm/confirm-modal-context.mjs +6 -0
  10. package/esm2020/lib/modules/confirm/confirm-type.mjs +24 -0
  11. package/esm2020/lib/modules/confirm/confirm.component.mjs +123 -0
  12. package/esm2020/lib/modules/confirm/confirm.module.mjs +34 -0
  13. package/esm2020/lib/modules/confirm/confirm.service.mjs +54 -0
  14. package/esm2020/lib/modules/modal/modal-adapter.service.mjs +47 -0
  15. package/esm2020/lib/modules/modal/modal-before-close-handler.mjs +10 -0
  16. package/esm2020/lib/modules/modal/modal-close-args.mjs +7 -0
  17. package/esm2020/lib/modules/modal/modal-component-adapter.service.mjs +98 -0
  18. package/esm2020/lib/modules/modal/modal-configuration.mjs +19 -0
  19. package/esm2020/lib/modules/modal/modal-content.component.mjs +14 -0
  20. package/esm2020/lib/modules/modal/modal-footer.component.mjs +14 -0
  21. package/esm2020/lib/modules/modal/modal-header.component.mjs +15 -0
  22. package/esm2020/lib/modules/modal/modal-host.component.mjs +96 -0
  23. package/esm2020/lib/modules/modal/modal-host.service.mjs +55 -0
  24. package/esm2020/lib/modules/modal/modal-instance.mjs +100 -0
  25. package/esm2020/lib/modules/modal/modal-scroll-shadow-event-args.mjs +2 -0
  26. package/esm2020/lib/modules/modal/modal-scroll-shadow.directive.mjs +122 -0
  27. package/esm2020/lib/modules/modal/modal-state-animation.mjs +8 -0
  28. package/esm2020/lib/modules/modal/modal.component.mjs +206 -0
  29. package/esm2020/lib/modules/modal/modal.interface.mjs +4 -0
  30. package/esm2020/lib/modules/modal/modal.module.mjs +63 -0
  31. package/esm2020/lib/modules/modal/modal.service.mjs +83 -0
  32. package/esm2020/lib/modules/shared/sky-modals-resources.module.mjs +54 -0
  33. package/esm2020/skyux-modals.mjs +5 -0
  34. package/esm2020/testing/modal-fixture.mjs +168 -0
  35. package/esm2020/testing/public-api.mjs +2 -0
  36. package/esm2020/testing/skyux-modals-testing.mjs +5 -0
  37. package/fesm2015/{skyux-modals-testing.js → skyux-modals-testing.mjs} +1 -1
  38. package/fesm2015/skyux-modals-testing.mjs.map +1 -0
  39. package/fesm2015/skyux-modals.mjs +1189 -0
  40. package/fesm2015/skyux-modals.mjs.map +1 -0
  41. package/{esm2015/testing/modal-fixture.js → fesm2020/skyux-modals-testing.mjs} +8 -2
  42. package/fesm2020/skyux-modals-testing.mjs.map +1 -0
  43. package/{fesm2015/skyux-modals.js → fesm2020/skyux-modals.mjs} +62 -95
  44. package/fesm2020/skyux-modals.mjs.map +1 -0
  45. package/lib/modules/modal/modal.component.d.ts +1 -2
  46. package/lib/modules/modal/modal.service.d.ts +1 -2
  47. package/package.json +38 -14
  48. package/testing/package.json +5 -5
  49. package/bundles/skyux-modals-testing.umd.js +0 -538
  50. package/bundles/skyux-modals.umd.js +0 -1388
  51. package/esm2015/index.js +0 -26
  52. package/esm2015/index.js.map +0 -1
  53. package/esm2015/lib/modules/confirm/confirm-button-action.js +0 -2
  54. package/esm2015/lib/modules/confirm/confirm-button-action.js.map +0 -1
  55. package/esm2015/lib/modules/confirm/confirm-button-config.js +0 -2
  56. package/esm2015/lib/modules/confirm/confirm-button-config.js.map +0 -1
  57. package/esm2015/lib/modules/confirm/confirm-button.js +0 -2
  58. package/esm2015/lib/modules/confirm/confirm-button.js.map +0 -1
  59. package/esm2015/lib/modules/confirm/confirm-closed-event-args.js +0 -2
  60. package/esm2015/lib/modules/confirm/confirm-closed-event-args.js.map +0 -1
  61. package/esm2015/lib/modules/confirm/confirm-config.js +0 -2
  62. package/esm2015/lib/modules/confirm/confirm-config.js.map +0 -1
  63. package/esm2015/lib/modules/confirm/confirm-instance.js +0 -12
  64. package/esm2015/lib/modules/confirm/confirm-instance.js.map +0 -1
  65. package/esm2015/lib/modules/confirm/confirm-modal-context.js +0 -6
  66. package/esm2015/lib/modules/confirm/confirm-modal-context.js.map +0 -1
  67. package/esm2015/lib/modules/confirm/confirm-type.js +0 -24
  68. package/esm2015/lib/modules/confirm/confirm-type.js.map +0 -1
  69. package/esm2015/lib/modules/confirm/confirm.component.js +0 -127
  70. package/esm2015/lib/modules/confirm/confirm.component.js.map +0 -1
  71. package/esm2015/lib/modules/confirm/confirm.module.js +0 -35
  72. package/esm2015/lib/modules/confirm/confirm.module.js.map +0 -1
  73. package/esm2015/lib/modules/confirm/confirm.service.js +0 -54
  74. package/esm2015/lib/modules/confirm/confirm.service.js.map +0 -1
  75. package/esm2015/lib/modules/modal/modal-adapter.service.js +0 -47
  76. package/esm2015/lib/modules/modal/modal-adapter.service.js.map +0 -1
  77. package/esm2015/lib/modules/modal/modal-before-close-handler.js +0 -10
  78. package/esm2015/lib/modules/modal/modal-before-close-handler.js.map +0 -1
  79. package/esm2015/lib/modules/modal/modal-close-args.js +0 -7
  80. package/esm2015/lib/modules/modal/modal-close-args.js.map +0 -1
  81. package/esm2015/lib/modules/modal/modal-component-adapter.service.js +0 -98
  82. package/esm2015/lib/modules/modal/modal-component-adapter.service.js.map +0 -1
  83. package/esm2015/lib/modules/modal/modal-configuration.js +0 -19
  84. package/esm2015/lib/modules/modal/modal-configuration.js.map +0 -1
  85. package/esm2015/lib/modules/modal/modal-content.component.js +0 -19
  86. package/esm2015/lib/modules/modal/modal-content.component.js.map +0 -1
  87. package/esm2015/lib/modules/modal/modal-footer.component.js +0 -18
  88. package/esm2015/lib/modules/modal/modal-footer.component.js.map +0 -1
  89. package/esm2015/lib/modules/modal/modal-header.component.js +0 -19
  90. package/esm2015/lib/modules/modal/modal-header.component.js.map +0 -1
  91. package/esm2015/lib/modules/modal/modal-host.component.js +0 -101
  92. package/esm2015/lib/modules/modal/modal-host.component.js.map +0 -1
  93. package/esm2015/lib/modules/modal/modal-host.service.js +0 -55
  94. package/esm2015/lib/modules/modal/modal-host.service.js.map +0 -1
  95. package/esm2015/lib/modules/modal/modal-instance.js +0 -100
  96. package/esm2015/lib/modules/modal/modal-instance.js.map +0 -1
  97. package/esm2015/lib/modules/modal/modal-scroll-shadow-event-args.js +0 -2
  98. package/esm2015/lib/modules/modal/modal-scroll-shadow-event-args.js.map +0 -1
  99. package/esm2015/lib/modules/modal/modal-scroll-shadow.directive.js +0 -122
  100. package/esm2015/lib/modules/modal/modal-scroll-shadow.directive.js.map +0 -1
  101. package/esm2015/lib/modules/modal/modal-state-animation.js +0 -8
  102. package/esm2015/lib/modules/modal/modal-state-animation.js.map +0 -1
  103. package/esm2015/lib/modules/modal/modal.component.js +0 -213
  104. package/esm2015/lib/modules/modal/modal.component.js.map +0 -1
  105. package/esm2015/lib/modules/modal/modal.interface.js +0 -4
  106. package/esm2015/lib/modules/modal/modal.interface.js.map +0 -1
  107. package/esm2015/lib/modules/modal/modal.module.js +0 -64
  108. package/esm2015/lib/modules/modal/modal.module.js.map +0 -1
  109. package/esm2015/lib/modules/modal/modal.service.js +0 -85
  110. package/esm2015/lib/modules/modal/modal.service.js.map +0 -1
  111. package/esm2015/lib/modules/shared/sky-modals-resources.module.js +0 -54
  112. package/esm2015/lib/modules/shared/sky-modals-resources.module.js.map +0 -1
  113. package/esm2015/skyux-modals.js +0 -5
  114. package/esm2015/skyux-modals.js.map +0 -1
  115. package/esm2015/testing/modal-fixture.js.map +0 -1
  116. package/esm2015/testing/public-api.js +0 -2
  117. package/esm2015/testing/public-api.js.map +0 -1
  118. package/esm2015/testing/skyux-modals-testing.js +0 -5
  119. package/esm2015/testing/skyux-modals-testing.js.map +0 -1
  120. package/fesm2015/skyux-modals-testing.js.map +0 -1
  121. package/fesm2015/skyux-modals.js.map +0 -1
package/esm2015/index.js DELETED
@@ -1,26 +0,0 @@
1
- // TODO: confirm-button is internal and should be removed in a future version
2
- export * from './lib/modules/confirm/confirm-button';
3
- export * from './lib/modules/confirm/confirm-button-action';
4
- export * from './lib/modules/confirm/confirm-button-config';
5
- export * from './lib/modules/confirm/confirm-closed-event-args';
6
- export * from './lib/modules/confirm/confirm-config';
7
- export * from './lib/modules/confirm/confirm-instance';
8
- export * from './lib/modules/confirm/confirm-type';
9
- export * from './lib/modules/confirm/confirm.module';
10
- export * from './lib/modules/confirm/confirm.service';
11
- export * from './lib/modules/modal/modal-before-close-handler';
12
- export * from './lib/modules/modal/modal-close-args';
13
- export * from './lib/modules/modal/modal-configuration';
14
- export * from './lib/modules/modal/modal-host.service';
15
- export * from './lib/modules/modal/modal-instance';
16
- export * from './lib/modules/modal/modal.interface';
17
- export * from './lib/modules/modal/modal.module';
18
- export * from './lib/modules/modal/modal.service';
19
- // Components and directives must be exported to support Angular's "partial" Ivy compiler.
20
- // Obscure names are used to indicate types are not part of the public API.
21
- export { SkyConfirmComponent as λ1 } from './lib/modules/confirm/confirm.component';
22
- export { SkyModalContentComponent as λ2 } from './lib/modules/modal/modal-content.component';
23
- export { SkyModalFooterComponent as λ3 } from './lib/modules/modal/modal-footer.component';
24
- export { SkyModalHeaderComponent as λ4 } from './lib/modules/modal/modal-header.component';
25
- export { SkyModalComponent as λ5 } from './lib/modules/modal/modal.component';
26
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/components/modals/src/index.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,cAAc,sCAAsC,CAAC;AACrD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iDAAiD,CAAC;AAChE,cAAc,sCAAsC,CAAC;AACrD,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AAEtD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC;AACxD,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAElD,0FAA0F;AAC1F,2EAA2E;AAC3E,OAAO,EAAE,mBAAmB,IAAI,EAAE,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,wBAAwB,IAAI,EAAE,EAAE,MAAM,6CAA6C,CAAC;AAC7F,OAAO,EAAE,uBAAuB,IAAI,EAAE,EAAE,MAAM,4CAA4C,CAAC;AAC3F,OAAO,EAAE,uBAAuB,IAAI,EAAE,EAAE,MAAM,4CAA4C,CAAC;AAC3F,OAAO,EAAE,iBAAiB,IAAI,EAAE,EAAE,MAAM,qCAAqC,CAAC","sourcesContent":["// TODO: confirm-button is internal and should be removed in a future version\nexport * from './lib/modules/confirm/confirm-button';\nexport * from './lib/modules/confirm/confirm-button-action';\nexport * from './lib/modules/confirm/confirm-button-config';\nexport * from './lib/modules/confirm/confirm-closed-event-args';\nexport * from './lib/modules/confirm/confirm-config';\nexport * from './lib/modules/confirm/confirm-instance';\nexport * from './lib/modules/confirm/confirm-type';\nexport * from './lib/modules/confirm/confirm.module';\nexport * from './lib/modules/confirm/confirm.service';\n\nexport * from './lib/modules/modal/modal-before-close-handler';\nexport * from './lib/modules/modal/modal-close-args';\nexport * from './lib/modules/modal/modal-configuration';\nexport * from './lib/modules/modal/modal-host.service';\nexport * from './lib/modules/modal/modal-instance';\nexport * from './lib/modules/modal/modal.interface';\nexport * from './lib/modules/modal/modal.module';\nexport * from './lib/modules/modal/modal.service';\n\n// Components and directives must be exported to support Angular's \"partial\" Ivy compiler.\n// Obscure names are used to indicate types are not part of the public API.\nexport { SkyConfirmComponent as λ1 } from './lib/modules/confirm/confirm.component';\nexport { SkyModalContentComponent as λ2 } from './lib/modules/modal/modal-content.component';\nexport { SkyModalFooterComponent as λ3 } from './lib/modules/modal/modal-footer.component';\nexport { SkyModalHeaderComponent as λ4 } from './lib/modules/modal/modal-header.component';\nexport { SkyModalComponent as λ5 } from './lib/modules/modal/modal.component';\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=confirm-button-action.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirm-button-action.js","sourceRoot":"","sources":["../../../../../../../../libs/components/modals/src/lib/modules/confirm/confirm-button-action.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @internal\n */\nexport type SkyConfirmButtonAction = 'ok' | 'yes' | 'no' | 'cancel';\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=confirm-button-config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirm-button-config.js","sourceRoot":"","sources":["../../../../../../../../libs/components/modals/src/lib/modules/confirm/confirm-button-config.ts"],"names":[],"mappings":"","sourcesContent":["export interface SkyConfirmButtonConfig {\n /**\n * Specifies an identifier to return when users select the button to close the\n * dialog. This is useful to determine which button users select.\n */\n action: string;\n /**\n * Specifies the label for the button.\n */\n text: string;\n /**\n * Specifies a style to apply to the button. The valid options are `primary` for\n * the button that triggers the recommended or most-common action, `default` for\n * buttons that trigger less-common actions, and `link` for a button that\n * closes the dialog.\n */\n styleType?: 'primary' | 'default' | 'link' | string;\n /**\n * Indicates whether to place focus on this button by default.\n */\n autofocus?: boolean;\n}\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=confirm-button.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirm-button.js","sourceRoot":"","sources":["../../../../../../../../libs/components/modals/src/lib/modules/confirm/confirm-button.ts"],"names":[],"mappings":"","sourcesContent":["import { SkyConfirmButtonAction } from './confirm-button-action';\n\n/**\n * The view model for button configuration that the confirm component uses.\n * @internal\n */\nexport interface SkyConfirmButton {\n action: SkyConfirmButtonAction;\n styleType: string;\n text: string;\n autofocus?: boolean;\n}\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=confirm-closed-event-args.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirm-closed-event-args.js","sourceRoot":"","sources":["../../../../../../../../libs/components/modals/src/lib/modules/confirm/confirm-closed-event-args.ts"],"names":[],"mappings":"","sourcesContent":["export interface SkyConfirmCloseEventArgs {\n /**\n * The identifier for the button that users selected to close the dialog.\n */\n action: string;\n}\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=confirm-config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirm-config.js","sourceRoot":"","sources":["../../../../../../../../libs/components/modals/src/lib/modules/confirm/confirm-config.ts"],"names":[],"mappings":"","sourcesContent":["import { SkyConfirmButtonConfig } from './confirm-button-config';\nimport { SkyConfirmType } from './confirm-type';\n\nexport interface SkyConfirmConfig {\n /**\n * Specifies the message to display in bold at the top of the dialog.\n * @required\n */\n message: string;\n /**\n * Specifies secondary text to display under the primary message.\n */\n body?: string;\n /**\n * Specifies a list of buttons to display when the `type` property is set to `SkyConfirmType.Custom`.\n */\n buttons?: SkyConfirmButtonConfig[];\n /**\n * Indicates whether to preserve whitespace and new lines inside the dialog.\n * @default false\n */\n preserveWhiteSpace?: boolean;\n /**\n * Specifies a preset button configuration for the dialog.\n */\n type?: SkyConfirmType;\n}\n"]}
@@ -1,12 +0,0 @@
1
- import { EventEmitter } from '@angular/core';
2
- export class SkyConfirmInstance {
3
- constructor() {
4
- /**
5
- * Fires when users select an action to close the dialog. This event
6
- * returns a `SkyConfirmCloseEventArgs` object with information about the button that
7
- * users select. It returns the `'cancel'` action when users press the <kbd>Escape</kbd> key.
8
- */
9
- this.closed = new EventEmitter();
10
- }
11
- }
12
- //# sourceMappingURL=confirm-instance.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirm-instance.js","sourceRoot":"","sources":["../../../../../../../../libs/components/modals/src/lib/modules/confirm/confirm-instance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAI7C,MAAM,OAAO,kBAAkB;IAA/B;QACE;;;;WAIG;QACI,WAAM,GAAG,IAAI,YAAY,EAA4B,CAAC;IAC/D,CAAC;CAAA","sourcesContent":["import { EventEmitter } from '@angular/core';\n\nimport { SkyConfirmCloseEventArgs } from './confirm-closed-event-args';\n\nexport class SkyConfirmInstance {\n /**\n * Fires when users select an action to close the dialog. This event\n * returns a `SkyConfirmCloseEventArgs` object with information about the button that\n * users select. It returns the `'cancel'` action when users press the <kbd>Escape</kbd> key.\n */\n public closed = new EventEmitter<SkyConfirmCloseEventArgs>();\n}\n"]}
@@ -1,6 +0,0 @@
1
- /**
2
- * @internal
3
- */
4
- export class SkyConfirmModalContext {
5
- }
6
- //# sourceMappingURL=confirm-modal-context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirm-modal-context.js","sourceRoot":"","sources":["../../../../../../../../libs/components/modals/src/lib/modules/confirm/confirm-modal-context.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,OAAO,sBAAsB;CAMlC","sourcesContent":["import { SkyConfirmButtonConfig } from './confirm-button-config';\nimport { SkyConfirmConfig } from './confirm-config';\nimport { SkyConfirmType } from './confirm-type';\n\n/**\n * @internal\n */\nexport class SkyConfirmModalContext implements SkyConfirmConfig {\n public message: string;\n public body: string;\n public buttons: SkyConfirmButtonConfig[];\n public preserveWhiteSpace: boolean;\n public type: SkyConfirmType;\n}\n"]}
@@ -1,24 +0,0 @@
1
- export var SkyConfirmType;
2
- (function (SkyConfirmType) {
3
- /**
4
- * Allows you to define your own buttons using the `buttons` property of `SkyConfirmConfig`.
5
- */
6
- SkyConfirmType[SkyConfirmType["Custom"] = 0] = "Custom";
7
- /**
8
- * Displays one button with an **OK** label and an `'ok'` action.
9
- */
10
- SkyConfirmType[SkyConfirmType["OK"] = 1] = "OK";
11
- /**
12
- * Displays two buttons with **Yes** and **Cancel** labels.
13
- * @deprecated Use the `Custom` type to follow the guidance that labels
14
- * should clearly indicate the actions that occur when users select buttons.
15
- */
16
- SkyConfirmType[SkyConfirmType["YesCancel"] = 2] = "YesCancel";
17
- /**
18
- * Displays three buttons with **Yes**, **No**, and **Cancel** labels.
19
- * @deprecated Use the `Custom` type to follow the guidance that labels
20
- * should clearly indicate the actions that occur when users select buttons.
21
- */
22
- SkyConfirmType[SkyConfirmType["YesNoCancel"] = 3] = "YesNoCancel";
23
- })(SkyConfirmType || (SkyConfirmType = {}));
24
- //# sourceMappingURL=confirm-type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirm-type.js","sourceRoot":"","sources":["../../../../../../../../libs/components/modals/src/lib/modules/confirm/confirm-type.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,cAqBX;AArBD,WAAY,cAAc;IACxB;;OAEG;IACH,uDAAU,CAAA;IACV;;OAEG;IACH,+CAAM,CAAA;IACN;;;;OAIG;IACH,6DAAa,CAAA;IACb;;;;OAIG;IACH,iEAAe,CAAA;AACjB,CAAC,EArBW,cAAc,KAAd,cAAc,QAqBzB","sourcesContent":["export enum SkyConfirmType {\n /**\n * Allows you to define your own buttons using the `buttons` property of `SkyConfirmConfig`.\n */\n Custom = 0,\n /**\n * Displays one button with an **OK** label and an `'ok'` action.\n */\n OK = 1,\n /**\n * Displays two buttons with **Yes** and **Cancel** labels.\n * @deprecated Use the `Custom` type to follow the guidance that labels\n * should clearly indicate the actions that occur when users select buttons.\n */\n YesCancel = 2,\n /**\n * Displays three buttons with **Yes**, **No**, and **Cancel** labels.\n * @deprecated Use the `Custom` type to follow the guidance that labels\n * should clearly indicate the actions that occur when users select buttons.\n */\n YesNoCancel = 3,\n}\n"]}
@@ -1,127 +0,0 @@
1
- import { Component, Optional } from '@angular/core';
2
- import { SkyLibResourcesService } from '@skyux/i18n';
3
- import { BehaviorSubject, zip as observableZip } from 'rxjs';
4
- import { SkyModalInstance } from '../modal/modal-instance';
5
- import { SkyConfirmModalContext } from './confirm-modal-context';
6
- import { SkyConfirmType } from './confirm-type';
7
- import * as i0 from "@angular/core";
8
- import * as i1 from "./confirm-modal-context";
9
- import * as i2 from "../modal/modal-instance";
10
- import * as i3 from "@skyux/i18n";
11
- import * as i4 from "../modal/modal.component";
12
- import * as i5 from "../modal/modal-content.component";
13
- import * as i6 from "@angular/common";
14
- import * as i7 from "@skyux/theme";
15
- export class SkyConfirmComponent {
16
- constructor(config, modal, resourcesService) {
17
- this.config = config;
18
- this.modal = modal;
19
- this.resourcesService = resourcesService;
20
- this.preserveWhiteSpace = false;
21
- }
22
- ngOnInit() {
23
- if (this.config.type === SkyConfirmType.Custom &&
24
- this.config.buttons.length > 0) {
25
- this.buttons = this.getCustomButtons(this.config.buttons);
26
- }
27
- else {
28
- this.getPresetButtons().subscribe((buttons) => {
29
- this.buttons = buttons;
30
- });
31
- }
32
- this.message = this.config.message;
33
- this.body = this.config.body;
34
- this.preserveWhiteSpace = this.config.preserveWhiteSpace || false;
35
- }
36
- close(button) {
37
- const result = {
38
- action: button.action,
39
- };
40
- this.modal.close(result);
41
- }
42
- getPresetButtons() {
43
- const emitter = new BehaviorSubject([]);
44
- switch (this.config.type) {
45
- default:
46
- case SkyConfirmType.OK:
47
- this.resourcesService
48
- .getString('skyux_confirm_dialog_default_ok_text')
49
- .subscribe((value) => {
50
- emitter.next([
51
- {
52
- text: value,
53
- autofocus: true,
54
- styleType: 'primary',
55
- action: 'ok',
56
- },
57
- ]);
58
- });
59
- break;
60
- case SkyConfirmType.YesNoCancel:
61
- observableZip(this.resourcesService.getString('skyux_confirm_dialog_default_yes_text'), this.resourcesService.getString('skyux_confirm_dialog_default_no_text'), this.resourcesService.getString('skyux_confirm_dialog_default_cancel_text')).subscribe((values) => {
62
- emitter.next([
63
- {
64
- text: values[0],
65
- autofocus: true,
66
- styleType: 'primary',
67
- action: 'yes',
68
- },
69
- {
70
- text: values[1],
71
- styleType: 'default',
72
- action: 'no',
73
- },
74
- {
75
- text: values[2],
76
- styleType: 'link',
77
- action: 'cancel',
78
- },
79
- ]);
80
- });
81
- break;
82
- case SkyConfirmType.YesCancel:
83
- observableZip(this.resourcesService.getString('skyux_confirm_dialog_default_yes_text'), this.resourcesService.getString('skyux_confirm_dialog_default_cancel_text')).subscribe((values) => {
84
- emitter.next([
85
- {
86
- text: values[0],
87
- autofocus: true,
88
- styleType: 'primary',
89
- action: 'yes',
90
- },
91
- {
92
- text: values[1],
93
- styleType: 'link',
94
- action: 'cancel',
95
- },
96
- ]);
97
- });
98
- break;
99
- }
100
- return emitter;
101
- }
102
- getCustomButtons(buttonConfig) {
103
- const buttons = [];
104
- buttonConfig.forEach((config) => {
105
- buttons.push({
106
- text: config.text,
107
- action: config.action,
108
- styleType: config.styleType || 'default',
109
- autofocus: config.autofocus || false,
110
- });
111
- });
112
- return buttons;
113
- }
114
- }
115
- SkyConfirmComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyConfirmComponent, deps: [{ token: i1.SkyConfirmModalContext }, { token: i2.SkyModalInstance }, { token: i3.SkyLibResourcesService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
116
- SkyConfirmComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyConfirmComponent, selector: "sky-confirm", ngImport: i0, template: "<div class=\"sky-confirm\">\n <sky-modal ariaRole=\"alertdialog\">\n <sky-modal-content class=\"sky-confirm-content\">\n <div\n class=\"sky-confirm-message\"\n [ngClass]=\"{\n 'sky-confirm-preserve-white-space': preserveWhiteSpace\n }\"\n [skyThemeClass]=\"{\n 'sky-emphasized': 'default',\n 'sky-font-heading-1 sky-font-display-3': 'modern'\n }\"\n >\n {{ message }}\n </div>\n\n <div\n *ngIf=\"body\"\n class=\"sky-confirm-body\"\n [ngClass]=\"{\n 'sky-confirm-preserve-white-space': preserveWhiteSpace\n }\"\n >\n {{ body }}\n </div>\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-message{margin-top:5px}.sky-confirm-body{margin-top:10px}.sky-confirm-buttons{margin-top:20px}.sky-confirm-preserve-white-space{white-space:pre-wrap}:host-context(.sky-theme-modern) .sky-confirm-content{padding:20px 30px}:host-context(.sky-theme-modern) .sky-confirm-message{padding-bottom:20px}:host-context(.sky-theme-modern) .sky-confirm-body{margin:0}.sky-theme-modern .sky-confirm-content{padding:20px 30px}.sky-theme-modern .sky-confirm-message{padding-bottom:20px}.sky-theme-modern .sky-confirm-body{margin:0}:host-context(.sky-theme-modern.sky-theme-mode-dark) .sky-confirm-message{color:#fbfcfe}.sky-theme-modern.sky-theme-mode-dark .sky-confirm-message{color:#fbfcfe}\n"], components: [{ type: i4.SkyModalComponent, selector: "sky-modal", inputs: ["ariaRole", "tiledBody"] }, { type: i5.SkyModalContentComponent, selector: "sky-modal-content" }], directives: [{ type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i7.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
117
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyConfirmComponent, decorators: [{
118
- type: Component,
119
- args: [{
120
- selector: 'sky-confirm',
121
- templateUrl: './confirm.component.html',
122
- styleUrls: ['./confirm.component.scss'],
123
- }]
124
- }], ctorParameters: function () { return [{ type: i1.SkyConfirmModalContext }, { type: i2.SkyModalInstance }, { type: i3.SkyLibResourcesService, decorators: [{
125
- type: Optional
126
- }] }]; } });
127
- //# sourceMappingURL=confirm.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirm.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/modals/src/lib/modules/confirm/confirm.component.ts","../../../../../../../../libs/components/modals/src/lib/modules/confirm/confirm.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAU,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,eAAe,EAAc,GAAG,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAEzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAK3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;;;;;;;;;AAOhD,MAAM,OAAO,mBAAmB;IAM9B,YACU,MAA8B,EAC9B,KAAuB,EACX,gBAAwC;QAFpD,WAAM,GAAN,MAAM,CAAwB;QAC9B,UAAK,GAAL,KAAK,CAAkB;QACX,qBAAgB,GAAhB,gBAAgB,CAAwB;QALvD,uBAAkB,GAAG,KAAK,CAAC;IAM/B,CAAC;IAEG,QAAQ;QACb,IACE,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC,MAAM;YAC1C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAC9B;YACA,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CA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,IAAI,CAAC;gBACX,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,SAAS;gBACxC,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,KAAK;aACjB,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC;IACjB,CAAC;;iHAtIU,mBAAmB;qGAAnB,mBAAmB,mDClBhC,iwCA6CA;4FD3Ba,mBAAmB;kBAL/B,SAAS;mBAAC;oBACT,QAAQ,EAAE,aAAa;oBACvB,WAAW,EAAE,0BAA0B;oBACvC,SAAS,EAAE,CAAC,0BAA0B,CAAC;iBACxC;;0BAUI,QAAQ","sourcesContent":["import { Component, OnInit, Optional } from '@angular/core';\nimport { SkyLibResourcesService } from '@skyux/i18n';\n\nimport { BehaviorSubject, Observable, zip as observableZip } from 'rxjs';\n\nimport { SkyModalInstance } from '../modal/modal-instance';\n\nimport { SkyConfirmButton } from './confirm-button';\nimport { SkyConfirmButtonConfig } from './confirm-button-config';\nimport { SkyConfirmCloseEventArgs } from './confirm-closed-event-args';\nimport { SkyConfirmModalContext } from './confirm-modal-context';\nimport { SkyConfirmType } from './confirm-type';\n\n@Component({\n selector: 'sky-confirm',\n templateUrl: './confirm.component.html',\n styleUrls: ['./confirm.component.scss'],\n})\nexport class SkyConfirmComponent implements OnInit {\n public buttons: SkyConfirmButton[];\n public message: string;\n public body: string;\n public preserveWhiteSpace = false;\n\n constructor(\n private config: SkyConfirmModalContext,\n private modal: SkyModalInstance,\n @Optional() private resourcesService: SkyLibResourcesService\n ) {}\n\n public ngOnInit() {\n if (\n this.config.type === SkyConfirmType.Custom &&\n this.config.buttons.length > 0\n ) {\n this.buttons = this.getCustomButtons(this.config.buttons);\n } else {\n this.getPresetButtons().subscribe((buttons: SkyConfirmButton[]) => {\n this.buttons = buttons;\n });\n }\n\n this.message = this.config.message;\n this.body = this.config.body;\n this.preserveWhiteSpace = this.config.preserveWhiteSpace || false;\n }\n\n public close(button: SkyConfirmButton) {\n const result: SkyConfirmCloseEventArgs = {\n action: button.action,\n };\n\n this.modal.close(result);\n }\n\n private getPresetButtons(): Observable<SkyConfirmButton[]> {\n const emitter = new BehaviorSubject<SkyConfirmButton[]>([]);\n\n switch (this.config.type) {\n default:\n case SkyConfirmType.OK:\n this.resourcesService\n .getString('skyux_confirm_dialog_default_ok_text')\n .subscribe((value: string) => {\n emitter.next([\n {\n text: value,\n autofocus: true,\n styleType: 'primary',\n action: 'ok',\n },\n ]);\n });\n break;\n\n case SkyConfirmType.YesNoCancel:\n observableZip(\n this.resourcesService.getString(\n 'skyux_confirm_dialog_default_yes_text'\n ),\n this.resourcesService.getString(\n 'skyux_confirm_dialog_default_no_text'\n ),\n this.resourcesService.getString(\n 'skyux_confirm_dialog_default_cancel_text'\n )\n ).subscribe((values: any) => {\n emitter.next([\n {\n text: values[0],\n autofocus: true,\n styleType: 'primary',\n action: 'yes',\n },\n {\n text: values[1],\n styleType: 'default',\n action: 'no',\n },\n {\n text: values[2],\n styleType: 'link',\n action: 'cancel',\n },\n ]);\n });\n break;\n\n case SkyConfirmType.YesCancel:\n observableZip(\n this.resourcesService.getString(\n 'skyux_confirm_dialog_default_yes_text'\n ),\n this.resourcesService.getString(\n 'skyux_confirm_dialog_default_cancel_text'\n )\n ).subscribe((values: any) => {\n emitter.next([\n {\n text: values[0],\n autofocus: true,\n styleType: 'primary',\n action: 'yes',\n },\n {\n text: values[1],\n styleType: 'link',\n action: 'cancel',\n },\n ]);\n });\n break;\n }\n\n return emitter;\n }\n\n private getCustomButtons(\n buttonConfig: SkyConfirmButtonConfig[]\n ): SkyConfirmButton[] {\n const buttons: SkyConfirmButton[] = [];\n\n buttonConfig.forEach((config: SkyConfirmButtonConfig) => {\n buttons.push({\n text: config.text,\n action: config.action,\n styleType: config.styleType || 'default',\n autofocus: config.autofocus || false,\n } as SkyConfirmButton);\n });\n\n return buttons;\n }\n}\n","<div class=\"sky-confirm\">\n <sky-modal ariaRole=\"alertdialog\">\n <sky-modal-content class=\"sky-confirm-content\">\n <div\n class=\"sky-confirm-message\"\n [ngClass]=\"{\n 'sky-confirm-preserve-white-space': preserveWhiteSpace\n }\"\n [skyThemeClass]=\"{\n 'sky-emphasized': 'default',\n 'sky-font-heading-1 sky-font-display-3': 'modern'\n }\"\n >\n {{ message }}\n </div>\n\n <div\n *ngIf=\"body\"\n class=\"sky-confirm-body\"\n [ngClass]=\"{\n 'sky-confirm-preserve-white-space': preserveWhiteSpace\n }\"\n >\n {{ body }}\n </div>\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"]}
@@ -1,35 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import { NgModule } from '@angular/core';
3
- import { SkyThemeModule } from '@skyux/theme';
4
- import { SkyModalModule } from '../modal/modal.module';
5
- import { SkyModalsResourcesModule } from '../shared/sky-modals-resources.module';
6
- import { SkyConfirmComponent } from './confirm.component';
7
- import * as i0 from "@angular/core";
8
- export class SkyConfirmModule {
9
- }
10
- SkyConfirmModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyConfirmModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
11
- SkyConfirmModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyConfirmModule, declarations: [SkyConfirmComponent], imports: [CommonModule,
12
- SkyModalModule,
13
- SkyModalsResourcesModule,
14
- SkyThemeModule], exports: [SkyConfirmComponent] });
15
- SkyConfirmModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyConfirmModule, imports: [[
16
- CommonModule,
17
- SkyModalModule,
18
- SkyModalsResourcesModule,
19
- SkyThemeModule,
20
- ]] });
21
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyConfirmModule, decorators: [{
22
- type: NgModule,
23
- args: [{
24
- declarations: [SkyConfirmComponent],
25
- imports: [
26
- CommonModule,
27
- SkyModalModule,
28
- SkyModalsResourcesModule,
29
- SkyThemeModule,
30
- ],
31
- exports: [SkyConfirmComponent],
32
- entryComponents: [SkyConfirmComponent],
33
- }]
34
- }] });
35
- //# sourceMappingURL=confirm.module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirm.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/modals/src/lib/modules/confirm/confirm.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAEjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;;AAa1D,MAAM,OAAO,gBAAgB;;8GAAhB,gBAAgB;+GAAhB,gBAAgB,iBAVZ,mBAAmB,aAEhC,YAAY;QACZ,cAAc;QACd,wBAAwB;QACxB,cAAc,aAEN,mBAAmB;+GAGlB,gBAAgB,YATlB;YACP,YAAY;YACZ,cAAc;YACd,wBAAwB;YACxB,cAAc;SACf;4FAIU,gBAAgB;kBAX5B,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,mBAAmB,CAAC;oBACnC,OAAO,EAAE;wBACP,YAAY;wBACZ,cAAc;wBACd,wBAAwB;wBACxB,cAAc;qBACf;oBACD,OAAO,EAAE,CAAC,mBAAmB,CAAC;oBAC9B,eAAe,EAAE,CAAC,mBAAmB,CAAC;iBACvC","sourcesContent":["import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { SkyThemeModule } from '@skyux/theme';\n\nimport { SkyModalModule } from '../modal/modal.module';\nimport { SkyModalsResourcesModule } from '../shared/sky-modals-resources.module';\n\nimport { SkyConfirmComponent } from './confirm.component';\n\n@NgModule({\n declarations: [SkyConfirmComponent],\n imports: [\n CommonModule,\n SkyModalModule,\n SkyModalsResourcesModule,\n SkyThemeModule,\n ],\n exports: [SkyConfirmComponent],\n entryComponents: [SkyConfirmComponent],\n})\nexport class SkyConfirmModule {}\n"]}
@@ -1,54 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { SkyModalService } from '../modal/modal.service';
3
- import { SkyConfirmInstance } from './confirm-instance';
4
- import { SkyConfirmModalContext } from './confirm-modal-context';
5
- import { SkyConfirmComponent } from './confirm.component';
6
- import * as i0 from "@angular/core";
7
- import * as i1 from "../modal/modal.service";
8
- /**
9
- * Launches a dialog.
10
- */
11
- export class SkyConfirmService {
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: SkyConfirmModalContext,
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
- }
43
- SkyConfirmService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyConfirmService, deps: [{ token: i1.SkyModalService }], target: i0.ɵɵFactoryTarget.Injectable });
44
- SkyConfirmService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyConfirmService, providedIn: 'any' });
45
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", 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=confirm.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirm.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/modals/src/lib/modules/confirm/confirm.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAIzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;;;AAE1D;;GAEG;AAOH,MAAM,OAAO,iBAAiB;IAC5B,YAAoB,YAA6B;QAA7B,iBAAY,GAAZ,YAAY,CAAiB;IAAG,CAAC;IAErD;;;OAGG;IACI,IAAI,CAAC,MAAwB;QAClC,MAAM,aAAa,GAAqB,IAAI,CAAC,YAAY,CAAC,IAAI,CAC5D,mBAAmB,EACnB;YACE,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,sBAAsB;oBAC/B,QAAQ,EAAE,MAAM;iBACjB;aACF;SACF,CACF,CAAC;QAEF,MAAM,eAAe,GAAG,IAAI,kBAAkB,EAAE,CAAC;QAEjD,aAAa,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAuB,EAAE,EAAE;YACzD,IAAI,MAAM,GAA6B,IAAI,CAAC,IAAI,CAAC;YAEjD,0CAA0C;YAC1C,IAAI,MAAM,KAAK,SAAS,EAAE;gBACxB,MAAM,GAAG;oBACP,MAAM,EAAE,QAAQ;iBACjB,CAAC;aACH;YAED,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACpC,eAAe,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpC,CAAC,CAAC,CAAC;QAEH,OAAO,eAAe,CAAC;IACzB,CAAC;;+GArCU,iBAAiB;mHAAjB,iBAAiB,cAFhB,KAAK;4FAEN,iBAAiB;kBAN7B,UAAU;mBAAC;oBACV,gGAAgG;oBAChG,8FAA8F;oBAC9F,2FAA2F;oBAC3F,UAAU,EAAE,KAAK;iBAClB","sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { SkyModalCloseArgs } from '../modal/modal-close-args';\nimport { SkyModalInstance } from '../modal/modal-instance';\nimport { SkyModalService } from '../modal/modal.service';\n\nimport { SkyConfirmCloseEventArgs } from './confirm-closed-event-args';\nimport { SkyConfirmConfig } from './confirm-config';\nimport { SkyConfirmInstance } from './confirm-instance';\nimport { SkyConfirmModalContext } from './confirm-modal-context';\nimport { SkyConfirmComponent } from './confirm.component';\n\n/**\n * Launches a dialog.\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 SkyConfirmService {\n constructor(private modalService: SkyModalService) {}\n\n /**\n * Opens a dialog using the specified options.\n * @param config Specifies configuration options for the dialog.\n */\n public open(config: SkyConfirmConfig): SkyConfirmInstance {\n const modalInstance: SkyModalInstance = this.modalService.open(\n SkyConfirmComponent,\n {\n providers: [\n {\n provide: SkyConfirmModalContext,\n useValue: config,\n },\n ],\n }\n );\n\n const confirmInstance = new SkyConfirmInstance();\n\n modalInstance.closed.subscribe((args: SkyModalCloseArgs) => {\n let result: SkyConfirmCloseEventArgs = args.data;\n\n // The modal was closed using the ESC key.\n if (result === undefined) {\n result = {\n action: 'cancel',\n };\n }\n\n confirmInstance.closed.emit(result);\n confirmInstance.closed.complete();\n });\n\n return confirmInstance;\n }\n}\n"]}
@@ -1,47 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { SkyAppWindowRef } from '@skyux/core';
3
- import * as i0 from "@angular/core";
4
- import * as i1 from "@skyux/core";
5
- /**
6
- * @internal
7
- */
8
- export class SkyModalAdapterService {
9
- constructor(windowRef) {
10
- this.windowRef = windowRef;
11
- this.docRef = this.windowRef.nativeWindow.document;
12
- this.bodyEl = this.windowRef.nativeWindow.document.body;
13
- }
14
- toggleFullPageModalClass(isAddFull) {
15
- if (isAddFull) {
16
- this.addClassToBody(SkyModalAdapterService.MODAL_BODY_FULL_CLASS);
17
- }
18
- else {
19
- this.removeClassFromBody(SkyModalAdapterService.MODAL_BODY_FULL_CLASS);
20
- }
21
- }
22
- setPageScroll(isAdd) {
23
- if (isAdd) {
24
- this.addClassToBody(SkyModalAdapterService.MODAL_BODY_CLASS);
25
- }
26
- else {
27
- this.removeClassFromBody(SkyModalAdapterService.MODAL_BODY_CLASS);
28
- }
29
- }
30
- getModalOpener() {
31
- return this.docRef.activeElement;
32
- }
33
- addClassToBody(className) {
34
- this.bodyEl.classList.add(className);
35
- }
36
- removeClassFromBody(className) {
37
- this.bodyEl.classList.remove(className);
38
- }
39
- }
40
- SkyModalAdapterService.MODAL_BODY_FULL_CLASS = 'sky-modal-body-full-page';
41
- SkyModalAdapterService.MODAL_BODY_CLASS = 'sky-modal-body-open';
42
- SkyModalAdapterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyModalAdapterService, deps: [{ token: i1.SkyAppWindowRef }], target: i0.ɵɵFactoryTarget.Injectable });
43
- SkyModalAdapterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyModalAdapterService });
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyModalAdapterService, decorators: [{
45
- type: Injectable
46
- }], ctorParameters: function () { return [{ type: i1.SkyAppWindowRef }]; } });
47
- //# sourceMappingURL=modal-adapter.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"modal-adapter.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/modals/src/lib/modules/modal/modal-adapter.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;;;AAE9C;;GAEG;AAEH,MAAM,OAAO,sBAAsB;IAOjC,YAAoB,SAA0B;QAA1B,cAAS,GAAT,SAAS,CAAiB;QAC5C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,QAAQ,CAAC;QACnD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC1D,CAAC;IAEM,wBAAwB,CAAC,SAAkB;QAChD,IAAI,SAAS,EAAE;YACb,IAAI,CAAC,cAAc,CAAC,sBAAsB,CAAC,qBAAqB,CAAC,CAAC;SACnE;aAAM;YACL,IAAI,CAAC,mBAAmB,CAAC,sBAAsB,CAAC,qBAAqB,CAAC,CAAC;SACxE;IACH,CAAC;IAEM,aAAa,CAAC,KAAc;QACjC,IAAI,KAAK,EAAE;YACT,IAAI,CAAC,cAAc,CAAC,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;SAC9D;aAAM;YACL,IAAI,CAAC,mBAAmB,CAAC,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;SACnE;IACH,CAAC;IAEM,cAAc;QACnB,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;IACnC,CAAC;IAEO,cAAc,CAAC,SAAiB;QACtC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;IAEO,mBAAmB,CAAC,SAAiB;QAC3C,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAC1C,CAAC;;AArCuB,4CAAqB,GAAG,0BAA0B,CAAC;AACnD,uCAAgB,GAAG,qBAAqB,CAAC;oHAFtD,sBAAsB;wHAAtB,sBAAsB;4FAAtB,sBAAsB;kBADlC,UAAU","sourcesContent":["import { Injectable } from '@angular/core';\nimport { SkyAppWindowRef } from '@skyux/core';\n\n/**\n * @internal\n */\n@Injectable()\nexport class SkyModalAdapterService {\n private static readonly MODAL_BODY_FULL_CLASS = 'sky-modal-body-full-page';\n private static readonly MODAL_BODY_CLASS = 'sky-modal-body-open';\n\n private docRef: any;\n private bodyEl: HTMLElement;\n\n constructor(private windowRef: SkyAppWindowRef) {\n this.docRef = this.windowRef.nativeWindow.document;\n this.bodyEl = this.windowRef.nativeWindow.document.body;\n }\n\n public toggleFullPageModalClass(isAddFull: boolean): void {\n if (isAddFull) {\n this.addClassToBody(SkyModalAdapterService.MODAL_BODY_FULL_CLASS);\n } else {\n this.removeClassFromBody(SkyModalAdapterService.MODAL_BODY_FULL_CLASS);\n }\n }\n\n public setPageScroll(isAdd: boolean): void {\n if (isAdd) {\n this.addClassToBody(SkyModalAdapterService.MODAL_BODY_CLASS);\n } else {\n this.removeClassFromBody(SkyModalAdapterService.MODAL_BODY_CLASS);\n }\n }\n\n public getModalOpener(): HTMLElement {\n return this.docRef.activeElement;\n }\n\n private addClassToBody(className: string): void {\n this.bodyEl.classList.add(className);\n }\n\n private removeClassFromBody(className: string): void {\n this.bodyEl.classList.remove(className);\n }\n}\n"]}
@@ -1,10 +0,0 @@
1
- /**
2
- * Closes the modal instance using the `closeModal` method.
3
- */
4
- export class SkyModalBeforeCloseHandler {
5
- constructor(closeModal, closeArgs) {
6
- this.closeModal = closeModal;
7
- this.closeArgs = closeArgs;
8
- }
9
- }
10
- //# sourceMappingURL=modal-before-close-handler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"modal-before-close-handler.js","sourceRoot":"","sources":["../../../../../../../../libs/components/modals/src/lib/modules/modal/modal-before-close-handler.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,OAAO,0BAA0B;IACrC,YACkB,UAAoB,EACpB,SAA4B;QAD5B,eAAU,GAAV,UAAU,CAAU;QACpB,cAAS,GAAT,SAAS,CAAmB;IAC3C,CAAC;CACL","sourcesContent":["import { SkyModalCloseArgs } from './modal-close-args';\n\n/**\n * Closes the modal instance using the `closeModal` method.\n */\nexport class SkyModalBeforeCloseHandler {\n constructor(\n public readonly closeModal: Function,\n public readonly closeArgs: SkyModalCloseArgs\n ) {}\n}\n"]}
@@ -1,7 +0,0 @@
1
- /**
2
- * Contains an object with the data passed from users when
3
- * a modal is closed and the reason that the modal was closed.
4
- */
5
- export class SkyModalCloseArgs {
6
- }
7
- //# sourceMappingURL=modal-close-args.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"modal-close-args.js","sourceRoot":"","sources":["../../../../../../../../libs/components/modals/src/lib/modules/modal/modal-close-args.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,OAAO,iBAAiB;CAU7B","sourcesContent":["/**\n * Contains an object with the data passed from users when\n * a modal is closed and the reason that the modal was closed.\n */\nexport class SkyModalCloseArgs {\n /**\n * Indicates the reason the modal was closed.\n * Options include `\"close\"`, `\"save\"`, and `\"cancel\"`.\n */\n public reason: string;\n /**\n * The data passed from users when the modal is closed.\n */\n public data: any;\n}\n"]}
@@ -1,98 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { SkyCoreAdapterService } from '@skyux/core';
3
- import * as i0 from "@angular/core";
4
- import * as i1 from "@skyux/core";
5
- /**
6
- * @internal
7
- */
8
- export class SkyModalComponentAdapterService {
9
- constructor(coreAdapter) {
10
- this.coreAdapter = coreAdapter;
11
- }
12
- handleWindowChange(modalEl) {
13
- const boundedHeightEl = modalEl.nativeElement.querySelector('.sky-modal');
14
- const fullPageModalEl = modalEl.nativeElement.querySelector('.sky-modal-full-page');
15
- /*
16
- Set modal height equal to max height of window (accounting for padding above and below modal)
17
- */
18
- const newHeight = window.innerHeight - 40;
19
- boundedHeightEl.style.maxHeight = newHeight.toString() + 'px';
20
- if (fullPageModalEl) {
21
- this.setFullPageHeight(fullPageModalEl);
22
- }
23
- else {
24
- /*
25
- IE11 doesn't handle flex and max-height correctly so we have to explicitly add
26
- max-height to the content that accounts for standard header and footer height.
27
- */
28
- const modalContentEl = modalEl.nativeElement.querySelector('.sky-modal-content');
29
- const contentHeight = newHeight - 114;
30
- modalContentEl.style.maxHeight = contentHeight.toString() + 'px';
31
- }
32
- }
33
- isFocusInFirstItem(event, list) {
34
- /* istanbul ignore next */
35
- /* sanity check */
36
- const eventTarget = event.target || event.srcElement;
37
- return list.length > 0 && eventTarget === list[0];
38
- }
39
- isFocusInLastItem(event, list) {
40
- /* istanbul ignore next */
41
- /* sanity check */
42
- const eventTarget = event.target || event.srcElement;
43
- return list.length > 0 && eventTarget === list[list.length - 1];
44
- }
45
- isModalFocused(event, modalEl) {
46
- /* istanbul ignore next */
47
- /* sanity check */
48
- const eventTarget = event.target || event.srcElement;
49
- return (modalEl &&
50
- eventTarget === modalEl.nativeElement.querySelector('.sky-modal-dialog'));
51
- }
52
- focusLastElement(list) {
53
- if (list.length > 0) {
54
- list[list.length - 1].focus();
55
- return true;
56
- }
57
- return false;
58
- }
59
- focusFirstElement(list) {
60
- if (list.length > 0) {
61
- list[0].focus();
62
- return true;
63
- }
64
- return false;
65
- }
66
- modalOpened(modalEl) {
67
- /* istanbul ignore else */
68
- /* handle the case where somehow there is a focused element already in the modal */
69
- if (!(document.activeElement &&
70
- modalEl.nativeElement.contains(document.activeElement))) {
71
- const currentScrollX = window.pageXOffset;
72
- const currentScrollY = window.pageYOffset;
73
- const inputWithAutofocus = modalEl.nativeElement.querySelector('[autofocus]');
74
- if (inputWithAutofocus) {
75
- inputWithAutofocus.focus();
76
- }
77
- else {
78
- this.coreAdapter.getFocusableChildrenAndApplyFocus(modalEl, '.sky-modal-content', true);
79
- }
80
- window.scrollTo(currentScrollX, currentScrollY);
81
- }
82
- }
83
- setFullPageHeight(fullPageModalEl) {
84
- const windowHeight = window.innerHeight;
85
- const fullPageModalStyle = getComputedStyle(fullPageModalEl);
86
- const marginTopBottom = parseInt(fullPageModalStyle.marginTop, 10) +
87
- parseInt(fullPageModalStyle.marginBottom, 10);
88
- const fullPageModalHeight = windowHeight - marginTopBottom + 'px';
89
- fullPageModalEl.style.height = fullPageModalHeight;
90
- fullPageModalEl.style.maxHeight = fullPageModalHeight;
91
- }
92
- }
93
- SkyModalComponentAdapterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyModalComponentAdapterService, deps: [{ token: i1.SkyCoreAdapterService }], target: i0.ɵɵFactoryTarget.Injectable });
94
- SkyModalComponentAdapterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyModalComponentAdapterService });
95
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyModalComponentAdapterService, decorators: [{
96
- type: Injectable
97
- }], ctorParameters: function () { return [{ type: i1.SkyCoreAdapterService }]; } });
98
- //# sourceMappingURL=modal-component-adapter.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"modal-component-adapter.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/modals/src/lib/modules/modal/modal-component-adapter.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,UAAU,EAAE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aAC5B;iBAAM;gBACL,IAAI,CAAC,WAAW,CAAC,iCAAiC,CAChD,OAAO,EACP,oBAAoB,EACpB,IAAI,CACL,CAAC;aACH;YACD,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;SACjD;IACH,CAAC;IAEO,iBAAiB,CAAC,eAA4B;QACpD,MAAM,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC;QACxC,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,eAAe,CAAC,CAAC;QAE7D,MAAM,eAAe,GACnB,QAAQ,CAAC,kBAAkB,CAAC,SAAS,EAAE,EAAE,CAAC;YAC1C,QAAQ,CAAC,kBAAkB,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;QAEhD,MAAM,mBAAmB,GAAG,YAAY,GAAG,eAAe,GAAG,IAAI,CAAC;QAElE,eAAe,CAAC,KAAK,CAAC,MAAM,GAAG,mBAAmB,CAAC;QACnD,eAAe,CAAC,KAAK,CAAC,SAAS,GAAG,mBAAmB,CAAC;IACxD,CAAC;;6HAlHU,+BAA+B;iIAA/B,+BAA+B;4FAA/B,+BAA+B;kBAD3C,UAAU","sourcesContent":["import { ElementRef, Injectable } from '@angular/core';\nimport { SkyCoreAdapterService } from '@skyux/core';\n\n/**\n * @internal\n */\n@Injectable()\nexport class SkyModalComponentAdapterService {\n constructor(private coreAdapter: SkyCoreAdapterService) {}\n\n public handleWindowChange(modalEl: ElementRef): void {\n const boundedHeightEl = modalEl.nativeElement.querySelector('.sky-modal');\n const fullPageModalEl = modalEl.nativeElement.querySelector(\n '.sky-modal-full-page'\n );\n /*\n Set modal height equal to max height of window (accounting for padding above and below modal)\n */\n const newHeight = window.innerHeight - 40;\n\n boundedHeightEl.style.maxHeight = newHeight.toString() + 'px';\n if (fullPageModalEl) {\n this.setFullPageHeight(fullPageModalEl);\n } else {\n /*\n IE11 doesn't handle flex and max-height correctly so we have to explicitly add\n max-height to the content that accounts for standard header and footer height.\n */\n const modalContentEl =\n modalEl.nativeElement.querySelector('.sky-modal-content');\n const contentHeight = newHeight - 114;\n modalContentEl.style.maxHeight = contentHeight.toString() + 'px';\n }\n }\n\n public isFocusInFirstItem(\n event: KeyboardEvent,\n list: Array<HTMLElement>\n ): boolean {\n /* istanbul ignore next */\n /* sanity check */\n const eventTarget = event.target || event.srcElement;\n return list.length > 0 && eventTarget === list[0];\n }\n\n public isFocusInLastItem(\n event: KeyboardEvent,\n list: Array<HTMLElement>\n ): boolean {\n /* istanbul ignore next */\n /* sanity check */\n const eventTarget = event.target || event.srcElement;\n return list.length > 0 && eventTarget === list[list.length - 1];\n }\n\n public isModalFocused(event: KeyboardEvent, modalEl: ElementRef): boolean {\n /* istanbul ignore next */\n /* sanity check */\n const eventTarget = event.target || event.srcElement;\n return (\n modalEl &&\n eventTarget === modalEl.nativeElement.querySelector('.sky-modal-dialog')\n );\n }\n\n public focusLastElement(list: Array<HTMLElement>): boolean {\n if (list.length > 0) {\n list[list.length - 1].focus();\n return true;\n }\n return false;\n }\n\n public focusFirstElement(list: Array<HTMLElement>): boolean {\n if (list.length > 0) {\n list[0].focus();\n return true;\n }\n return false;\n }\n\n public modalOpened(modalEl: ElementRef): void {\n /* istanbul ignore else */\n /* handle the case where somehow there is a focused element already in the modal */\n if (\n !(\n document.activeElement &&\n modalEl.nativeElement.contains(document.activeElement)\n )\n ) {\n const currentScrollX = window.pageXOffset;\n const currentScrollY = window.pageYOffset;\n\n const inputWithAutofocus =\n modalEl.nativeElement.querySelector('[autofocus]');\n\n if (inputWithAutofocus) {\n inputWithAutofocus.focus();\n } else {\n this.coreAdapter.getFocusableChildrenAndApplyFocus(\n modalEl,\n '.sky-modal-content',\n true\n );\n }\n window.scrollTo(currentScrollX, currentScrollY);\n }\n }\n\n private setFullPageHeight(fullPageModalEl: HTMLElement): void {\n const windowHeight = window.innerHeight;\n const fullPageModalStyle = getComputedStyle(fullPageModalEl);\n\n const marginTopBottom =\n parseInt(fullPageModalStyle.marginTop, 10) +\n parseInt(fullPageModalStyle.marginBottom, 10);\n\n const fullPageModalHeight = windowHeight - marginTopBottom + 'px';\n\n fullPageModalEl.style.height = fullPageModalHeight;\n fullPageModalEl.style.maxHeight = fullPageModalHeight;\n }\n}\n"]}