@internetarchive/modal-manager 2.0.2 → 2.0.4-alpha-webdev7960.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.
- package/.editorconfig +29 -29
- package/.eslintrc.js +14 -14
- package/.github/workflows/ci.yml +30 -30
- package/.github/workflows/gh-pages-main.yml +42 -42
- package/.github/workflows/pr-preview.yml +40 -40
- package/LICENSE +661 -661
- package/README.md +139 -139
- package/custom-elements.json +170 -170
- package/dist/index.d.ts +7 -7
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/src/assets/arrow-left-icon.d.ts +2 -0
- package/dist/src/assets/arrow-left-icon.js +15 -0
- package/dist/src/assets/arrow-left-icon.js.map +1 -0
- package/dist/src/assets/ia-logo-icon.d.ts +2 -2
- package/dist/src/assets/ia-logo-icon.js +29 -29
- package/dist/src/assets/ia-logo-icon.js.map +1 -1
- package/dist/src/modal-config.d.ts +104 -92
- package/dist/src/modal-config.js +24 -22
- package/dist/src/modal-config.js.map +1 -1
- package/dist/src/modal-manager-host-bridge-interface.d.ts +12 -12
- package/dist/src/modal-manager-host-bridge-interface.js +1 -1
- package/dist/src/modal-manager-host-bridge-interface.js.map +1 -1
- package/dist/src/modal-manager-host-bridge.d.ts +34 -34
- package/dist/src/modal-manager-host-bridge.js +62 -62
- package/dist/src/modal-manager-host-bridge.js.map +1 -1
- package/dist/src/modal-manager-interface.d.ts +27 -25
- package/dist/src/modal-manager-interface.js +1 -1
- package/dist/src/modal-manager-interface.js.map +1 -1
- package/dist/src/modal-manager-mode.d.ts +10 -10
- package/dist/src/modal-manager-mode.js +11 -11
- package/dist/src/modal-manager-mode.js.map +1 -1
- package/dist/src/modal-manager.d.ts +137 -112
- package/dist/src/modal-manager.js +247 -218
- package/dist/src/modal-manager.js.map +1 -1
- package/dist/src/modal-template.d.ts +41 -33
- package/dist/src/modal-template.js +335 -282
- package/dist/src/modal-template.js.map +1 -1
- package/dist/src/shoelace/active-elements.d.ts +15 -15
- package/dist/src/shoelace/active-elements.js +27 -27
- package/dist/src/shoelace/active-elements.js.map +1 -1
- package/dist/src/shoelace/modal.d.ts +24 -24
- package/dist/src/shoelace/modal.js +131 -131
- package/dist/src/shoelace/modal.js.map +1 -1
- package/dist/src/shoelace/tabbable.d.ts +9 -9
- package/dist/src/shoelace/tabbable.js +169 -169
- package/dist/src/shoelace/tabbable.js.map +1 -1
- package/dist/test/modal-config.test.d.ts +1 -1
- package/dist/test/modal-config.test.js +69 -61
- package/dist/test/modal-config.test.js.map +1 -1
- package/dist/test/modal-manager.test.d.ts +1 -1
- package/dist/test/modal-manager.test.js +274 -252
- package/dist/test/modal-manager.test.js.map +1 -1
- package/dist/test/modal-template.test.d.ts +1 -1
- package/dist/test/modal-template.test.js +178 -106
- package/dist/test/modal-template.test.js.map +1 -1
- package/dist/vite.config.d.ts +2 -2
- package/dist/vite.config.js +22 -22
- package/dist/vite.config.js.map +1 -1
- package/docs/assets/css/main.css +2678 -2678
- package/docs/classes/_src_modal_config_.modalconfig.html +429 -429
- package/docs/classes/_src_modal_manager_.modalmanager.html +7702 -7702
- package/docs/classes/_src_modal_manager_host_bridge_.modalmanagerhostbridge.html +409 -409
- package/docs/classes/_src_modal_template_.modaltemplate.html +7096 -7096
- package/docs/enums/_src_modal_manager_mode_.modalmanagermode.html +196 -196
- package/docs/globals.html +150 -150
- package/docs/index.html +252 -252
- package/docs/interfaces/_src_modal_manager_host_bridge_interface_.modalmanagerhostbridgeinterface.html +210 -210
- package/docs/interfaces/_src_modal_manager_interface_.modalmanagerinterface.html +7095 -7095
- package/docs/modules/_index_.html +208 -208
- package/docs/modules/_src_modal_config_.html +146 -146
- package/docs/modules/_src_modal_manager_.html +146 -146
- package/docs/modules/_src_modal_manager_host_bridge_.html +146 -146
- package/docs/modules/_src_modal_manager_host_bridge_interface_.html +146 -146
- package/docs/modules/_src_modal_manager_interface_.html +146 -146
- package/docs/modules/_src_modal_manager_mode_.html +146 -146
- package/docs/modules/_src_modal_template_.html +146 -146
- package/docs/modules/_test_modal_config_test_.html +106 -106
- package/docs/modules/_test_modal_manager_test_.html +106 -106
- package/docs/modules/_test_modal_template_test_.html +106 -106
- package/index.html +300 -282
- package/index.ts +7 -7
- package/karma.conf.js +24 -24
- package/package.json +85 -85
- package/renovate.json +7 -7
- package/src/assets/arrow-left-icon.ts +15 -0
- package/src/assets/ia-logo-icon.ts +30 -30
- package/src/modal-config.ts +133 -117
- package/src/modal-manager-host-bridge-interface.ts +13 -13
- package/src/modal-manager-host-bridge.ts +82 -82
- package/src/modal-manager-interface.ts +30 -28
- package/src/modal-manager-mode.ts +10 -10
- package/src/modal-manager.ts +303 -258
- package/src/modal-template.ts +343 -287
- package/src/shoelace/LICENSE.md +6 -6
- package/src/shoelace/active-elements.ts +33 -33
- package/src/shoelace/modal.ts +166 -166
- package/src/shoelace/tabbable.ts +223 -223
- package/test/modal-config.test.ts +77 -69
- package/test/modal-manager.test.ts +347 -319
- package/test/modal-template.test.ts +206 -124
- package/tsconfig.json +21 -21
- package/vite.config.ts +23 -23
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
export default html `
|
|
3
|
+
<svg
|
|
4
|
+
viewBox="0 0 100 100"
|
|
5
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
6
|
+
fill="#fff"
|
|
7
|
+
title="Left arrow icon"
|
|
8
|
+
alt="Left arrow icon"
|
|
9
|
+
>
|
|
10
|
+
<path
|
|
11
|
+
d="m20.1116715 50.0035012-.1116715-.1085359 43.1159942-46.61088155c2.401537-2.18938917 4.6902018-3.28408375 6.8659943-3.28408375s4.1642651.63837733 5.9654178 1.91513199c1.8011528 1.27675467 3.1520173 2.97248092 4.0525937 5.08717877l-39.4020173 42.99768924 39.4020173 42.9976892c-.9005764 2.1146979-2.2514409 3.8104241-4.0525937 5.0871788-1.8011527 1.2767547-3.7896253 1.915132-5.9654178 1.915132-2.1013449 0-4.3900096-1.0573489-6.8659943-3.1720468l-43.1159942-46.7194174z"
|
|
12
|
+
/>
|
|
13
|
+
</svg>
|
|
14
|
+
`;
|
|
15
|
+
//# sourceMappingURL=arrow-left-icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrow-left-icon.js","sourceRoot":"","sources":["../../../src/assets/arrow-left-icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAE3B,eAAe,IAAI,CAAA;;;;;;;;;;;;CAYlB,CAAC","sourcesContent":["import { html } from 'lit';\r\n\r\nexport default html`\r\n <svg\r\n viewBox=\"0 0 100 100\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n fill=\"#fff\"\r\n title=\"Left arrow icon\"\r\n alt=\"Left arrow icon\"\r\n >\r\n <path\r\n d=\"m20.1116715 50.0035012-.1116715-.1085359 43.1159942-46.61088155c2.401537-2.18938917 4.6902018-3.28408375 6.8659943-3.28408375s4.1642651.63837733 5.9654178 1.91513199c1.8011528 1.27675467 3.1520173 2.97248092 4.0525937 5.08717877l-39.4020173 42.99768924 39.4020173 42.9976892c-.9005764 2.1146979-2.2514409 3.8104241-4.0525937 5.0871788-1.8011527 1.2767547-3.7896253 1.915132-5.9654178 1.915132-2.1013449 0-4.3900096-1.0573489-6.8659943-3.1720468l-43.1159942-46.7194174z\"\r\n />\r\n </svg>\r\n`;\r\n"]}
|
|
@@ -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,30 +1,30 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
export default html `
|
|
3
|
-
<svg
|
|
4
|
-
class="ia-logo"
|
|
5
|
-
viewBox="0 0 27 30"
|
|
6
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
-
aria-labelledby="logoTitleID logoDescID"
|
|
8
|
-
>
|
|
9
|
-
<title id="logoTitleID">Internet Archive logo</title>
|
|
10
|
-
<desc id="logoDescID">
|
|
11
|
-
A line drawing of the Internet Archive headquarters building façade.
|
|
12
|
-
</desc>
|
|
13
|
-
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
14
|
-
<mask id="mask-2" class="fill-color">
|
|
15
|
-
<path
|
|
16
|
-
d="M26.6666667,28.6046512 L26.6666667,30 L0,30 L0.000283687943,28.6046512 L26.6666667,28.6046512 Z M25.6140351,26.5116279 L25.6140351,28.255814 L1.05263158,28.255814 L1.05263158,26.5116279 L25.6140351,26.5116279 Z M3.62469203,7.6744186 L3.91746909,7.82153285 L4.0639977,10.1739544 L4.21052632,13.9963932 L4.21052632,17.6725617 L4.0639977,22.255044 L4.03962296,25.3421929 L3.62469203,25.4651163 L2.16024641,25.4651163 L1.72094074,25.3421929 L1.55031755,22.255044 L1.40350877,17.6970339 L1.40350877,14.0211467 L1.55031755,10.1739544 L1.68423854,7.80887484 L1.98962322,7.6744186 L3.62469203,7.6744186 Z M24.6774869,7.6744186 L24.9706026,7.82153285 L25.1168803,10.1739544 L25.2631579,13.9963932 L25.2631579,17.6725617 L25.1168803,22.255044 L25.0927809,25.3421929 L24.6774869,25.4651163 L23.2130291,25.4651163 L22.7736357,25.3421929 L22.602418,22.255044 L22.4561404,17.6970339 L22.4561404,14.0211467 L22.602418,10.1739544 L22.7369262,7.80887484 L23.0420916,7.6744186 L24.6774869,7.6744186 Z M9.94042303,7.6744186 L10.2332293,7.82153285 L10.3797725,10.1739544 L10.5263158,13.9963932 L10.5263158,17.6725617 L10.3797725,22.255044 L10.3556756,25.3421929 L9.94042303,25.4651163 L8.47583122,25.4651163 L8.0362015,25.3421929 L7.86556129,22.255044 L7.71929825,17.6970339 L7.71929825,14.0211467 L7.86556129,10.1739544 L8.00005604,7.80887484 L8.30491081,7.6744186 L9.94042303,7.6744186 Z M18.0105985,7.6744186 L18.3034047,7.82153285 L18.449948,10.1739544 L18.5964912,13.9963932 L18.5964912,17.6725617 L18.449948,22.255044 L18.425851,25.3421929 L18.0105985,25.4651163 L16.5460067,25.4651163 L16.1066571,25.3421929 L15.9357367,22.255044 L15.7894737,17.6970339 L15.7894737,14.0211467 L15.9357367,10.1739544 L16.0702315,7.80887484 L16.3753664,7.6744186 L18.0105985,7.6744186 Z M25.6140351,4.53488372 L25.6140351,6.97674419 L1.05263158,6.97674419 L1.05263158,4.53488372 L25.6140351,4.53488372 Z M13.0806755,0 L25.9649123,2.93331338 L25.4484139,3.8372093 L0.771925248,3.8372093 L0,3.1041615 L13.0806755,0 Z"
|
|
17
|
-
id="path-1"
|
|
18
|
-
></path>
|
|
19
|
-
</mask>
|
|
20
|
-
<use class="fill-color" xlink:href="#path-1"></use>
|
|
21
|
-
<g mask="url(#mask-2)" class="fill-color">
|
|
22
|
-
<path
|
|
23
|
-
d="M0,0 L26.6666667,0 L26.6666667,30 L0,30 L0,0 Z"
|
|
24
|
-
id="swatch"
|
|
25
|
-
></path>
|
|
26
|
-
</g>
|
|
27
|
-
</g>
|
|
28
|
-
</svg>
|
|
29
|
-
`;
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
export default html `
|
|
3
|
+
<svg
|
|
4
|
+
class="ia-logo"
|
|
5
|
+
viewBox="0 0 27 30"
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
aria-labelledby="logoTitleID logoDescID"
|
|
8
|
+
>
|
|
9
|
+
<title id="logoTitleID">Internet Archive logo</title>
|
|
10
|
+
<desc id="logoDescID">
|
|
11
|
+
A line drawing of the Internet Archive headquarters building façade.
|
|
12
|
+
</desc>
|
|
13
|
+
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
14
|
+
<mask id="mask-2" class="fill-color">
|
|
15
|
+
<path
|
|
16
|
+
d="M26.6666667,28.6046512 L26.6666667,30 L0,30 L0.000283687943,28.6046512 L26.6666667,28.6046512 Z M25.6140351,26.5116279 L25.6140351,28.255814 L1.05263158,28.255814 L1.05263158,26.5116279 L25.6140351,26.5116279 Z M3.62469203,7.6744186 L3.91746909,7.82153285 L4.0639977,10.1739544 L4.21052632,13.9963932 L4.21052632,17.6725617 L4.0639977,22.255044 L4.03962296,25.3421929 L3.62469203,25.4651163 L2.16024641,25.4651163 L1.72094074,25.3421929 L1.55031755,22.255044 L1.40350877,17.6970339 L1.40350877,14.0211467 L1.55031755,10.1739544 L1.68423854,7.80887484 L1.98962322,7.6744186 L3.62469203,7.6744186 Z M24.6774869,7.6744186 L24.9706026,7.82153285 L25.1168803,10.1739544 L25.2631579,13.9963932 L25.2631579,17.6725617 L25.1168803,22.255044 L25.0927809,25.3421929 L24.6774869,25.4651163 L23.2130291,25.4651163 L22.7736357,25.3421929 L22.602418,22.255044 L22.4561404,17.6970339 L22.4561404,14.0211467 L22.602418,10.1739544 L22.7369262,7.80887484 L23.0420916,7.6744186 L24.6774869,7.6744186 Z M9.94042303,7.6744186 L10.2332293,7.82153285 L10.3797725,10.1739544 L10.5263158,13.9963932 L10.5263158,17.6725617 L10.3797725,22.255044 L10.3556756,25.3421929 L9.94042303,25.4651163 L8.47583122,25.4651163 L8.0362015,25.3421929 L7.86556129,22.255044 L7.71929825,17.6970339 L7.71929825,14.0211467 L7.86556129,10.1739544 L8.00005604,7.80887484 L8.30491081,7.6744186 L9.94042303,7.6744186 Z M18.0105985,7.6744186 L18.3034047,7.82153285 L18.449948,10.1739544 L18.5964912,13.9963932 L18.5964912,17.6725617 L18.449948,22.255044 L18.425851,25.3421929 L18.0105985,25.4651163 L16.5460067,25.4651163 L16.1066571,25.3421929 L15.9357367,22.255044 L15.7894737,17.6970339 L15.7894737,14.0211467 L15.9357367,10.1739544 L16.0702315,7.80887484 L16.3753664,7.6744186 L18.0105985,7.6744186 Z M25.6140351,4.53488372 L25.6140351,6.97674419 L1.05263158,6.97674419 L1.05263158,4.53488372 L25.6140351,4.53488372 Z M13.0806755,0 L25.9649123,2.93331338 L25.4484139,3.8372093 L0.771925248,3.8372093 L0,3.1041615 L13.0806755,0 Z"
|
|
17
|
+
id="path-1"
|
|
18
|
+
></path>
|
|
19
|
+
</mask>
|
|
20
|
+
<use class="fill-color" xlink:href="#path-1"></use>
|
|
21
|
+
<g mask="url(#mask-2)" class="fill-color">
|
|
22
|
+
<path
|
|
23
|
+
d="M0,0 L26.6666667,0 L26.6666667,30 L0,30 L0,0 Z"
|
|
24
|
+
id="swatch"
|
|
25
|
+
></path>
|
|
26
|
+
</g>
|
|
27
|
+
</g>
|
|
28
|
+
</svg>
|
|
29
|
+
`;
|
|
30
30
|
//# sourceMappingURL=ia-logo-icon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ia-logo-icon.js","sourceRoot":"","sources":["../../../src/assets/ia-logo-icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAE3B,eAAe,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BlB,CAAC","sourcesContent":["import { html } from 'lit';\n\nexport default html`\n <svg\n class=\"ia-logo\"\n viewBox=\"0 0 27 30\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-labelledby=\"logoTitleID logoDescID\"\n >\n <title id=\"logoTitleID\">Internet Archive logo</title>\n <desc id=\"logoDescID\">\n A line drawing of the Internet Archive headquarters building façade.\n </desc>\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <mask id=\"mask-2\" class=\"fill-color\">\n <path\n d=\"M26.6666667,28.6046512 L26.6666667,30 L0,30 L0.000283687943,28.6046512 L26.6666667,28.6046512 Z M25.6140351,26.5116279 L25.6140351,28.255814 L1.05263158,28.255814 L1.05263158,26.5116279 L25.6140351,26.5116279 Z M3.62469203,7.6744186 L3.91746909,7.82153285 L4.0639977,10.1739544 L4.21052632,13.9963932 L4.21052632,17.6725617 L4.0639977,22.255044 L4.03962296,25.3421929 L3.62469203,25.4651163 L2.16024641,25.4651163 L1.72094074,25.3421929 L1.55031755,22.255044 L1.40350877,17.6970339 L1.40350877,14.0211467 L1.55031755,10.1739544 L1.68423854,7.80887484 L1.98962322,7.6744186 L3.62469203,7.6744186 Z M24.6774869,7.6744186 L24.9706026,7.82153285 L25.1168803,10.1739544 L25.2631579,13.9963932 L25.2631579,17.6725617 L25.1168803,22.255044 L25.0927809,25.3421929 L24.6774869,25.4651163 L23.2130291,25.4651163 L22.7736357,25.3421929 L22.602418,22.255044 L22.4561404,17.6970339 L22.4561404,14.0211467 L22.602418,10.1739544 L22.7369262,7.80887484 L23.0420916,7.6744186 L24.6774869,7.6744186 Z M9.94042303,7.6744186 L10.2332293,7.82153285 L10.3797725,10.1739544 L10.5263158,13.9963932 L10.5263158,17.6725617 L10.3797725,22.255044 L10.3556756,25.3421929 L9.94042303,25.4651163 L8.47583122,25.4651163 L8.0362015,25.3421929 L7.86556129,22.255044 L7.71929825,17.6970339 L7.71929825,14.0211467 L7.86556129,10.1739544 L8.00005604,7.80887484 L8.30491081,7.6744186 L9.94042303,7.6744186 Z M18.0105985,7.6744186 L18.3034047,7.82153285 L18.449948,10.1739544 L18.5964912,13.9963932 L18.5964912,17.6725617 L18.449948,22.255044 L18.425851,25.3421929 L18.0105985,25.4651163 L16.5460067,25.4651163 L16.1066571,25.3421929 L15.9357367,22.255044 L15.7894737,17.6970339 L15.7894737,14.0211467 L15.9357367,10.1739544 L16.0702315,7.80887484 L16.3753664,7.6744186 L18.0105985,7.6744186 Z M25.6140351,4.53488372 L25.6140351,6.97674419 L1.05263158,6.97674419 L1.05263158,4.53488372 L25.6140351,4.53488372 Z M13.0806755,0 L25.9649123,2.93331338 L25.4484139,3.8372093 L0.771925248,3.8372093 L0,3.1041615 L13.0806755,0 Z\"\n id=\"path-1\"\n ></path>\n </mask>\n <use class=\"fill-color\" xlink:href=\"#path-1\"></use>\n <g mask=\"url(#mask-2)\" class=\"fill-color\">\n <path\n d=\"M0,0 L26.6666667,0 L26.6666667,30 L0,30 L0,0 Z\"\n id=\"swatch\"\n ></path>\n </g>\n </g>\n </svg>\n`;\n"]}
|
|
1
|
+
{"version":3,"file":"ia-logo-icon.js","sourceRoot":"","sources":["../../../src/assets/ia-logo-icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAE3B,eAAe,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BlB,CAAC","sourcesContent":["import { html } from 'lit';\r\n\r\nexport default html`\r\n <svg\r\n class=\"ia-logo\"\r\n viewBox=\"0 0 27 30\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n aria-labelledby=\"logoTitleID logoDescID\"\r\n >\r\n <title id=\"logoTitleID\">Internet Archive logo</title>\r\n <desc id=\"logoDescID\">\r\n A line drawing of the Internet Archive headquarters building façade.\r\n </desc>\r\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n <mask id=\"mask-2\" class=\"fill-color\">\r\n <path\r\n d=\"M26.6666667,28.6046512 L26.6666667,30 L0,30 L0.000283687943,28.6046512 L26.6666667,28.6046512 Z M25.6140351,26.5116279 L25.6140351,28.255814 L1.05263158,28.255814 L1.05263158,26.5116279 L25.6140351,26.5116279 Z M3.62469203,7.6744186 L3.91746909,7.82153285 L4.0639977,10.1739544 L4.21052632,13.9963932 L4.21052632,17.6725617 L4.0639977,22.255044 L4.03962296,25.3421929 L3.62469203,25.4651163 L2.16024641,25.4651163 L1.72094074,25.3421929 L1.55031755,22.255044 L1.40350877,17.6970339 L1.40350877,14.0211467 L1.55031755,10.1739544 L1.68423854,7.80887484 L1.98962322,7.6744186 L3.62469203,7.6744186 Z M24.6774869,7.6744186 L24.9706026,7.82153285 L25.1168803,10.1739544 L25.2631579,13.9963932 L25.2631579,17.6725617 L25.1168803,22.255044 L25.0927809,25.3421929 L24.6774869,25.4651163 L23.2130291,25.4651163 L22.7736357,25.3421929 L22.602418,22.255044 L22.4561404,17.6970339 L22.4561404,14.0211467 L22.602418,10.1739544 L22.7369262,7.80887484 L23.0420916,7.6744186 L24.6774869,7.6744186 Z M9.94042303,7.6744186 L10.2332293,7.82153285 L10.3797725,10.1739544 L10.5263158,13.9963932 L10.5263158,17.6725617 L10.3797725,22.255044 L10.3556756,25.3421929 L9.94042303,25.4651163 L8.47583122,25.4651163 L8.0362015,25.3421929 L7.86556129,22.255044 L7.71929825,17.6970339 L7.71929825,14.0211467 L7.86556129,10.1739544 L8.00005604,7.80887484 L8.30491081,7.6744186 L9.94042303,7.6744186 Z M18.0105985,7.6744186 L18.3034047,7.82153285 L18.449948,10.1739544 L18.5964912,13.9963932 L18.5964912,17.6725617 L18.449948,22.255044 L18.425851,25.3421929 L18.0105985,25.4651163 L16.5460067,25.4651163 L16.1066571,25.3421929 L15.9357367,22.255044 L15.7894737,17.6970339 L15.7894737,14.0211467 L15.9357367,10.1739544 L16.0702315,7.80887484 L16.3753664,7.6744186 L18.0105985,7.6744186 Z M25.6140351,4.53488372 L25.6140351,6.97674419 L1.05263158,6.97674419 L1.05263158,4.53488372 L25.6140351,4.53488372 Z M13.0806755,0 L25.9649123,2.93331338 L25.4484139,3.8372093 L0.771925248,3.8372093 L0,3.1041615 L13.0806755,0 Z\"\r\n id=\"path-1\"\r\n ></path>\r\n </mask>\r\n <use class=\"fill-color\" xlink:href=\"#path-1\"></use>\r\n <g mask=\"url(#mask-2)\" class=\"fill-color\">\r\n <path\r\n d=\"M0,0 L26.6666667,0 L26.6666667,30 L0,30 L0,0 Z\"\r\n id=\"swatch\"\r\n ></path>\r\n </g>\r\n </g>\r\n </svg>\r\n`;\r\n"]}
|
|
@@ -1,92 +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
|
|
69
|
-
*
|
|
70
|
-
* @memberof ModalConfig
|
|
71
|
-
*/
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
*
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
+
}
|
package/dist/src/modal-config.js
CHANGED
|
@@ -1,23 +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;
|
|
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.
|
|
20
|
-
this.
|
|
21
|
-
|
|
22
|
-
|
|
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
|
+
}
|
|
23
25
|
//# sourceMappingURL=modal-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-config.js","sourceRoot":"","sources":["../../src/modal-config.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,OAAO,WAAW;
|
|
1
|
+
{"version":3,"file":"modal-config.js","sourceRoot":"","sources":["../../src/modal-config.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,OAAO,WAAW;IA8FtB,YAAY,OAcX;;QACC,IAAI,CAAC,KAAK,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,CAAC;QAC5B,IAAI,CAAC,QAAQ,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,CAAC;QAClC,IAAI,CAAC,QAAQ,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,CAAC;QAClC,IAAI,CAAC,OAAO,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CAAC;QAEhC,IAAI,CAAC,WAAW,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,mCAAI,SAAS,CAAC;QACrD,IAAI,CAAC,SAAS,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,mCAAI,SAAS,CAAC;QACjD,IAAI,CAAC,uBAAuB,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,uBAAuB,mCAAI,KAAK,CAAC;QACzE,IAAI,CAAC,mBAAmB,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,mBAAmB,mCAAI,UAAU,CAAC;QACtE,IAAI,CAAC,eAAe,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,mCAAI,IAAI,CAAC;QACxD,IAAI,CAAC,iBAAiB,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,iBAAiB,mCAAI,KAAK,CAAC;QAC7D,IAAI,CAAC,iBAAiB,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,iBAAiB,mCAAI,EAAE,CAAC;QAC1D,IAAI,CAAC,cAAc,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc,mCAAI,IAAI,CAAC;QACtD,IAAI,CAAC,oBAAoB,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,oBAAoB,mCAAI,IAAI,CAAC;IACpE,CAAC;CACF","sourcesContent":["import { TemplateResult } from 'lit';\r\n\r\n/**\r\n * Configuration to show a modal\r\n *\r\n * @export\r\n * @class ModalConfig\r\n */\r\nexport class ModalConfig {\r\n /**\r\n * The title that shows in the header\r\n *\r\n * @type {(TemplateResult | undefined)}\r\n * @memberof ModalConfig\r\n */\r\n title?: TemplateResult;\r\n\r\n /**\r\n * The subtitle shown in the header under the title\r\n *\r\n * @type {(TemplateResult | undefined)}\r\n * @memberof ModalConfig\r\n */\r\n subtitle?: TemplateResult;\r\n\r\n /**\r\n * The headline shown at the top of the content section\r\n *\r\n * @type {(TemplateResult | undefined)}\r\n * @memberof ModalConfig\r\n */\r\n headline?: TemplateResult;\r\n\r\n /**\r\n * The text shown below the headline in the content section\r\n *\r\n * @type {(TemplateResult | undefined)}\r\n * @memberof ModalConfig\r\n */\r\n message?: TemplateResult;\r\n\r\n /**\r\n * The background color of the header\r\n *\r\n * @memberof ModalConfig\r\n */\r\n headerColor: string;\r\n\r\n /**\r\n * The background color of the body\r\n *\r\n * @memberof ModalConfig\r\n */\r\n bodyColor: string;\r\n\r\n /**\r\n * Show or hide the processing indicator\r\n *\r\n * @memberof ModalConfig\r\n */\r\n showProcessingIndicator: boolean;\r\n\r\n /**\r\n * Set the processing image mode, currently `processing` or `complete`\r\n *\r\n * @memberof ModalConfig\r\n */\r\n processingImageMode: 'processing' | 'complete';\r\n\r\n /**\r\n * Show the close button\r\n *\r\n * @memberof ModalConfig\r\n */\r\n showCloseButton: boolean;\r\n\r\n /**\r\n * Show the left nav button\r\n *\r\n * @memberof ModalConfig\r\n */\r\n showLeftNavButton: boolean;\r\n\r\n /**\r\n * Left nav button text\r\n */\r\n leftNavButtonText: string;\r\n\r\n /**\r\n * Show the close button\r\n *\r\n * @memberof ModalConfig\r\n */\r\n showHeaderLogo: boolean;\r\n\r\n /**\r\n * Close the modal if the user taps on the background\r\n *\r\n * @memberof ModalConfig\r\n */\r\n closeOnBackdropClick: boolean;\r\n\r\n constructor(options?: {\r\n title?: TemplateResult;\r\n subtitle?: TemplateResult;\r\n headline?: TemplateResult;\r\n message?: TemplateResult;\r\n headerColor?: string;\r\n bodyColor?: string;\r\n showProcessingIndicator?: boolean;\r\n processingImageMode?: 'processing' | 'complete';\r\n showCloseButton?: boolean;\r\n showLeftNavButton?: boolean;\r\n leftNavButtonText?: string;\r\n showHeaderLogo?: boolean;\r\n closeOnBackdropClick?: boolean;\r\n }) {\r\n this.title = options?.title;\r\n this.subtitle = options?.subtitle;\r\n this.headline = options?.headline;\r\n this.message = options?.message;\r\n\r\n this.headerColor = options?.headerColor ?? '#55A183';\r\n this.bodyColor = options?.bodyColor ?? '#fbfbfd';\r\n this.showProcessingIndicator = options?.showProcessingIndicator ?? false;\r\n this.processingImageMode = options?.processingImageMode ?? 'complete';\r\n this.showCloseButton = options?.showCloseButton ?? true;\r\n this.showLeftNavButton = options?.showLeftNavButton ?? false;\r\n this.leftNavButtonText = options?.leftNavButtonText ?? '';\r\n this.showHeaderLogo = options?.showHeaderLogo ?? true;\r\n this.closeOnBackdropClick = options?.closeOnBackdropClick ?? true;\r\n }\r\n}\r\n"]}
|
|
@@ -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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-manager-host-bridge-interface.js","sourceRoot":"","sources":["../../src/modal-manager-host-bridge-interface.ts"],"names":[],"mappings":"","sourcesContent":["import { ModalManagerMode } from './modal-manager-mode';\n\n/**\n * The ModalManagerHostBridgeInterface is a delegate interface for\n * the host to implement environment-specific changes when the modal\n * is open or closed.\n *\n * A default implementation is provided, but can be overridden if\n * it does not work for the environment.\n */\nexport interface ModalManagerHostBridgeInterface {\n handleModeChange(mode: ModalManagerMode): void;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"modal-manager-host-bridge-interface.js","sourceRoot":"","sources":["../../src/modal-manager-host-bridge-interface.ts"],"names":[],"mappings":"","sourcesContent":["import { ModalManagerMode } from './modal-manager-mode';\r\n\r\n/**\r\n * The ModalManagerHostBridgeInterface is a delegate interface for\r\n * the host to implement environment-specific changes when the modal\r\n * is open or closed.\r\n *\r\n * A default implementation is provided, but can be overridden if\r\n * it does not work for the environment.\r\n */\r\nexport interface ModalManagerHostBridgeInterface {\r\n handleModeChange(mode: ModalManagerMode): void;\r\n}\r\n"]}
|
|
@@ -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
|