@maggioli-design-system/mds-modal 5.5.3 → 6.1.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/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mds-modal.cjs.entry.js +44 -3
- package/dist/cjs/mds-modal.cjs.js +1 -1
- package/dist/collection/common/floating-controller.js +7 -4
- package/dist/collection/components/mds-modal/mds-modal.css +318 -172
- package/dist/collection/components/mds-modal/mds-modal.js +74 -5
- package/dist/collection/components/mds-modal/meta/dictionary.js +6 -1
- package/dist/collection/components/mds-modal/test/mds-modal.stories.js +117 -12
- package/dist/collection/dictionary/button.js +2 -0
- package/dist/components/mds-modal.js +45 -3
- package/dist/documentation.json +91 -9
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mds-modal.entry.js +44 -3
- package/dist/esm/mds-modal.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mds-modal.entry.js +1 -1
- package/dist/esm-es5/mds-modal.js +1 -1
- package/dist/mds-modal/mds-modal.esm.js +1 -1
- package/dist/mds-modal/p-90ae863c.system.entry.js +1 -0
- package/dist/mds-modal/p-96b782c7.system.js +1 -1
- package/dist/mds-modal/p-d48861c7.entry.js +1 -0
- package/dist/stats.json +129 -32
- package/dist/types/components/mds-modal/mds-modal.d.ts +17 -3
- package/dist/types/components/mds-modal/meta/dictionary.d.ts +2 -1
- package/dist/types/components/mds-modal/meta/types.d.ts +1 -0
- package/dist/types/components/mds-modal/test/mds-modal.stories.d.ts +11 -1
- package/dist/types/components.d.ts +11 -3
- package/dist/types/type/button.d.ts +1 -1
- package/documentation.json +130 -18
- package/package.json +3 -3
- package/readme.md +22 -16
- package/src/common/floating-controller.ts +6 -3
- package/src/components/mds-modal/css/mds-modal-action-close.css +14 -0
- package/src/components/mds-modal/css/mds-modal-animation-3d.css +89 -0
- package/src/components/mds-modal/css/mds-modal-animation-custom.css +7 -0
- package/src/components/mds-modal/css/mds-modal-animation-slide.css +89 -0
- package/src/components/mds-modal/css/mds-modal-opened.css +8 -0
- package/src/components/mds-modal/css/mds-modal-position.css +166 -0
- package/src/components/mds-modal/css/mds-modal-window.css +42 -0
- package/src/components/mds-modal/mds-modal.css +25 -76
- package/src/components/mds-modal/mds-modal.tsx +52 -4
- package/src/components/mds-modal/meta/dictionary.ts +7 -0
- package/src/components/mds-modal/meta/types.ts +5 -0
- package/src/components/mds-modal/readme.md +22 -16
- package/src/components/mds-modal/test/mds-modal.stories.tsx +198 -54
- package/src/components.d.ts +11 -3
- package/src/dictionary/button.ts +2 -0
- package/src/fixtures/icons.json +9 -0
- package/src/type/button.ts +2 -0
- package/www/build/mds-modal.esm.js +1 -1
- package/www/build/p-90ae863c.system.entry.js +1 -0
- package/www/build/p-96b782c7.system.js +1 -1
- package/www/build/p-d48861c7.entry.js +1 -0
- package/dist/mds-modal/p-19906203.entry.js +0 -1
- package/dist/mds-modal/p-2b328972.system.entry.js +0 -1
- package/src/components/mds-modal/css/mds-modal-animate-bottom-left.css +0 -19
- package/src/components/mds-modal/css/mds-modal-animate-bottom-right.css +0 -19
- package/src/components/mds-modal/css/mds-modal-animate-bottom.css +0 -19
- package/src/components/mds-modal/css/mds-modal-animate-center.css +0 -18
- package/src/components/mds-modal/css/mds-modal-animate-left.css +0 -30
- package/src/components/mds-modal/css/mds-modal-animate-right.css +0 -30
- package/src/components/mds-modal/css/mds-modal-animate-top-left.css +0 -19
- package/src/components/mds-modal/css/mds-modal-animate-top-right.css +0 -19
- package/src/components/mds-modal/css/mds-modal-animate-top.css +0 -19
- package/src/components/mds-modal/css/mds-modal-animate.css +0 -25
- package/www/build/p-19906203.entry.js +0 -1
- package/www/build/p-2b328972.system.entry.js +0 -1
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
|
10
10
|
await appGlobals.globalScripts();
|
|
11
|
-
return index.bootstrapLazy([["mds-modal.cjs",[[1,"mds-modal",{"opened":[1540],"position":[1537],"animating":[1537],"overflow":[513]},[[4,"mdsModalClose","onModalCloseListener"],[4,"mdsBannerClose","onBannerCloseListener"]],{"opened":["handleOpenProp"]}]]]], options);
|
|
11
|
+
return index.bootstrapLazy([["mds-modal.cjs",[[1,"mds-modal",{"opened":[1540],"position":[1537],"animating":[1537],"animation":[513],"overflow":[513]},[[4,"mdsModalClose","onModalCloseListener"],[4,"mdsBannerClose","onBannerCloseListener"]],{"opened":["handleOpenProp"]}]]]], options);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
exports.setNonce = index.setNonce;
|
|
@@ -16,7 +16,7 @@ const cssDurationToMilliseconds = (duration, defaultValue = 1000) => {
|
|
|
16
16
|
return defaultValue;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
const mdsModalCss = "@-webkit-keyframes focus-bounce{0%,75%,100%{outline-offset:var(--magma-outline-focus-offset, 6px)}50%{outline-offset:var(--magma-outline-blur-offset, 2px)}}@keyframes focus-bounce{0%,75%,100%{outline-offset:var(--magma-outline-focus-offset, 6px)}50%{outline-offset:var(--magma-outline-blur-offset, 2px)}}@tailwind components; :host{--mds-modal-overlay-color:var(--magma-overlay-color, 0 0 0);--mds-modal-overlay-opacity:var(--magma-overlay-opacity, 0.5);--mds-modal-transition-duration:500ms;--mds-modal-transition-intro-ease:cubic-bezier(0.19, 1, 0.22, 1);--mds-modal-transition-outro-ease:cubic-bezier(0.86, 0, 0.07, 1);--mds-modal-window-background:rgb(var(--tone-neutral));--mds-modal-window-overflow:auto;--mds-modal-window-radius:0;--mds-modal-window-shadow:0 25px 50px -12px rgb(0 0 0 / 0.25);--mds-modal-window-distance:0;--mds-modal-custom-window-distance:1.5rem;--mds-modal-z-index:var(--magma-modal-z-index);-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1);-ms-flex-align:center;align-items:center;background-color:rgba(var(--mds-modal-overlay-color) / 0);display:-ms-flexbox;display:flex;fill:rgb(var(--tone-neutral));inset:0;-ms-flex-pack:center;justify-content:center;-webkit-perspective:600px;perspective:600px;pointer-events:none;position:fixed;-webkit-transition-duration:var(--mds-modal-transition-duration);transition-duration:var(--mds-modal-transition-duration);-webkit-transition-property:background-color;transition-property:background-color;z-index:var(--mds-modal-z-index, 1000)}:host ::slotted([slot=\"window\"]){margin:var(--mds-modal-custom-window-distance)}:host([position=\"top\"]){-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:center;justify-content:center}:host([position=\"bottom\"]){-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:center;justify-content:center}.action-close{border-radius:100px;opacity:0;pointer-events:none;position:absolute;-webkit-transition-duration:var(--mds-modal-transition-duration);transition-duration:var(--mds-modal-transition-duration);-webkit-transition-property:bottom, opacity, top, -webkit-transform;transition-property:bottom, opacity, top, -webkit-transform;transition-property:bottom, opacity, top, transform;transition-property:bottom, opacity, top, transform, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1)}:host([opened]:not([opened=\"false\"])) .action-close{opacity:1;pointer-events:auto}.action-close::part(icon){height:2.25rem;width:2.25rem}.window{gap:0rem;background-color:var(--mds-modal-window-background);border-radius:var(--mds-modal-window-radius);-webkit-box-shadow:var(--mds-modal-window-shadow);box-shadow:var(--mds-modal-window-shadow);display:grid;grid-template-rows:1fr;margin:var(--mds-modal-window-distance);overflow:var(--mds-modal-window-overflow)}.window--top{grid-template-rows:auto 1fr}.window--bottom{grid-template-rows:1fr auto}.window--top-bottom{grid-template-rows:auto 1fr auto}:host .window{-webkit-transition-delay:0s, calc(var(--mds-modal-transition-duration) / 2);transition-delay:0s, calc(var(--mds-modal-transition-duration) / 2)}:host([opened]:not([opened=\"false\"])){background-color:rgba(var(--mds-modal-overlay-color) / var(--mds-modal-overlay-opacity));pointer-events:auto}:host .window,:host>::slotted([slot=\"window\"]){opacity:0;-webkit-transition-duration:var(--mds-modal-transition-duration);transition-duration:var(--mds-modal-transition-duration);-webkit-transition-property:opacity, -webkit-transform;transition-property:opacity, -webkit-transform;transition-property:transform, opacity;transition-property:transform, opacity, -webkit-transform;-webkit-transition-timing-function:var(--mds-modal-transition-outro-ease);transition-timing-function:var(--mds-modal-transition-outro-ease)}:host([opened]:not([opened=\"false\"])) .window,:host([opened]:not([opened=\"false\"]))>::slotted([slot=\"window\"]){opacity:1;-webkit-transform:rotate(0) scale(1) translateY(0);transform:rotate(0) scale(1) translateY(0);-webkit-transition-delay:0s;transition-delay:0s;-webkit-transition-timing-function:var(--mds-modal-transition-intro-ease);transition-timing-function:var(--mds-modal-transition-intro-ease)}:host([position=\"bottom-left\"]){-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:start;justify-content:flex-start}:host([position=\"bottom\"]) .window{height:auto;width:100vw}:host([position=\"bottom-left\"][opened=\"false\"])>::slotted([slot=\"window\"]),:host([position=\"bottom-left\"]:not([opened]))>::slotted([slot=\"window\"]){-webkit-transform:rotateX(22deg) rotateY(22deg) scale(0.5) translate(-80%, 80%);transform:rotateX(22deg) rotateY(22deg) scale(0.5) translate(-80%, 80%)}:host([position=\"bottom-left\"][opened=\"false\"]) .window,:host([position=\"bottom-left\"]:not([opened])) .window{-webkit-transform:translate(0, 100%);transform:translate(0, 100%)}:host([position=\"bottom-right\"]){-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:end;justify-content:flex-end}:host([position=\"bottom\"]) .window{height:auto;width:100vw}:host([position=\"bottom-right\"][opened=\"false\"])>::slotted([slot=\"window\"]),:host([position=\"bottom-right\"]:not([opened]))>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) rotateY(-22deg) scale(0.5) translate(80%, 80%);transform:rotateX(-22deg) rotateY(-22deg) scale(0.5) translate(80%, 80%)}:host([position=\"bottom-right\"][opened=\"false\"]) .window,:host([position=\"bottom-right\"]:not([opened])) .window{-webkit-transform:translate(0, 100%);transform:translate(0, 100%)}:host([position=\"bottom\"]){-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:center;justify-content:center}:host([position=\"bottom\"]) .window{height:auto;width:100vw}:host([position=\"bottom\"][opened=\"false\"])>::slotted([slot=\"window\"]),:host([position=\"bottom\"]:not([opened]))>::slotted([slot=\"window\"]){-webkit-transform:rotateX(22deg) rotateY(0) scale(0.5) translate(0, 80%);transform:rotateX(22deg) rotateY(0) scale(0.5) translate(0, 80%)}:host([position=\"bottom\"][opened=\"false\"]) .window,:host([position=\"bottom\"]:not([opened])) .window{-webkit-transform:translate(0, 100%);transform:translate(0, 100%)}:host([position=\"center\"]){-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}:host([position=\"center\"]) .window{-webkit-transition-delay:0s;transition-delay:0s}:host([position=\"center\"][opened=\"false\"])>::slotted([slot=\"window\"]),:host([position=\"center\"]:not([opened]))>::slotted([slot=\"window\"]){-webkit-transform:rotateX(0) rotateY(22deg) scale(0.5) translate(0, 40%);transform:rotateX(0) rotateY(22deg) scale(0.5) translate(0, 40%)}:host([position=\"center\"][opened=\"false\"]) .window,:host([position=\"center\"]:not([opened])) .window{-webkit-transform:rotateX(0) rotateY(0) scale(0.5) translate(0, 0);transform:rotateX(0) rotateY(0) scale(0.5) translate(0, 0)}:host([position=\"left\"]){-ms-flex-align:center;align-items:center;-ms-flex-pack:start;justify-content:flex-start}:host([position=\"left\"]) .window{height:100%;max-height:calc(100dvh - calc(var(--mds-modal-window-distance) * 2));max-width:calc(100vw - 80px)}:host([position=\"left\"][opened=\"false\"])>::slotted([slot=\"window\"]),:host([position=\"left\"]:not([opened]))>::slotted([slot=\"window\"]){-webkit-transform:rotateX(0) rotateY(22deg) rotateZ(0) scale(0.5) translate(-100%, 0%);transform:rotateX(0) rotateY(22deg) rotateZ(0) scale(0.5) translate(-100%, 0%)}:host([position=\"left\"][opened=\"false\"]) .window,:host([position=\"left\"]:not([opened])) .window{-webkit-transform:translate(-100%, 0%);transform:translate(-100%, 0%)}:host([position=\"left\"]) .action-close{right:0.75rem;top:0.75rem;-webkit-transform:translateX(-120%) rotate(-45deg);transform:translateX(-120%) rotate(-45deg)}:host([position=\"left\"][opened]:not([opened=\"false\"])) .action-close{-webkit-transform:translateX(0);transform:translateX(0)}:host([position=\"right\"]){-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}:host([position=\"right\"]) .window{height:100%;max-height:calc(100dvh - calc(var(--mds-modal-window-distance) * 2));max-width:calc(100vw - 80px)}:host([position=\"right\"][opened=\"false\"])>::slotted([slot=\"window\"]),:host([position=\"right\"]:not([opened]))>::slotted([slot=\"window\"]){-webkit-transform:rotateX(0) rotateY(-22deg) rotateZ(0) scale(0.5) translate(100%, 0%);transform:rotateX(0) rotateY(-22deg) rotateZ(0) scale(0.5) translate(100%, 0%)}:host([position=\"right\"][opened=\"false\"]) .window,:host([position=\"right\"]:not([opened])) .window{-webkit-transform:translate(100%, 0%);transform:translate(100%, 0%)}:host([position=\"right\"]) .action-close{left:0.75rem;top:0.75rem;-webkit-transform:translateX(120%) rotate(45deg);transform:translateX(120%) rotate(45deg)}:host([position=\"right\"][opened]:not([opened=\"false\"])) .action-close{-webkit-transform:translateX(0);transform:translateX(0)}:host([position=\"top-left\"]){-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:start;justify-content:flex-start}:host([position=\"bottom\"]) .window{height:auto;width:100vw}:host([position=\"top-left\"][opened=\"false\"])>::slotted([slot=\"window\"]),:host([position=\"top-left\"]:not([opened]))>::slotted([slot=\"window\"]){-webkit-transform:rotateX(22deg) rotateY(22deg) scale(0.5) translate(-80%, 80%);transform:rotateX(22deg) rotateY(22deg) scale(0.5) translate(-80%, 80%)}:host([position=\"top-left\"][opened=\"false\"]) .window,:host([position=\"top-left\"]:not([opened])) .window{-webkit-transform:translate(0, -100%);transform:translate(0, -100%)}:host([position=\"top-right\"]){-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:end;justify-content:flex-end}:host([position=\"bottom\"]) .window{height:auto;width:100vw}:host([position=\"top-right\"][opened=\"false\"])>::slotted([slot=\"window\"]),:host([position=\"top-right\"]:not([opened]))>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) rotateY(-22deg) scale(0.5) translate(80%, 80%);transform:rotateX(-22deg) rotateY(-22deg) scale(0.5) translate(80%, 80%)}:host([position=\"top-right\"][opened=\"false\"]) .window,:host([position=\"top-right\"]:not([opened])) .window{-webkit-transform:translate(0, 100%);transform:translate(0, 100%)}:host([position=\"top\"]){-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:center;justify-content:center}:host([position=\"bottom\"]) .window{height:auto;width:100vw}:host([position=\"top\"][opened=\"false\"])>::slotted([slot=\"window\"]),:host([position=\"top\"]:not([opened]))>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) rotateY(0) scale(0.5) translate(0, -80%);transform:rotateX(-22deg) rotateY(0) scale(0.5) translate(0, -80%)}:host([position=\"top\"][opened=\"false\"]) .window,:host([position=\"top\"]:not([opened])) .window{-webkit-transform:translate(0, -100%);transform:translate(0, -100%)}:host-context(.pref-animation-reduce){--mds-modal-transition-duration:0s}:host-context(.pref-animation-reduce),:host-context(.pref-animation-reduce) .action-close,:host-context(.pref-animation-reduce) .window{-webkit-transition-duration:0s !important;transition-duration:0s !important}@media (prefers-reduced-motion){:host-context(.pref-animation-system){--mds-modal-transition-duration:0s}:host-context(.pref-animation-system),:host-context(.pref-animation-system) .action-close,:host-context(.pref-animation-system) .window{-webkit-transition-duration:0s !important;transition-duration:0s !important}}:host-context(.pref-contrast-more){--mds-modal-window-shadow:0 0 0 2px rgb(var(--tone-neutral-01) / 0.6), 0 25px 50px -12px rgb(0 0 0 / 0.25)}@media (prefers-contrast: more){:host-context(.pref-contrast-system){--mds-modal-window-shadow:0 0 0 2px rgb(var(--tone-neutral-01) / 0.6), 0 25px 50px -12px rgb(0 0 0 / 0.25)}}:host-context(.pref-theme-dark){--mds-modal-window-background:rgb(var(--tone-neutral-09));--mds-modal-window-shadow:0 0 0 1px rgb(var(--tone-neutral-01) / 0.3), 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)}@media (prefers-color-scheme: dark){:host-context(.pref-theme-system){--mds-modal-window-background:rgb(var(--tone-neutral-09));--mds-modal-window-shadow:0 0 0 1px rgb(var(--tone-neutral-01) / 0.3), 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)}}:host(:not(:is([hydrated],.hydrated))){-webkit-animation-duration:0s;animation-duration:0s;border-color:transparent;-webkit-box-shadow:0 0 0 transparent;box-shadow:0 0 0 transparent;opacity:0;outline-color:transparent;-webkit-transition-delay:0s;transition-delay:0s;-webkit-transition-duration:0s;transition-duration:0s;visibility:hidden}mds-accordion:not(:is([hydrated],.hydrated)),mds-accordion-item:not(:is([hydrated],.hydrated)),mds-accordion-timer:not(:is([hydrated],.hydrated)),mds-accordion-timer-item:not(:is([hydrated],.hydrated)),mds-author:not(:is([hydrated],.hydrated)),mds-avatar:not(:is([hydrated],.hydrated)),mds-badge:not(:is([hydrated],.hydrated)),mds-banner:not(:is([hydrated],.hydrated)),mds-benchmark-bar:not(:is([hydrated],.hydrated)),mds-bibliography:not(:is([hydrated],.hydrated)),mds-breadcrumb:not(:is([hydrated],.hydrated)),mds-breadcrumb-item:not(:is([hydrated],.hydrated)),mds-button:not(:is([hydrated],.hydrated)),mds-card:not(:is([hydrated],.hydrated)),mds-card-content:not(:is([hydrated],.hydrated)),mds-card-footer:not(:is([hydrated],.hydrated)),mds-card-header:not(:is([hydrated],.hydrated)),mds-card-media:not(:is([hydrated],.hydrated)),mds-chip:not(:is([hydrated],.hydrated)),mds-details:not(:is([hydrated],.hydrated)),mds-dropdown:not(:is([hydrated],.hydrated)),mds-entity:not(:is([hydrated],.hydrated)),mds-file:not(:is([hydrated],.hydrated)),mds-file-preview:not(:is([hydrated],.hydrated)),mds-filter:not(:is([hydrated],.hydrated)),mds-filter-item:not(:is([hydrated],.hydrated)),mds-header:not(:is([hydrated],.hydrated)),mds-header-bar:not(:is([hydrated],.hydrated)),mds-help:not(:is([hydrated],.hydrated)),mds-horizontal-scroll:not(:is([hydrated],.hydrated)),mds-hr:not(:is([hydrated],.hydrated)),mds-icon:not(:is([hydrated],.hydrated)),mds-img:not(:is([hydrated],.hydrated)),mds-input:not(:is([hydrated],.hydrated)),mds-input-field:not(:is([hydrated],.hydrated)),mds-input-range:not(:is([hydrated],.hydrated)),mds-input-select:not(:is([hydrated],.hydrated)),mds-input-switch:not(:is([hydrated],.hydrated)),mds-input-tip:not(:is([hydrated],.hydrated)),mds-input-tip-item:not(:is([hydrated],.hydrated)),mds-input-upload:not(:is([hydrated],.hydrated)),mds-keyboard:not(:is([hydrated],.hydrated)),mds-keyboard-key:not(:is([hydrated],.hydrated)),mds-kpi:not(:is([hydrated],.hydrated)),mds-kpi-item:not(:is([hydrated],.hydrated)),mds-label:not(:is([hydrated],.hydrated)),mds-list:not(:is([hydrated],.hydrated)),mds-list-item:not(:is([hydrated],.hydrated)),mds-modal:not(:is([hydrated],.hydrated)),mds-note:not(:is([hydrated],.hydrated)),mds-notification:not(:is([hydrated],.hydrated)),mds-paginator:not(:is([hydrated],.hydrated)),mds-paginator-item:not(:is([hydrated],.hydrated)),mds-pref:not(:is([hydrated],.hydrated)),mds-pref-animation:not(:is([hydrated],.hydrated)),mds-pref-consumption:not(:is([hydrated],.hydrated)),mds-pref-contrast:not(:is([hydrated],.hydrated)),mds-pref-language:not(:is([hydrated],.hydrated)),mds-pref-language-item:not(:is([hydrated],.hydrated)),mds-pref-theme:not(:is([hydrated],.hydrated)),mds-price-table:not(:is([hydrated],.hydrated)),mds-price-table-features:not(:is([hydrated],.hydrated)),mds-price-table-features-cell:not(:is([hydrated],.hydrated)),mds-price-table-features-row:not(:is([hydrated],.hydrated)),mds-price-table-header:not(:is([hydrated],.hydrated)),mds-price-table-list:not(:is([hydrated],.hydrated)),mds-price-table-list-item:not(:is([hydrated],.hydrated)),mds-progress:not(:is([hydrated],.hydrated)),mds-push-notification:not(:is([hydrated],.hydrated)),mds-push-notifications:not(:is([hydrated],.hydrated)),mds-quote:not(:is([hydrated],.hydrated)),mds-separator:not(:is([hydrated],.hydrated)),mds-spinner:not(:is([hydrated],.hydrated)),mds-stepper-bar:not(:is([hydrated],.hydrated)),mds-stepper-bar-item:not(:is([hydrated],.hydrated)),mds-tab:not(:is([hydrated],.hydrated)),mds-tab-bar:not(:is([hydrated],.hydrated)),mds-tab-bar-item:not(:is([hydrated],.hydrated)),mds-tab-item:not(:is([hydrated],.hydrated)),mds-table:not(:is([hydrated],.hydrated)),mds-table-body:not(:is([hydrated],.hydrated)),mds-table-cell:not(:is([hydrated],.hydrated)),mds-table-footer:not(:is([hydrated],.hydrated)),mds-table-header:not(:is([hydrated],.hydrated)),mds-table-header-cell:not(:is([hydrated],.hydrated)),mds-table-row:not(:is([hydrated],.hydrated)),mds-text:not(:is([hydrated],.hydrated)),mds-toast:not(:is([hydrated],.hydrated)),mds-tooltip:not(:is([hydrated],.hydrated)),mds-tree:not(:is([hydrated],.hydrated)),mds-tree-item:not(:is([hydrated],.hydrated)),mds-url-view:not(:is([hydrated],.hydrated)),mds-usage:not(:is([hydrated],.hydrated)),mds-video-wall:not(:is([hydrated],.hydrated)),mds-zero:not(:is([hydrated],.hydrated)){-webkit-animation-duration:0s;animation-duration:0s;border-color:transparent;-webkit-box-shadow:0 0 0 transparent;box-shadow:0 0 0 transparent;opacity:0;outline-color:transparent;-webkit-transition-delay:0s;transition-delay:0s;-webkit-transition-duration:0s;transition-duration:0s;visibility:hidden}";
|
|
19
|
+
const mdsModalCss = "@-webkit-keyframes focus-bounce{0%,75%,100%{outline-offset:var(--magma-outline-focus-offset, 6px)}50%{outline-offset:var(--magma-outline-blur-offset, 2px)}}@keyframes focus-bounce{0%,75%,100%{outline-offset:var(--magma-outline-focus-offset, 6px)}50%{outline-offset:var(--magma-outline-blur-offset, 2px)}}@tailwind components; :host{--mds-modal-custom-closed-transform:rotateX(10deg) rotateY(0) scale(1.25) translate(0, 10%);--mds-modal-custom-window-distance:1.5rem;--mds-modal-overlay-color:var(--magma-overlay-color, 0 0 0);--mds-modal-overlay-opacity:var(--magma-overlay-opacity, 0.5);--mds-modal-transition-duration:500ms;--mds-modal-transition-timing-funciton:cubic-bezier(0.86, 0, 0.07, 1);--mds-modal-window-background:rgb(var(--tone-neutral));--mds-modal-window-distance:0;--mds-modal-window-max-width:33%;--mds-modal-window-min-width:400px;--mds-modal-window-overflow:auto;--mds-modal-window-radius:0;--mds-modal-window-shadow:0 25px 50px -12px rgb(0 0 0 / 0.25);--mds-modal-z-index:var(--magma-modal-z-index);--mds-modal-custom-opened-transform:translate(0, 0);--mds-modal-transition-window-transform:translate(0);--mds-modal-window-close-margin:5rem;-webkit-transition-timing-function:cubic-bezier(0.86, 0, 0.07, 1);transition-timing-function:cubic-bezier(0.86, 0, 0.07, 1);-ms-flex-align:center;align-items:center;background-color:rgba(var(--mds-modal-overlay-color) / 0);display:-ms-flexbox;display:flex;fill:rgb(var(--tone-neutral));inset:0;-ms-flex-pack:center;justify-content:center;-webkit-perspective:600px;perspective:600px;pointer-events:none;position:fixed;-webkit-transition-duration:var(--mds-modal-transition-duration);transition-duration:var(--mds-modal-transition-duration);-webkit-transition-property:background-color;transition-property:background-color;-webkit-transition-timing-function:var(--mds-modal-transition-timing-funciton);transition-timing-function:var(--mds-modal-transition-timing-funciton);z-index:var(--mds-modal-z-index, 1000)}.action-close{border-radius:100px;opacity:0;pointer-events:none;position:absolute;-webkit-transition-duration:var(--mds-modal-transition-duration);transition-duration:var(--mds-modal-transition-duration);-webkit-transition-property:bottom, opacity, top, -webkit-transform;transition-property:bottom, opacity, top, -webkit-transform;transition-property:bottom, opacity, top, transform;transition-property:bottom, opacity, top, transform, -webkit-transform;-webkit-transition-timing-function:var(--mds-modal-transition-timing-function);transition-timing-function:var(--mds-modal-transition-timing-function)}.action-close::part(icon){height:2.25rem;width:2.25rem}:host([position=\"top-left\"][animation=\"3d\"]:not([opened])){--mds-modal-transition-window-transform:rotateX(22deg) rotateY(22deg) scale(0.5) translate(-80%, 80%)}:host([position=\"top\"][animation=\"3d\"]:not([opened])){--mds-modal-transition-window-transform:rotateX(-22deg) rotateY(0) scale(0.5) translate(0, -80%)}:host([position=\"top-right\"][animation=\"3d\"]:not([opened])){--mds-modal-transition-window-transform:rotateX(-22deg) rotateY(-22deg) scale(0.5) translate(80%, 80%)}:host([position=\"left\"][animation=\"3d\"]:not([opened])){--mds-modal-transition-window-transform:rotateX(0) rotateY(22deg) rotateZ(0) scale(0.5) translate(-100%, 0%)}:host([position=\"center\"][animation=\"3d\"]:not([opened])){--mds-modal-transition-window-transform:rotateX(0) rotateY(22deg) scale(0.5) translate(0, 40%)}:host([position=\"right\"][animation=\"3d\"]:not([opened])){--mds-modal-transition-window-transform:rotateX(0) rotateY(-22deg) rotateZ(0) scale(0.5) translate(100%, 0%)}:host([position=\"bottom-left\"][animation=\"3d\"]:not([opened])){--mds-modal-transition-window-transform:rotateX(22deg) rotateY(22deg) scale(0.5) translate(-80%, 80%)}:host([position=\"bottom\"][animation=\"3d\"]:not([opened])){--mds-modal-transition-window-transform:rotateX(22deg) rotateY(0) scale(0.5) translate(0, 80%)}:host([position=\"bottom-right\"][animation=\"3d\"]:not([opened])){--mds-modal-transition-window-transform:rotateX(-22deg) rotateY(-22deg) scale(0.5) translate(80%, 80%)}:host([animation=\"custom\"]:not([opened])){--mds-modal-transition-window-transform:var(--mds-modal-custom-closed-transform)}:host([animation=\"custom\"][opened]){--mds-modal-transition-window-transform:var(--mds-modal-custom-opened-transform)}:host([position=\"top-left\"][animation=\"slide\"]:not([opened])){--mds-modal-transition-window-transform:translate(-50%, -100%)}:host([position=\"top\"][animation=\"slide\"]:not([opened])){--mds-modal-transition-window-transform:translate(0, -100%)}:host([position=\"top-right\"][animation=\"slide\"]:not([opened])){--mds-modal-transition-window-transform:translate(50%, -100%)}:host([position=\"left\"][animation=\"slide\"]:not([opened])){--mds-modal-transition-window-transform:translate(-100%, 0%)}:host([position=\"center\"][animation=\"slide\"]:not([opened])){--mds-modal-transition-window-transform:translate(0, 25%)}:host([position=\"right\"][animation=\"slide\"]:not([opened])){--mds-modal-transition-window-transform:translate(100%, 0%)}:host([position=\"bottom-left\"][animation=\"slide\"]:not([opened])){--mds-modal-transition-window-transform:translate(-50%, 100%)}:host([position=\"bottom\"][animation=\"slide\"]:not([opened])){--mds-modal-transition-window-transform:translateY(50%)}:host([position=\"bottom-right\"][animation=\"slide\"]:not([opened])){--mds-modal-transition-window-transform:translate(50%, 100%)}:host([opened]){--mds-modal-transition-window-transform:none;background-color:rgba(var(--mds-modal-overlay-color) / var(--mds-modal-overlay-opacity));pointer-events:auto}:host([position=\"top-left\"]){-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:start;justify-content:flex-start}:host([position=\"top\"]){-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:center;justify-content:center}:host([position=\"top\"]) .window{height:auto;width:100vw}:host([position=\"top-right\"]){-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:end;justify-content:flex-end}:host([position=\"left\"]){-ms-flex-align:center;align-items:center;-ms-flex-pack:start;justify-content:flex-start}:host([position=\"left\"]) .action-close{right:0.75rem;top:0.75rem}:host([position=\"left\"][opened]) .action-close{opacity:1;pointer-events:auto}:host([position=\"left\"]:not([opened])) .action-close{-webkit-transform:translateX(-120%) rotate(-45deg);transform:translateX(-120%) rotate(-45deg)}:host([position=\"left\"]) .window{height:100%;max-height:calc(100dvh - calc(var(--mds-modal-window-distance) * 2));max-width:calc(100vw - var(--mds-modal-window-close-margin));min-width:0}@media (width > 480px){:host([position=\"left\"]) .window{max-width:calc(100vw - var(--mds-modal-window-close-margin));min-width:var(--mds-modal-window-min-width);width:var(--mds-modal-window-max-width)}}:host([position=\"center\"]){-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}:host([position=\"right\"]){-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}:host([position=\"right\"]) .action-close{left:0.75rem;top:0.75rem}:host([position=\"right\"]:not([opened])) .action-close{-webkit-transform:translateX(120%) rotate(45deg);transform:translateX(120%) rotate(45deg)}:host([position=\"right\"][opened]) .action-close{opacity:1;pointer-events:auto}:host([position=\"right\"]) .window{height:100%;max-height:calc(100dvh - calc(var(--mds-modal-window-distance) * 2));max-width:calc(100vw - var(--mds-modal-window-close-margin));min-width:0}@media (width > 480px){:host([position=\"right\"]) .window{max-width:calc(100vw - var(--mds-modal-window-close-margin));min-width:var(--mds-modal-window-min-width);width:var(--mds-modal-window-max-width)}}:host([position=\"bottom-left\"]){-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:start;justify-content:flex-start}:host([position=\"bottom\"]){-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:center;justify-content:center}:host([position=\"bottom\"]) .window{height:auto;width:100vw}:host([position=\"bottom-right\"]){-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:end;justify-content:flex-end}:host ::slotted([slot=\"window\"]){margin:var(--mds-modal-custom-window-distance)}.window{gap:0rem;background-color:var(--mds-modal-window-background);border-radius:var(--mds-modal-window-radius);-webkit-box-shadow:var(--mds-modal-window-shadow);box-shadow:var(--mds-modal-window-shadow);display:grid;grid-template-rows:1fr;margin:var(--mds-modal-window-distance);overflow:var(--mds-modal-window-overflow)}.window--top{grid-template-rows:auto 1fr}.window--bottom{grid-template-rows:1fr auto}.window--top-bottom{grid-template-rows:auto 1fr auto}:host .window,:host>::slotted([slot=\"window\"]){opacity:0;-webkit-transform:var(--mds-modal-transition-window-transform);transform:var(--mds-modal-transition-window-transform);-webkit-transition-duration:var(--mds-modal-transition-duration);transition-duration:var(--mds-modal-transition-duration);-webkit-transition-property:opacity, -webkit-transform;transition-property:opacity, -webkit-transform;transition-property:transform, opacity;transition-property:transform, opacity, -webkit-transform;-webkit-transition-timing-function:var(--mds-modal-transition-timing-funciton);transition-timing-function:var(--mds-modal-transition-timing-funciton)}:host([opened]) .window,:host([opened])>::slotted([slot=\"window\"]){opacity:1;-webkit-transition-timing-function:var(--mds-modal-transition-timing-funciton);transition-timing-function:var(--mds-modal-transition-timing-funciton)}:host-context(.pref-animation-reduce){--mds-modal-transition-duration:0s}:host-context(.pref-animation-reduce),:host-context(.pref-animation-reduce) .action-close,:host-context(.pref-animation-reduce) .window{-webkit-transition-duration:0s !important;transition-duration:0s !important}@media (prefers-reduced-motion){:host-context(.pref-animation-system){--mds-modal-transition-duration:0s}:host-context(.pref-animation-system),:host-context(.pref-animation-system) .action-close,:host-context(.pref-animation-system) .window{-webkit-transition-duration:0s !important;transition-duration:0s !important}}:host-context(.pref-contrast-more){--mds-modal-window-shadow:0 0 0 2px rgb(var(--tone-neutral-01) / 0.6), 0 25px 50px -12px rgb(0 0 0 / 0.25)}@media (prefers-contrast: more){:host-context(.pref-contrast-system){--mds-modal-window-shadow:0 0 0 2px rgb(var(--tone-neutral-01) / 0.6), 0 25px 50px -12px rgb(0 0 0 / 0.25)}}:host-context(.pref-theme-dark){--mds-modal-window-background:rgb(var(--tone-neutral-09));--mds-modal-window-shadow:0 0 0 1px rgb(var(--tone-neutral-01) / 0.3), 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)}@media (prefers-color-scheme: dark){:host-context(.pref-theme-system){--mds-modal-window-background:rgb(var(--tone-neutral-09));--mds-modal-window-shadow:0 0 0 1px rgb(var(--tone-neutral-01) / 0.3), 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)}}:host(:not(:is([hydrated],.hydrated))){-webkit-animation-duration:0s;animation-duration:0s;border-color:transparent;-webkit-box-shadow:0 0 0 transparent;box-shadow:0 0 0 transparent;opacity:0;outline-color:transparent;-webkit-transition-delay:0s;transition-delay:0s;-webkit-transition-duration:0s;transition-duration:0s;visibility:hidden}mds-accordion:not(:is([hydrated],.hydrated)),mds-accordion-item:not(:is([hydrated],.hydrated)),mds-accordion-timer:not(:is([hydrated],.hydrated)),mds-accordion-timer-item:not(:is([hydrated],.hydrated)),mds-author:not(:is([hydrated],.hydrated)),mds-avatar:not(:is([hydrated],.hydrated)),mds-badge:not(:is([hydrated],.hydrated)),mds-banner:not(:is([hydrated],.hydrated)),mds-benchmark-bar:not(:is([hydrated],.hydrated)),mds-bibliography:not(:is([hydrated],.hydrated)),mds-breadcrumb:not(:is([hydrated],.hydrated)),mds-breadcrumb-item:not(:is([hydrated],.hydrated)),mds-button:not(:is([hydrated],.hydrated)),mds-card:not(:is([hydrated],.hydrated)),mds-card-content:not(:is([hydrated],.hydrated)),mds-card-footer:not(:is([hydrated],.hydrated)),mds-card-header:not(:is([hydrated],.hydrated)),mds-card-media:not(:is([hydrated],.hydrated)),mds-chip:not(:is([hydrated],.hydrated)),mds-details:not(:is([hydrated],.hydrated)),mds-dropdown:not(:is([hydrated],.hydrated)),mds-entity:not(:is([hydrated],.hydrated)),mds-file:not(:is([hydrated],.hydrated)),mds-file-preview:not(:is([hydrated],.hydrated)),mds-filter:not(:is([hydrated],.hydrated)),mds-filter-item:not(:is([hydrated],.hydrated)),mds-header:not(:is([hydrated],.hydrated)),mds-header-bar:not(:is([hydrated],.hydrated)),mds-help:not(:is([hydrated],.hydrated)),mds-horizontal-scroll:not(:is([hydrated],.hydrated)),mds-hr:not(:is([hydrated],.hydrated)),mds-icon:not(:is([hydrated],.hydrated)),mds-img:not(:is([hydrated],.hydrated)),mds-input:not(:is([hydrated],.hydrated)),mds-input-field:not(:is([hydrated],.hydrated)),mds-input-range:not(:is([hydrated],.hydrated)),mds-input-select:not(:is([hydrated],.hydrated)),mds-input-switch:not(:is([hydrated],.hydrated)),mds-input-tip:not(:is([hydrated],.hydrated)),mds-input-tip-item:not(:is([hydrated],.hydrated)),mds-input-upload:not(:is([hydrated],.hydrated)),mds-keyboard:not(:is([hydrated],.hydrated)),mds-keyboard-key:not(:is([hydrated],.hydrated)),mds-kpi:not(:is([hydrated],.hydrated)),mds-kpi-item:not(:is([hydrated],.hydrated)),mds-label:not(:is([hydrated],.hydrated)),mds-list:not(:is([hydrated],.hydrated)),mds-list-item:not(:is([hydrated],.hydrated)),mds-modal:not(:is([hydrated],.hydrated)),mds-note:not(:is([hydrated],.hydrated)),mds-notification:not(:is([hydrated],.hydrated)),mds-paginator:not(:is([hydrated],.hydrated)),mds-paginator-item:not(:is([hydrated],.hydrated)),mds-pref:not(:is([hydrated],.hydrated)),mds-pref-animation:not(:is([hydrated],.hydrated)),mds-pref-consumption:not(:is([hydrated],.hydrated)),mds-pref-contrast:not(:is([hydrated],.hydrated)),mds-pref-language:not(:is([hydrated],.hydrated)),mds-pref-language-item:not(:is([hydrated],.hydrated)),mds-pref-theme:not(:is([hydrated],.hydrated)),mds-price-table:not(:is([hydrated],.hydrated)),mds-price-table-features:not(:is([hydrated],.hydrated)),mds-price-table-features-cell:not(:is([hydrated],.hydrated)),mds-price-table-features-row:not(:is([hydrated],.hydrated)),mds-price-table-header:not(:is([hydrated],.hydrated)),mds-price-table-list:not(:is([hydrated],.hydrated)),mds-price-table-list-item:not(:is([hydrated],.hydrated)),mds-progress:not(:is([hydrated],.hydrated)),mds-push-notification:not(:is([hydrated],.hydrated)),mds-push-notifications:not(:is([hydrated],.hydrated)),mds-quote:not(:is([hydrated],.hydrated)),mds-separator:not(:is([hydrated],.hydrated)),mds-spinner:not(:is([hydrated],.hydrated)),mds-stepper-bar:not(:is([hydrated],.hydrated)),mds-stepper-bar-item:not(:is([hydrated],.hydrated)),mds-tab:not(:is([hydrated],.hydrated)),mds-tab-bar:not(:is([hydrated],.hydrated)),mds-tab-bar-item:not(:is([hydrated],.hydrated)),mds-tab-item:not(:is([hydrated],.hydrated)),mds-table:not(:is([hydrated],.hydrated)),mds-table-body:not(:is([hydrated],.hydrated)),mds-table-cell:not(:is([hydrated],.hydrated)),mds-table-footer:not(:is([hydrated],.hydrated)),mds-table-header:not(:is([hydrated],.hydrated)),mds-table-header-cell:not(:is([hydrated],.hydrated)),mds-table-row:not(:is([hydrated],.hydrated)),mds-text:not(:is([hydrated],.hydrated)),mds-toast:not(:is([hydrated],.hydrated)),mds-tooltip:not(:is([hydrated],.hydrated)),mds-tree:not(:is([hydrated],.hydrated)),mds-tree-item:not(:is([hydrated],.hydrated)),mds-url-view:not(:is([hydrated],.hydrated)),mds-usage:not(:is([hydrated],.hydrated)),mds-video-wall:not(:is([hydrated],.hydrated)),mds-zero:not(:is([hydrated],.hydrated)){-webkit-animation-duration:0s;animation-duration:0s;border-color:transparent;-webkit-box-shadow:0 0 0 transparent;box-shadow:0 0 0 transparent;opacity:0;outline-color:transparent;-webkit-transition-delay:0s;transition-delay:0s;-webkit-transition-duration:0s;transition-duration:0s;visibility:hidden}";
|
|
20
20
|
const MdsModalStyle0 = mdsModalCss;
|
|
21
21
|
|
|
22
22
|
const MdsModal = class {
|
|
@@ -27,6 +27,7 @@ const MdsModal = class {
|
|
|
27
27
|
this.window = false;
|
|
28
28
|
this.top = false;
|
|
29
29
|
this.bottom = false;
|
|
30
|
+
this.touchMargin = 50;
|
|
30
31
|
/**
|
|
31
32
|
* Specifies if the modal is opened or not
|
|
32
33
|
*/
|
|
@@ -39,6 +40,10 @@ const MdsModal = class {
|
|
|
39
40
|
* Specifies if the component is animating itself or not
|
|
40
41
|
*/
|
|
41
42
|
this.animating = 'none';
|
|
43
|
+
/**
|
|
44
|
+
* Specifies if the component is animating itself or not
|
|
45
|
+
*/
|
|
46
|
+
this.animation = 'slide';
|
|
42
47
|
/**
|
|
43
48
|
* Specifies if the component prevents the body from scrolling when modal window is opened
|
|
44
49
|
*/
|
|
@@ -89,6 +94,30 @@ const MdsModal = class {
|
|
|
89
94
|
clearTimeout(this.animationDelayTimeout);
|
|
90
95
|
this.animationDelayTimeout = setTimeout(this.stopOutroAnimationWindow.bind(this), cssDurationToMilliseconds(this.cssTransitionDuration));
|
|
91
96
|
};
|
|
97
|
+
this.setTouchStart = (event) => {
|
|
98
|
+
this.touchStartX = event.touches[0].clientX;
|
|
99
|
+
this.touchStartY = event.touches[0].clientY;
|
|
100
|
+
};
|
|
101
|
+
this.setTouchEnd = (event) => {
|
|
102
|
+
const endX = event.changedTouches[0].clientX;
|
|
103
|
+
const endY = event.changedTouches[0].clientY;
|
|
104
|
+
const diffX = this.touchStartX - endX;
|
|
105
|
+
const diffY = this.touchStartY - endY;
|
|
106
|
+
// if is NOT a diagonal swipe
|
|
107
|
+
if (Math.abs(diffX) > Math.abs(diffY)) {
|
|
108
|
+
if (this.position === 'right' && diffX > 0)
|
|
109
|
+
return;
|
|
110
|
+
if (this.position === 'left' && diffX < 0)
|
|
111
|
+
return;
|
|
112
|
+
if (Math.abs(diffX) > Math.abs(this.touchMargin)) {
|
|
113
|
+
this.opened = undefined;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
this.addMobileEvents = () => {
|
|
118
|
+
this.windowElement.addEventListener('touchstart', this.setTouchStart);
|
|
119
|
+
this.windowElement.addEventListener('touchend', this.setTouchEnd);
|
|
120
|
+
};
|
|
92
121
|
this.closeModal = (e) => {
|
|
93
122
|
var _a;
|
|
94
123
|
if (((_a = e.target) === null || _a === void 0 ? void 0 : _a.localName) !== 'mds-modal') {
|
|
@@ -116,8 +145,19 @@ const MdsModal = class {
|
|
|
116
145
|
this.animating = this.opened ? 'intro' : 'outro';
|
|
117
146
|
}
|
|
118
147
|
componentDidLoad() {
|
|
148
|
+
var _a;
|
|
149
|
+
this.windowElement = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.window');
|
|
150
|
+
if (this.windowElement) {
|
|
151
|
+
this.addMobileEvents();
|
|
152
|
+
}
|
|
119
153
|
this.updateCSSCustomProps();
|
|
120
154
|
}
|
|
155
|
+
disconnectedCallback() {
|
|
156
|
+
if (this.windowElement) {
|
|
157
|
+
this.windowElement.removeEventListener('touchstart', this.setTouchStart);
|
|
158
|
+
this.windowElement.removeEventListener('touchend', this.setTouchEnd);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
121
161
|
handleOpenProp(newValue) {
|
|
122
162
|
if (newValue) {
|
|
123
163
|
if (this.overflow === 'auto') {
|
|
@@ -126,6 +166,7 @@ const MdsModal = class {
|
|
|
126
166
|
this.animateOpenWindow();
|
|
127
167
|
return;
|
|
128
168
|
}
|
|
169
|
+
this.opened = undefined;
|
|
129
170
|
if (this.overflow === 'auto') {
|
|
130
171
|
this.enableOverflow();
|
|
131
172
|
}
|
|
@@ -138,11 +179,11 @@ const MdsModal = class {
|
|
|
138
179
|
this.opened = false;
|
|
139
180
|
}
|
|
140
181
|
render() {
|
|
141
|
-
return (index.h(index.Host, { key: '
|
|
182
|
+
return (index.h(index.Host, { key: '82116db62888cf342e07757e26f4cdf8bf21bffe', "aria-modal": clsx(this.opened ? 'true' : 'false'), onClick: (e) => { this.closeModal(e); } }, this.window
|
|
142
183
|
? index.h("slot", { name: "window" })
|
|
143
184
|
: index.h("div", { class: clsx('window', (this.top || this.bottom) && `window-${this.top ? '-top' : ''}${this.bottom ? '-bottom' : ''}`), part: "window" }, this.top &&
|
|
144
185
|
index.h("slot", { name: "top" }), index.h("slot", null), this.bottom &&
|
|
145
|
-
index.h("slot", { name: "bottom" })), !this.window && index.h("mds-button", { key: '
|
|
186
|
+
index.h("slot", { name: "bottom" })), !this.window && index.h("mds-button", { key: 'dd50f1a8a2a7d709697e16b64fd52496f88f785b', class: "action-close", icon: "mi/baseline/close", variant: "light", tone: "quiet", size: "xl", onClick: (e) => { this.closeModal(e); }, part: "action-close" })));
|
|
146
187
|
}
|
|
147
188
|
get host() { return index.getElement(this); }
|
|
148
189
|
static get watchers() { return {
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["mds-modal.cjs",[[1,"mds-modal",{"opened":[1540],"position":[1537],"animating":[1537],"overflow":[513]},[[4,"mdsModalClose","onModalCloseListener"],[4,"mdsBannerClose","onBannerCloseListener"]],{"opened":["handleOpenProp"]}]]]], options);
|
|
22
|
+
return index.bootstrapLazy([["mds-modal.cjs",[[1,"mds-modal",{"opened":[1540],"position":[1537],"animating":[1537],"animation":[513],"overflow":[513]},[[4,"mdsModalClose","onModalCloseListener"],[4,"mdsBannerClose","onBannerCloseListener"]],{"opened":["handleOpenProp"]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -117,6 +117,7 @@ export class FloatingController {
|
|
|
117
117
|
left: `${x}px`,
|
|
118
118
|
top: `${y}px`,
|
|
119
119
|
transformOrigin: this.convertToTransformOrigin(placement),
|
|
120
|
+
position: this._host.strategy,
|
|
120
121
|
});
|
|
121
122
|
const arrowStyle = {};
|
|
122
123
|
const arrowPosition = {
|
|
@@ -151,12 +152,14 @@ export class FloatingController {
|
|
|
151
152
|
return caller;
|
|
152
153
|
}
|
|
153
154
|
updatePosition() {
|
|
154
|
-
if (this.
|
|
155
|
-
this.
|
|
156
|
-
|
|
155
|
+
if (this._host.visible) {
|
|
156
|
+
this.dismiss(); // to clean the old update function before update function
|
|
157
|
+
this.cleanupAutoUpdate = autoUpdate(this._caller, this._host, this.calculatePosition);
|
|
158
|
+
}
|
|
157
159
|
}
|
|
158
160
|
dismiss() {
|
|
159
|
-
this.cleanupAutoUpdate
|
|
161
|
+
if (this.cleanupAutoUpdate)
|
|
162
|
+
this.cleanupAutoUpdate();
|
|
160
163
|
}
|
|
161
164
|
}
|
|
162
165
|
export class Backdrop {
|