@internetarchive/modal-manager 2.0.3 → 2.0.4-alpha-webdev7960.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.
Files changed (73) hide show
  1. package/.editorconfig +29 -29
  2. package/.eslintrc.js +14 -14
  3. package/.github/workflows/ci.yml +30 -30
  4. package/.github/workflows/gh-pages-main.yml +42 -42
  5. package/.github/workflows/pr-preview.yml +40 -40
  6. package/LICENSE +661 -661
  7. package/README.md +139 -139
  8. package/custom-elements.json +170 -170
  9. package/dist/index.d.ts +7 -7
  10. package/dist/index.js +5 -5
  11. package/dist/src/assets/arrow-left-icon.d.ts +2 -2
  12. package/dist/src/assets/arrow-left-icon.js +2 -2
  13. package/dist/src/assets/ia-logo-icon.d.ts +2 -2
  14. package/dist/src/assets/ia-logo-icon.js +2 -2
  15. package/dist/src/modal-config.d.ts +104 -104
  16. package/dist/src/modal-config.js +24 -24
  17. package/dist/src/modal-manager-host-bridge-interface.d.ts +12 -12
  18. package/dist/src/modal-manager-host-bridge-interface.js +1 -1
  19. package/dist/src/modal-manager-host-bridge.d.ts +34 -34
  20. package/dist/src/modal-manager-host-bridge.js +62 -62
  21. package/dist/src/modal-manager-interface.d.ts +27 -27
  22. package/dist/src/modal-manager-interface.js +1 -1
  23. package/dist/src/modal-manager-mode.d.ts +10 -10
  24. package/dist/src/modal-manager-mode.js +11 -11
  25. package/dist/src/modal-manager.d.ts +137 -127
  26. package/dist/src/modal-manager.js +212 -197
  27. package/dist/src/modal-manager.js.map +1 -1
  28. package/dist/src/modal-template.d.ts +41 -41
  29. package/dist/src/modal-template.js +115 -115
  30. package/dist/src/shoelace/active-elements.d.ts +15 -15
  31. package/dist/src/shoelace/active-elements.js +27 -27
  32. package/dist/src/shoelace/modal.d.ts +24 -24
  33. package/dist/src/shoelace/modal.js +131 -131
  34. package/dist/src/shoelace/tabbable.d.ts +9 -9
  35. package/dist/src/shoelace/tabbable.js +169 -169
  36. package/dist/test/modal-config.test.d.ts +1 -1
  37. package/dist/test/modal-config.test.js +69 -69
  38. package/dist/test/modal-manager.test.d.ts +1 -1
  39. package/dist/test/modal-manager.test.js +275 -240
  40. package/dist/test/modal-manager.test.js.map +1 -1
  41. package/dist/test/modal-template.test.d.ts +1 -1
  42. package/dist/test/modal-template.test.js +156 -156
  43. package/dist/vite.config.d.ts +2 -2
  44. package/dist/vite.config.js +22 -22
  45. package/docs/assets/css/main.css +2678 -2678
  46. package/docs/classes/_src_modal_config_.modalconfig.html +429 -429
  47. package/docs/classes/_src_modal_manager_.modalmanager.html +7702 -7702
  48. package/docs/classes/_src_modal_manager_host_bridge_.modalmanagerhostbridge.html +409 -409
  49. package/docs/classes/_src_modal_template_.modaltemplate.html +7096 -7096
  50. package/docs/enums/_src_modal_manager_mode_.modalmanagermode.html +196 -196
  51. package/docs/globals.html +150 -150
  52. package/docs/index.html +252 -252
  53. package/docs/interfaces/_src_modal_manager_host_bridge_interface_.modalmanagerhostbridgeinterface.html +210 -210
  54. package/docs/interfaces/_src_modal_manager_interface_.modalmanagerinterface.html +7095 -7095
  55. package/docs/modules/_index_.html +208 -208
  56. package/docs/modules/_src_modal_config_.html +146 -146
  57. package/docs/modules/_src_modal_manager_.html +146 -146
  58. package/docs/modules/_src_modal_manager_host_bridge_.html +146 -146
  59. package/docs/modules/_src_modal_manager_host_bridge_interface_.html +146 -146
  60. package/docs/modules/_src_modal_manager_interface_.html +146 -146
  61. package/docs/modules/_src_modal_manager_mode_.html +146 -146
  62. package/docs/modules/_src_modal_template_.html +146 -146
  63. package/docs/modules/_test_modal_config_test_.html +106 -106
  64. package/docs/modules/_test_modal_manager_test_.html +106 -106
  65. package/docs/modules/_test_modal_template_test_.html +106 -106
  66. package/index.html +300 -300
  67. package/karma.conf.js +24 -24
  68. package/package.json +85 -85
  69. package/renovate.json +7 -7
  70. package/src/modal-manager.ts +22 -0
  71. package/src/shoelace/LICENSE.md +6 -6
  72. package/test/modal-manager.test.ts +52 -6
  73. package/tsconfig.json +21 -21
@@ -1,2 +1,2 @@
1
- declare const _default: import("lit-html").TemplateResult<1>;
2
- export default _default;
1
+ declare const _default: import("lit-html").TemplateResult<1>;
2
+ export default _default;
@@ -1,4 +1,4 @@
1
- import { html } from 'lit';
1
+ import { html } from 'lit';
2
2
  export default html `
3
3
  <svg
4
4
  class="ia-logo"
@@ -26,5 +26,5 @@ export default html `
26
26
  </g>
27
27
  </g>
28
28
  </svg>
29
- `;
29
+ `;
30
30
  //# sourceMappingURL=ia-logo-icon.js.map
@@ -1,104 +1,104 @@
1
- import { TemplateResult } from 'lit';
2
- /**
3
- * Configuration to show a modal
4
- *
5
- * @export
6
- * @class ModalConfig
7
- */
8
- export declare class ModalConfig {
9
- /**
10
- * The title that shows in the header
11
- *
12
- * @type {(TemplateResult | undefined)}
13
- * @memberof ModalConfig
14
- */
15
- title?: TemplateResult;
16
- /**
17
- * The subtitle shown in the header under the title
18
- *
19
- * @type {(TemplateResult | undefined)}
20
- * @memberof ModalConfig
21
- */
22
- subtitle?: TemplateResult;
23
- /**
24
- * The headline shown at the top of the content section
25
- *
26
- * @type {(TemplateResult | undefined)}
27
- * @memberof ModalConfig
28
- */
29
- headline?: TemplateResult;
30
- /**
31
- * The text shown below the headline in the content section
32
- *
33
- * @type {(TemplateResult | undefined)}
34
- * @memberof ModalConfig
35
- */
36
- message?: TemplateResult;
37
- /**
38
- * The background color of the header
39
- *
40
- * @memberof ModalConfig
41
- */
42
- headerColor: string;
43
- /**
44
- * The background color of the body
45
- *
46
- * @memberof ModalConfig
47
- */
48
- bodyColor: string;
49
- /**
50
- * Show or hide the processing indicator
51
- *
52
- * @memberof ModalConfig
53
- */
54
- showProcessingIndicator: boolean;
55
- /**
56
- * Set the processing image mode, currently `processing` or `complete`
57
- *
58
- * @memberof ModalConfig
59
- */
60
- processingImageMode: 'processing' | 'complete';
61
- /**
62
- * Show the close button
63
- *
64
- * @memberof ModalConfig
65
- */
66
- showCloseButton: boolean;
67
- /**
68
- * Show the left nav button
69
- *
70
- * @memberof ModalConfig
71
- */
72
- showLeftNavButton: boolean;
73
- /**
74
- * Left nav button text
75
- */
76
- leftNavButtonText: string;
77
- /**
78
- * Show the close button
79
- *
80
- * @memberof ModalConfig
81
- */
82
- showHeaderLogo: boolean;
83
- /**
84
- * Close the modal if the user taps on the background
85
- *
86
- * @memberof ModalConfig
87
- */
88
- closeOnBackdropClick: boolean;
89
- constructor(options?: {
90
- title?: TemplateResult;
91
- subtitle?: TemplateResult;
92
- headline?: TemplateResult;
93
- message?: TemplateResult;
94
- headerColor?: string;
95
- bodyColor?: string;
96
- showProcessingIndicator?: boolean;
97
- processingImageMode?: 'processing' | 'complete';
98
- showCloseButton?: boolean;
99
- showLeftNavButton?: boolean;
100
- leftNavButtonText?: string;
101
- showHeaderLogo?: boolean;
102
- closeOnBackdropClick?: boolean;
103
- });
104
- }
1
+ import { TemplateResult } from 'lit';
2
+ /**
3
+ * Configuration to show a modal
4
+ *
5
+ * @export
6
+ * @class ModalConfig
7
+ */
8
+ export declare class ModalConfig {
9
+ /**
10
+ * The title that shows in the header
11
+ *
12
+ * @type {(TemplateResult | undefined)}
13
+ * @memberof ModalConfig
14
+ */
15
+ title?: TemplateResult;
16
+ /**
17
+ * The subtitle shown in the header under the title
18
+ *
19
+ * @type {(TemplateResult | undefined)}
20
+ * @memberof ModalConfig
21
+ */
22
+ subtitle?: TemplateResult;
23
+ /**
24
+ * The headline shown at the top of the content section
25
+ *
26
+ * @type {(TemplateResult | undefined)}
27
+ * @memberof ModalConfig
28
+ */
29
+ headline?: TemplateResult;
30
+ /**
31
+ * The text shown below the headline in the content section
32
+ *
33
+ * @type {(TemplateResult | undefined)}
34
+ * @memberof ModalConfig
35
+ */
36
+ message?: TemplateResult;
37
+ /**
38
+ * The background color of the header
39
+ *
40
+ * @memberof ModalConfig
41
+ */
42
+ headerColor: string;
43
+ /**
44
+ * The background color of the body
45
+ *
46
+ * @memberof ModalConfig
47
+ */
48
+ bodyColor: string;
49
+ /**
50
+ * Show or hide the processing indicator
51
+ *
52
+ * @memberof ModalConfig
53
+ */
54
+ showProcessingIndicator: boolean;
55
+ /**
56
+ * Set the processing image mode, currently `processing` or `complete`
57
+ *
58
+ * @memberof ModalConfig
59
+ */
60
+ processingImageMode: 'processing' | 'complete';
61
+ /**
62
+ * Show the close button
63
+ *
64
+ * @memberof ModalConfig
65
+ */
66
+ showCloseButton: boolean;
67
+ /**
68
+ * Show the left nav button
69
+ *
70
+ * @memberof ModalConfig
71
+ */
72
+ showLeftNavButton: boolean;
73
+ /**
74
+ * Left nav button text
75
+ */
76
+ leftNavButtonText: string;
77
+ /**
78
+ * Show the close button
79
+ *
80
+ * @memberof ModalConfig
81
+ */
82
+ showHeaderLogo: boolean;
83
+ /**
84
+ * Close the modal if the user taps on the background
85
+ *
86
+ * @memberof ModalConfig
87
+ */
88
+ closeOnBackdropClick: boolean;
89
+ constructor(options?: {
90
+ title?: TemplateResult;
91
+ subtitle?: TemplateResult;
92
+ headline?: TemplateResult;
93
+ message?: TemplateResult;
94
+ headerColor?: string;
95
+ bodyColor?: string;
96
+ showProcessingIndicator?: boolean;
97
+ processingImageMode?: 'processing' | 'complete';
98
+ showCloseButton?: boolean;
99
+ showLeftNavButton?: boolean;
100
+ leftNavButtonText?: string;
101
+ showHeaderLogo?: boolean;
102
+ closeOnBackdropClick?: boolean;
103
+ });
104
+ }
@@ -1,25 +1,25 @@
1
- /**
2
- * Configuration to show a modal
3
- *
4
- * @export
5
- * @class ModalConfig
6
- */
7
- export class ModalConfig {
8
- constructor(options) {
9
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
10
- this.title = options === null || options === void 0 ? void 0 : options.title;
11
- this.subtitle = options === null || options === void 0 ? void 0 : options.subtitle;
12
- this.headline = options === null || options === void 0 ? void 0 : options.headline;
13
- this.message = options === null || options === void 0 ? void 0 : options.message;
14
- this.headerColor = (_a = options === null || options === void 0 ? void 0 : options.headerColor) !== null && _a !== void 0 ? _a : '#55A183';
15
- this.bodyColor = (_b = options === null || options === void 0 ? void 0 : options.bodyColor) !== null && _b !== void 0 ? _b : '#fbfbfd';
16
- this.showProcessingIndicator = (_c = options === null || options === void 0 ? void 0 : options.showProcessingIndicator) !== null && _c !== void 0 ? _c : false;
17
- this.processingImageMode = (_d = options === null || options === void 0 ? void 0 : options.processingImageMode) !== null && _d !== void 0 ? _d : 'complete';
18
- this.showCloseButton = (_e = options === null || options === void 0 ? void 0 : options.showCloseButton) !== null && _e !== void 0 ? _e : true;
19
- this.showLeftNavButton = (_f = options === null || options === void 0 ? void 0 : options.showLeftNavButton) !== null && _f !== void 0 ? _f : false;
20
- this.leftNavButtonText = (_g = options === null || options === void 0 ? void 0 : options.leftNavButtonText) !== null && _g !== void 0 ? _g : '';
21
- this.showHeaderLogo = (_h = options === null || options === void 0 ? void 0 : options.showHeaderLogo) !== null && _h !== void 0 ? _h : true;
22
- this.closeOnBackdropClick = (_j = options === null || options === void 0 ? void 0 : options.closeOnBackdropClick) !== null && _j !== void 0 ? _j : true;
23
- }
24
- }
1
+ /**
2
+ * Configuration to show a modal
3
+ *
4
+ * @export
5
+ * @class ModalConfig
6
+ */
7
+ export class ModalConfig {
8
+ constructor(options) {
9
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
10
+ this.title = options === null || options === void 0 ? void 0 : options.title;
11
+ this.subtitle = options === null || options === void 0 ? void 0 : options.subtitle;
12
+ this.headline = options === null || options === void 0 ? void 0 : options.headline;
13
+ this.message = options === null || options === void 0 ? void 0 : options.message;
14
+ this.headerColor = (_a = options === null || options === void 0 ? void 0 : options.headerColor) !== null && _a !== void 0 ? _a : '#55A183';
15
+ this.bodyColor = (_b = options === null || options === void 0 ? void 0 : options.bodyColor) !== null && _b !== void 0 ? _b : '#fbfbfd';
16
+ this.showProcessingIndicator = (_c = options === null || options === void 0 ? void 0 : options.showProcessingIndicator) !== null && _c !== void 0 ? _c : false;
17
+ this.processingImageMode = (_d = options === null || options === void 0 ? void 0 : options.processingImageMode) !== null && _d !== void 0 ? _d : 'complete';
18
+ this.showCloseButton = (_e = options === null || options === void 0 ? void 0 : options.showCloseButton) !== null && _e !== void 0 ? _e : true;
19
+ this.showLeftNavButton = (_f = options === null || options === void 0 ? void 0 : options.showLeftNavButton) !== null && _f !== void 0 ? _f : false;
20
+ this.leftNavButtonText = (_g = options === null || options === void 0 ? void 0 : options.leftNavButtonText) !== null && _g !== void 0 ? _g : '';
21
+ this.showHeaderLogo = (_h = options === null || options === void 0 ? void 0 : options.showHeaderLogo) !== null && _h !== void 0 ? _h : true;
22
+ this.closeOnBackdropClick = (_j = options === null || options === void 0 ? void 0 : options.closeOnBackdropClick) !== null && _j !== void 0 ? _j : true;
23
+ }
24
+ }
25
25
  //# sourceMappingURL=modal-config.js.map
@@ -1,12 +1,12 @@
1
- import { ModalManagerMode } from './modal-manager-mode';
2
- /**
3
- * The ModalManagerHostBridgeInterface is a delegate interface for
4
- * the host to implement environment-specific changes when the modal
5
- * is open or closed.
6
- *
7
- * A default implementation is provided, but can be overridden if
8
- * it does not work for the environment.
9
- */
10
- export interface ModalManagerHostBridgeInterface {
11
- handleModeChange(mode: ModalManagerMode): void;
12
- }
1
+ import { ModalManagerMode } from './modal-manager-mode';
2
+ /**
3
+ * The ModalManagerHostBridgeInterface is a delegate interface for
4
+ * the host to implement environment-specific changes when the modal
5
+ * is open or closed.
6
+ *
7
+ * A default implementation is provided, but can be overridden if
8
+ * it does not work for the environment.
9
+ */
10
+ export interface ModalManagerHostBridgeInterface {
11
+ handleModeChange(mode: ModalManagerMode): void;
12
+ }
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=modal-manager-host-bridge-interface.js.map
@@ -1,34 +1,34 @@
1
- import { ModalManagerHostBridgeInterface } from './modal-manager-host-bridge-interface';
2
- import { ModalManagerInterface } from './modal-manager-interface';
3
- import { ModalManagerMode } from './modal-manager-mode';
4
- /**
5
- * The `ModalManagerHostBridge` is a bridge between the `ModalManager` and the
6
- * host that sets up environment-specific changes when the modal opens and closes.
7
- *
8
- * For instance, when the modal opens, this adds a class to the `<body>` tag for styling
9
- * and adds a `resize` listener to fix a Safari shadow root issue.
10
- *
11
- * Consumers can create their own `ModalManagerHostBridgeInterface` classes and pass
12
- * them into the `ModalManager` if this one does not work for their environment.
13
- *
14
- * @export
15
- * @class ModalManagerHostBridge
16
- * @implements {ModalManagerHostBridgeInterface}
17
- */
18
- export declare class ModalManagerHostBridge implements ModalManagerHostBridgeInterface {
19
- private modalManager;
20
- constructor(modalManager: ModalManagerInterface);
21
- /**
22
- * Handle the mode change
23
- *
24
- * @private
25
- * @memberof ModalManager
26
- */
27
- handleModeChange(mode: ModalManagerMode): void;
28
- private windowResizeThrottler;
29
- private updateModalContainerHeight;
30
- private stopDocumentScroll;
31
- private resumeDocumentScroll;
32
- private startResizeListener;
33
- private stopResizeListener;
34
- }
1
+ import { ModalManagerHostBridgeInterface } from './modal-manager-host-bridge-interface';
2
+ import { ModalManagerInterface } from './modal-manager-interface';
3
+ import { ModalManagerMode } from './modal-manager-mode';
4
+ /**
5
+ * The `ModalManagerHostBridge` is a bridge between the `ModalManager` and the
6
+ * host that sets up environment-specific changes when the modal opens and closes.
7
+ *
8
+ * For instance, when the modal opens, this adds a class to the `<body>` tag for styling
9
+ * and adds a `resize` listener to fix a Safari shadow root issue.
10
+ *
11
+ * Consumers can create their own `ModalManagerHostBridgeInterface` classes and pass
12
+ * them into the `ModalManager` if this one does not work for their environment.
13
+ *
14
+ * @export
15
+ * @class ModalManagerHostBridge
16
+ * @implements {ModalManagerHostBridgeInterface}
17
+ */
18
+ export declare class ModalManagerHostBridge implements ModalManagerHostBridgeInterface {
19
+ private modalManager;
20
+ constructor(modalManager: ModalManagerInterface);
21
+ /**
22
+ * Handle the mode change
23
+ *
24
+ * @private
25
+ * @memberof ModalManager
26
+ */
27
+ handleModeChange(mode: ModalManagerMode): void;
28
+ private windowResizeThrottler;
29
+ private updateModalContainerHeight;
30
+ private stopDocumentScroll;
31
+ private resumeDocumentScroll;
32
+ private startResizeListener;
33
+ private stopResizeListener;
34
+ }
@@ -1,63 +1,63 @@
1
- import { throttle } from 'throttle-debounce';
2
- import { ModalManagerMode } from './modal-manager-mode';
3
- /**
4
- * The `ModalManagerHostBridge` is a bridge between the `ModalManager` and the
5
- * host that sets up environment-specific changes when the modal opens and closes.
6
- *
7
- * For instance, when the modal opens, this adds a class to the `<body>` tag for styling
8
- * and adds a `resize` listener to fix a Safari shadow root issue.
9
- *
10
- * Consumers can create their own `ModalManagerHostBridgeInterface` classes and pass
11
- * them into the `ModalManager` if this one does not work for their environment.
12
- *
13
- * @export
14
- * @class ModalManagerHostBridge
15
- * @implements {ModalManagerHostBridgeInterface}
16
- */
17
- export class ModalManagerHostBridge {
18
- constructor(modalManager) {
19
- this.windowResizeThrottler = throttle(100, this.updateModalContainerHeight, { noLeading: false, noTrailing: false }).bind(this);
20
- this.modalManager = modalManager;
21
- }
22
- /**
23
- * Handle the mode change
24
- *
25
- * @private
26
- * @memberof ModalManager
27
- */
28
- handleModeChange(mode) {
29
- switch (mode) {
30
- case ModalManagerMode.Open:
31
- this.startResizeListener();
32
- this.stopDocumentScroll();
33
- break;
34
- case ModalManagerMode.Closed:
35
- this.stopResizeListener();
36
- this.resumeDocumentScroll();
37
- break;
38
- }
39
- }
40
- // This is a workaround for Safari. Safari does not update shadowRoot elements calculated
41
- // based on the viewport size (ie. `calc(100vh - 10px)`). It does an initial calculation correctly,
42
- // but resizing the window does not cause the calculation to update. Firefox and Chrome both handle
43
- // this correctly.
44
- // It doesn't matter what css variable you set, it is just forcing Safari to do an update.
45
- // Also note that the value has to change on each update for Safari to do the update,
46
- // ie. you can't just set a static value.
47
- updateModalContainerHeight() {
48
- this.modalManager.style.setProperty('--containerHeight', `${window.innerHeight}px`);
49
- }
50
- stopDocumentScroll() {
51
- document.body.classList.add('modal-manager-open');
52
- }
53
- resumeDocumentScroll() {
54
- document.body.classList.remove('modal-manager-open');
55
- }
56
- startResizeListener() {
57
- window.addEventListener('resize', this.windowResizeThrottler);
58
- }
59
- stopResizeListener() {
60
- window.removeEventListener('resize', this.windowResizeThrottler);
61
- }
62
- }
1
+ import { throttle } from 'throttle-debounce';
2
+ import { ModalManagerMode } from './modal-manager-mode';
3
+ /**
4
+ * The `ModalManagerHostBridge` is a bridge between the `ModalManager` and the
5
+ * host that sets up environment-specific changes when the modal opens and closes.
6
+ *
7
+ * For instance, when the modal opens, this adds a class to the `<body>` tag for styling
8
+ * and adds a `resize` listener to fix a Safari shadow root issue.
9
+ *
10
+ * Consumers can create their own `ModalManagerHostBridgeInterface` classes and pass
11
+ * them into the `ModalManager` if this one does not work for their environment.
12
+ *
13
+ * @export
14
+ * @class ModalManagerHostBridge
15
+ * @implements {ModalManagerHostBridgeInterface}
16
+ */
17
+ export class ModalManagerHostBridge {
18
+ constructor(modalManager) {
19
+ this.windowResizeThrottler = throttle(100, this.updateModalContainerHeight, { noLeading: false, noTrailing: false }).bind(this);
20
+ this.modalManager = modalManager;
21
+ }
22
+ /**
23
+ * Handle the mode change
24
+ *
25
+ * @private
26
+ * @memberof ModalManager
27
+ */
28
+ handleModeChange(mode) {
29
+ switch (mode) {
30
+ case ModalManagerMode.Open:
31
+ this.startResizeListener();
32
+ this.stopDocumentScroll();
33
+ break;
34
+ case ModalManagerMode.Closed:
35
+ this.stopResizeListener();
36
+ this.resumeDocumentScroll();
37
+ break;
38
+ }
39
+ }
40
+ // This is a workaround for Safari. Safari does not update shadowRoot elements calculated
41
+ // based on the viewport size (ie. `calc(100vh - 10px)`). It does an initial calculation correctly,
42
+ // but resizing the window does not cause the calculation to update. Firefox and Chrome both handle
43
+ // this correctly.
44
+ // It doesn't matter what css variable you set, it is just forcing Safari to do an update.
45
+ // Also note that the value has to change on each update for Safari to do the update,
46
+ // ie. you can't just set a static value.
47
+ updateModalContainerHeight() {
48
+ this.modalManager.style.setProperty('--containerHeight', `${window.innerHeight}px`);
49
+ }
50
+ stopDocumentScroll() {
51
+ document.body.classList.add('modal-manager-open');
52
+ }
53
+ resumeDocumentScroll() {
54
+ document.body.classList.remove('modal-manager-open');
55
+ }
56
+ startResizeListener() {
57
+ window.addEventListener('resize', this.windowResizeThrottler);
58
+ }
59
+ stopResizeListener() {
60
+ window.removeEventListener('resize', this.windowResizeThrottler);
61
+ }
62
+ }
63
63
  //# sourceMappingURL=modal-manager-host-bridge.js.map
@@ -1,27 +1,27 @@
1
- import { LitElement, TemplateResult } from 'lit';
2
- import { ModalConfig } from './modal-config';
3
- import { ModalManagerMode } from './modal-manager-mode';
4
- export interface ModalManagerInterface extends LitElement {
5
- /**
6
- * Get the current modal mode.
7
- */
8
- getMode(): ModalManagerMode;
9
- /**
10
- * Show a modal from a given ModalConfig
11
- *
12
- * @param config ModalConfig
13
- * @param customModalContent TemplateResult | undefined
14
- * @param userClosedModalCallback () => void | undefined an optional callback when the modal is closed
15
- * @param userPressedLeftNavButtonCallback () => void | undefined an optional callback when the left nav button is pressed
16
- */
17
- showModal(options: {
18
- config: ModalConfig;
19
- customModalContent?: TemplateResult;
20
- userClosedModalCallback?: () => void;
21
- userPressedLeftNavButtonCallback?: () => void;
22
- }): Promise<void>;
23
- /**
24
- * Close the currently open modal
25
- */
26
- closeModal(): void;
27
- }
1
+ import { LitElement, TemplateResult } from 'lit';
2
+ import { ModalConfig } from './modal-config';
3
+ import { ModalManagerMode } from './modal-manager-mode';
4
+ export interface ModalManagerInterface extends LitElement {
5
+ /**
6
+ * Get the current modal mode.
7
+ */
8
+ getMode(): ModalManagerMode;
9
+ /**
10
+ * Show a modal from a given ModalConfig
11
+ *
12
+ * @param config ModalConfig
13
+ * @param customModalContent TemplateResult | undefined
14
+ * @param userClosedModalCallback () => void | undefined an optional callback when the modal is closed
15
+ * @param userPressedLeftNavButtonCallback () => void | undefined an optional callback when the left nav button is pressed
16
+ */
17
+ showModal(options: {
18
+ config: ModalConfig;
19
+ customModalContent?: TemplateResult;
20
+ userClosedModalCallback?: () => void;
21
+ userPressedLeftNavButtonCallback?: () => void;
22
+ }): Promise<void>;
23
+ /**
24
+ * Close the currently open modal
25
+ */
26
+ closeModal(): void;
27
+ }
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=modal-manager-interface.js.map
@@ -1,10 +1,10 @@
1
- /**
2
- * Various modes the modal can be in
3
- *
4
- * @export
5
- * @enum {number}
6
- */
7
- export declare enum ModalManagerMode {
8
- Open = "open",
9
- Closed = "closed"
10
- }
1
+ /**
2
+ * Various modes the modal can be in
3
+ *
4
+ * @export
5
+ * @enum {number}
6
+ */
7
+ export declare enum ModalManagerMode {
8
+ Open = "open",
9
+ Closed = "closed"
10
+ }
@@ -1,12 +1,12 @@
1
- /**
2
- * Various modes the modal can be in
3
- *
4
- * @export
5
- * @enum {number}
6
- */
7
- export var ModalManagerMode;
8
- (function (ModalManagerMode) {
9
- ModalManagerMode["Open"] = "open";
10
- ModalManagerMode["Closed"] = "closed";
11
- })(ModalManagerMode || (ModalManagerMode = {}));
1
+ /**
2
+ * Various modes the modal can be in
3
+ *
4
+ * @export
5
+ * @enum {number}
6
+ */
7
+ export var ModalManagerMode;
8
+ (function (ModalManagerMode) {
9
+ ModalManagerMode["Open"] = "open";
10
+ ModalManagerMode["Closed"] = "closed";
11
+ })(ModalManagerMode || (ModalManagerMode = {}));
12
12
  //# sourceMappingURL=modal-manager-mode.js.map