@maggioli-design-system/mds-modal 6.5.2 → 6.6.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/{index-608e964b.js → index-58bba9e7.js} +22 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mds-modal.cjs.entry.js +13 -7
- package/dist/cjs/mds-modal.cjs.js +1 -1
- package/dist/collection/components/mds-modal/mds-modal.css +31 -6
- package/dist/collection/components/mds-modal/mds-modal.js +11 -5
- package/dist/collection/components/mds-modal/test/mds-modal.stories.js +114 -7
- package/dist/components/mds-modal.js +12 -6
- package/dist/documentation.json +1 -1
- package/dist/esm/{index-135d7cb6.js → index-01d79020.js} +22 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/mds-modal.entry.js +13 -7
- package/dist/esm/mds-modal.js +2 -2
- package/dist/esm-es5/index-01d79020.js +1 -0
- 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/mds-modal.js +1 -1
- package/dist/mds-modal/p-09408c0c.entry.js +1 -0
- package/dist/mds-modal/p-58e5c4e1.system.js +2 -0
- package/dist/mds-modal/p-89e1a012.js +2 -0
- package/dist/mds-modal/p-f4ea7656.system.entry.js +1 -0
- package/dist/mds-modal/{p-c15fdaba.system.js → p-fceffab5.system.js} +1 -1
- package/dist/stats.json +32 -31
- package/dist/types/components/mds-modal/mds-modal.d.ts +4 -0
- package/dist/types/components/mds-modal/test/mds-modal.stories.d.ts +22 -0
- package/documentation.json +1 -1
- package/package.json +2 -2
- package/src/components/mds-modal/css/mds-modal-position-center.css +2 -2
- package/src/components/mds-modal/css/mds-modal-window.css +28 -3
- package/src/components/mds-modal/mds-modal.css +1 -1
- package/src/components/mds-modal/mds-modal.tsx +23 -6
- package/src/components/mds-modal/test/mds-modal.stories.tsx +245 -116
- package/src/fixtures/icons.json +0 -1
- package/www/build/mds-modal.esm.js +1 -1
- package/www/build/mds-modal.js +1 -1
- package/www/build/p-09408c0c.entry.js +1 -0
- package/www/build/p-58e5c4e1.system.js +2 -0
- package/www/build/p-89e1a012.js +2 -0
- package/www/build/p-f4ea7656.system.entry.js +1 -0
- package/www/build/{p-c15fdaba.system.js → p-fceffab5.system.js} +1 -1
- package/dist/esm-es5/index-135d7cb6.js +0 -1
- package/dist/mds-modal/p-3963a8e4.entry.js +0 -1
- package/dist/mds-modal/p-3f4fe943.system.entry.js +0 -1
- package/dist/mds-modal/p-57e2fbd5.js +0 -2
- package/dist/mds-modal/p-625ef015.system.js +0 -2
- package/www/build/p-3963a8e4.entry.js +0 -1
- package/www/build/p-3f4fe943.system.entry.js +0 -1
- package/www/build/p-57e2fbd5.js +0 -2
- package/www/build/p-625ef015.system.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,o,i,n){function d(t){return t instanceof i?t:new i((function(o){o(t)}))}return new(i||(i=Promise))((function(i,a){function e(t){try{r(n.next(t))}catch(t){a(t)}}function s(t){try{r(n["throw"](t))}catch(t){a(t)}}function r(t){t.done?i(t.value):d(t.value).then(e,s)}r((n=n.apply(t,o||[])).next())}))};var __generator=this&&this.__generator||function(t,o){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,d,a,e;return e={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(e[Symbol.iterator]=function(){return this}),e;function s(t){return function(o){return r([t,o])}}function r(s){if(n)throw new TypeError("Generator is already executing.");while(e&&(e=0,s[0]&&(i=0)),i)try{if(n=1,d&&(a=s[0]&2?d["return"]:s[0]?d["throw"]||((a=d["return"])&&a.call(d),0):d.next)&&!(a=a.call(d,s[1])).done)return a;if(d=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;d=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(s[0]===6&&i.label<a[1]){i.label=a[1];a=s;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(s);break}if(a[2])i.ops.pop();i.trys.pop();continue}s=o.call(t,i)}catch(t){s=[6,t];d=0}finally{n=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-58e5c4e1.system.js"],(function(t){"use strict";var o,i,n,d,a;return{setters:[function(t){o=t.r;i=t.c;n=t.h;d=t.H;a=t.g}],execute:function(){function e(t){var o,i,n="";if("string"==typeof t||"number"==typeof t)n+=t;else if("object"==typeof t)if(Array.isArray(t)){var d=t.length;for(o=0;o<d;o++)t[o]&&(i=e(t[o]))&&(n&&(n+=" "),n+=i)}else for(i in t)t[i]&&(n&&(n+=" "),n+=i);return n}function s(){for(var t,o,i=0,n="",d=arguments.length;i<d;i++)(t=arguments[i])&&(o=e(t))&&(n&&(n+=" "),n+=o);return n}var r=function(t,o){if(o===void 0){o=1e3}if(t.includes("ms")){return Number(t.replace("ms",""))}if(t.includes("s")){return Number(t.replace("s",""))*1e3}return o};var m='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z"/></svg>';var h='@-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-height:calc(100dvh - calc(var(--mds-modal-window-distance) * 2));--mds-modal-window-max-height:calc(100dvh - calc(var(--mds-modal-window-distance) * 2));--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:rgb(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][backdrop]){--mds-modal-transition-window-transform:none;background-color:rgb(var(--mds-modal-overlay-color) / var(--mds-modal-overlay-opacity));pointer-events:auto}: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);-webkit-box-sizing:border-box;box-sizing:border-box;display:grid;grid-template-columns:repeat(1, minmax(0, 100%));margin:var(--mds-modal-window-distance);overflow:var(--mds-modal-window-overflow);position:relative}.window-content--empty{display:none}.window-content-wrapper{max-height:calc(100dvh - calc(var(--mds-modal-window-distance) * 2));overflow:auto}.window-header,.window-footer{-webkit-box-sizing:border-box;box-sizing:border-box;position:absolute}.window-header{inset:0 0 auto}.window-footer{inset:auto 0 0}: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;pointer-events:auto;-webkit-transition-timing-function:var(--mds-modal-transition-timing-funciton);transition-timing-function:var(--mds-modal-transition-timing-funciton)}.window{height:var(--mds-modal-window-height);max-height:var(--mds-modal-window-max-height);max-width:var(--mds-modal-window-max-width);min-width:var(--mds-modal-window-min-width);width:var(--mds-modal-window-max-width)}@media (width <= 480px){:host{--mds-modal-window-min-width:0}:host([position="bottom"]),:host([position="bottom-left"]),:host([position="bottom-right"]),:host([position="center"]),:host([position="left"]),:host([position="right"]),:host([position="top"]),:host([position="top-left"]),:host([position="top-right"]){--mds-modal-window-max-width:calc(100vw - var(--mds-modal-window-close-margin))}}@media (width > 480px){:host([position="bottom"]),:host([position="bottom-left"]),:host([position="bottom-right"]),:host([position="center"]),:host([position="top"]),:host([position="top-left"]),:host([position="top-right"]){--mds-modal-window-height:auto}}:host([position="top-left"]){-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:start;justify-content:flex-start}:host([position="top"]){--mds-modal-window-height:auto;--mds-modal-window-max-width:100vw;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:center;justify-content:center}:host([position="top-right"]){-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:end;justify-content:flex-end}:host([position="right"]),:host([position="left"]){--mds-modal-window-height:100%;--mds-modal-window-max-height:calc(100dvh - calc(var(--mds-modal-window-distance) * 2))}: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="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="bottom-left"]){-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:start;justify-content:flex-start}:host([position="bottom"]){--mds-modal-window-height:auto;--mds-modal-window-max-width:100vw;-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:center;justify-content:center}:host([position="bottom-right"]){-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:end;justify-content:flex-end}: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}';var l=h;var c=t("mds_modal",function(){function t(t){var n=this;o(this,t);this.openEvent=i(this,"mdsModalOpen",7);this.showEvent=i(this,"mdsModalShow",7);this.closeEvent=i(this,"mdsModalClose",7);this.hideEvent=i(this,"mdsModalHide",7);this.window=false;this.top=false;this.bottom=false;this.cssTransitionDuration="500";this.touchMargin=50;this.opened=false;this.backdrop=true;this.position="center";this.animating="none";this.animation="slide";this.overflow="auto";this.updateCSSCustomProps=function(){var t;if(typeof window==="undefined")return;var o=window.getComputedStyle(n.host);n.cssTransitionDuration=(t=o.getPropertyValue("--mds-modal-transition-duration"))!==null&&t!==void 0?t:"500"};this.stopIntroAnimationWindow=function(){n.animating="none";n.host.setAttribute("animating","none");n.showEvent.emit();clearTimeout(n.animationDelayTimeout)};this.stopOutroAnimationWindow=function(){n.animating="none";n.host.setAttribute("animating","none");n.hideEvent.emit();clearTimeout(n.animationDelayTimeout)};this.disableOverflow=function(){if(document){if(document.body.style.overflow){n.bodyOverflow=document.body.style.overflow}document.body.style.overflow="hidden"}};this.enableOverflow=function(){if(document){if(n.bodyOverflow){document.body.style.overflow=n.bodyOverflow}else{document.body.style.removeProperty("overflow")}}};this.animateOpenWindow=function(){n.animating="intro";clearTimeout(n.animationDelayTimeout);n.animationDelayTimeout=setTimeout(n.stopIntroAnimationWindow.bind(n),r(n.cssTransitionDuration))};this.animateCloseWindow=function(){n.animating="outro";clearTimeout(n.animationDelayTimeout);n.animationDelayTimeout=setTimeout(n.stopOutroAnimationWindow.bind(n),r(n.cssTransitionDuration))};this.setTouchStart=function(t){n.touchStartX=t.touches[0].clientX;n.touchStartY=t.touches[0].clientY};this.setTouchEnd=function(t){var o=t.changedTouches[0].clientX;var i=t.changedTouches[0].clientY;var d=n.touchStartX-o;var a=n.touchStartY-i;if(Math.abs(d)>Math.abs(a)){if(n.position==="right"&&d>0)return;if(n.position==="left"&&d<0)return;if(Math.abs(d)>Math.abs(n.touchMargin)){n.opened=undefined}}};this.addMobileEvents=function(){n.windowElement.addEventListener("touchstart",n.setTouchStart);n.windowElement.addEventListener("touchend",n.setTouchEnd)};this.closeModal=function(t){var o;if(((o=t.target)===null||o===void 0?void 0:o.localName)!=="mds-modal"){return}n.opened=t.target!==t.currentTarget;if(!n.opened){n.closeEvent.emit()}}}t.prototype.componentWillLoad=function(){var t;this.bottom=this.host.querySelector(':scope > [slot="bottom"]')!==null;this.top=this.host.querySelector(':scope > [slot="top"]')!==null;this.window=this.host.querySelector(':scope > [slot="window"]')!==null;if(this.overflow==="auto"&&this.opened){this.disableOverflow()}if(this.window){(t=this.host.querySelector(':scope > [slot="window"]'))===null||t===void 0?void 0:t.setAttribute("role","dialog")}};t.prototype.componentWillRender=function(){this.animating=this.opened?"intro":"outro"};t.prototype.componentDidLoad=function(){var t,o,i;this.windowElement=(t=this.host.shadowRoot)===null||t===void 0?void 0:t.querySelector(".window");this.windowHeaderElement=(o=this.host.shadowRoot)===null||o===void 0?void 0:o.querySelector(".window-header");this.windowFooterElement=(i=this.host.shadowRoot)===null||i===void 0?void 0:i.querySelector(".window-footer");if(this.windowHeaderElement){this.windowHeaderHeight=this.windowHeaderElement.offsetHeight}if(this.windowFooterElement){this.windowFooterHeight=this.windowFooterElement.offsetHeight}if(this.windowElement){this.addMobileEvents()}this.updateCSSCustomProps()};t.prototype.disconnectedCallback=function(){if(this.windowElement){this.windowElement.removeEventListener("touchstart",this.setTouchStart);this.windowElement.removeEventListener("touchend",this.setTouchEnd)}this.enableOverflow()};t.prototype.handleOpenProp=function(t){if(t){if(this.overflow==="auto"){this.disableOverflow()}this.animateOpenWindow();this.openEvent.emit();return}this.opened=undefined;if(this.overflow==="auto"){this.enableOverflow()}this.animateCloseWindow()};t.prototype.handleBackdropProp=function(t){if(t===false){this.backdrop=undefined}};t.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.opened=undefined;return[2]}))}))};t.prototype.render=function(){var t=this;return n(d,{key:"df1f6068b015d85ad5aeb52aad38f016ec1e89b2","aria-modal":s(this.opened?"true":"false"),onMouseDown:function(o){t.closeModal(o)}},this.window?n("slot",{name:"window"}):n("div",{class:"window",part:"window"},n("div",{class:s("window-header",this.top?"":"window-content--empty")},n("slot",{name:"top"})),n("div",{class:"window-content-wrapper"},n("div",{class:"window-content",style:{paddingTop:"".concat(this.windowHeaderHeight,"px"),paddingBottom:"".concat(this.windowFooterHeight,"px")}},n("slot",null))),n("div",{class:s("window-footer",this.bottom?"":"window-content--empty")},n("slot",{name:"bottom"}))),!this.window&&n("mds-button",{key:"558f83e96af84dc8d75641e7008215c9917a2305",class:"action-close",icon:m,variant:"light",tone:"quiet",size:"xl",onClick:function(o){t.closeModal(o)},part:"action-close"}))};Object.defineProperty(t.prototype,"host",{get:function(){return a(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{opened:["handleOpenProp"],backdrop:["handleBackdropProp"]}},enumerable:false,configurable:true});return t}());c.style=l}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(n,t,e,r){function i(n){return n instanceof e?n:new e((function(t){t(n)}))}return new(e||(e=Promise))((function(e,o){function c(n){try{a(r.next(n))}catch(n){o(n)}}function u(n){try{a(r["throw"](n))}catch(n){o(n)}}function a(n){n.done?e(n.value):i(n.value).then(c,u)}a((r=r.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(n){return function(t){return a([n,t])}}function a(u){if(r)throw new TypeError("Generator is already executing.");while(c&&(c=0,u[0]&&(e=0)),e)try{if(r=1,i&&(o=u[0]&2?i["return"]:u[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;if(i=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;i=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(o=e.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){e.label=u[1];break}if(u[0]===6&&e.label<o[1]){e.label=o[1];o=u;break}if(o&&e.label<o[2]){e.label=o[2];e.ops.push(u);break}if(o[2])e.ops.pop();e.trys.pop();continue}u=t.call(n,e)}catch(n){u=[6,n];i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(n,t,e,r){function i(n){return n instanceof e?n:new e((function(t){t(n)}))}return new(e||(e=Promise))((function(e,o){function c(n){try{a(r.next(n))}catch(n){o(n)}}function u(n){try{a(r["throw"](n))}catch(n){o(n)}}function a(n){n.done?e(n.value):i(n.value).then(c,u)}a((r=r.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(n){return function(t){return a([n,t])}}function a(u){if(r)throw new TypeError("Generator is already executing.");while(c&&(c=0,u[0]&&(e=0)),e)try{if(r=1,i&&(o=u[0]&2?i["return"]:u[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;if(i=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;i=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(o=e.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){e.label=u[1];break}if(u[0]===6&&e.label<o[1]){e.label=o[1];o=u;break}if(o&&e.label<o[2]){e.label=o[2];e.ops.push(u);break}if(o[2])e.ops.pop();e.trys.pop();continue}u=t.call(n,e)}catch(n){u=[6,n];i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-58e5c4e1.system.js","./p-56ba5cbf.system.js"],(function(n,t){"use strict";var e,r,i;return{setters:[function(t){e=t.p;r=t.b;n("setNonce",t.s)},function(n){i=n.g}],execute:function(){var n=this;var o=function(){var n=t.meta.url;var r={};if(n!==""){r.resourcesUrl=new URL(".",n).href}return e(r)};o().then((function(t){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:return[4,i()];case 1:n.sent();return[2,r([["p-f4ea7656.system",[[1,"mds-modal",{opened:[1540],backdrop:[1540],position:[1537],animating:[1537],animation:[513],overflow:[513],close:[64]},null,{opened:["handleOpenProp"],backdrop:["handleBackdropProp"]}]]]],t)]}}))}))}))}}}));
|
package/dist/stats.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2026-02-
|
|
2
|
+
"timestamp": "2026-02-19T17:47:34",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "node",
|
|
5
5
|
"version": "22.15.0"
|
|
@@ -90,19 +90,19 @@
|
|
|
90
90
|
"files": 42,
|
|
91
91
|
"generatedFiles": [
|
|
92
92
|
"./dist/cjs/app-globals-3a1e7e63.js",
|
|
93
|
-
"./dist/cjs/index-
|
|
93
|
+
"./dist/cjs/index-58bba9e7.js",
|
|
94
94
|
"./dist/cjs/index.cjs.js",
|
|
95
95
|
"./dist/cjs/loader.cjs.js",
|
|
96
96
|
"./dist/cjs/mds-modal.cjs.entry.js",
|
|
97
97
|
"./dist/cjs/mds-modal.cjs.js",
|
|
98
98
|
"./dist/esm-es5/app-globals-0f993ce5.js",
|
|
99
|
-
"./dist/esm-es5/index-
|
|
99
|
+
"./dist/esm-es5/index-01d79020.js",
|
|
100
100
|
"./dist/esm-es5/index.js",
|
|
101
101
|
"./dist/esm-es5/loader.js",
|
|
102
102
|
"./dist/esm-es5/mds-modal.entry.js",
|
|
103
103
|
"./dist/esm-es5/mds-modal.js",
|
|
104
104
|
"./dist/esm/app-globals-0f993ce5.js",
|
|
105
|
-
"./dist/esm/index-
|
|
105
|
+
"./dist/esm/index-01d79020.js",
|
|
106
106
|
"./dist/esm/index.js",
|
|
107
107
|
"./dist/esm/loader.js",
|
|
108
108
|
"./dist/esm/mds-modal.entry.js",
|
|
@@ -112,25 +112,25 @@
|
|
|
112
112
|
"./dist/mds-modal/index.esm.js",
|
|
113
113
|
"./dist/mds-modal/mds-modal.esm.js",
|
|
114
114
|
"./dist/mds-modal/mds-modal.js",
|
|
115
|
-
"./dist/mds-modal/p-
|
|
116
|
-
"./dist/mds-modal/p-3f4fe943.system.entry.js",
|
|
115
|
+
"./dist/mds-modal/p-09408c0c.entry.js",
|
|
117
116
|
"./dist/mds-modal/p-50ea2036.system.js",
|
|
118
117
|
"./dist/mds-modal/p-56ba5cbf.system.js",
|
|
119
|
-
"./dist/mds-modal/p-
|
|
120
|
-
"./dist/mds-modal/p-
|
|
121
|
-
"./dist/mds-modal/p-c15fdaba.system.js",
|
|
118
|
+
"./dist/mds-modal/p-58e5c4e1.system.js",
|
|
119
|
+
"./dist/mds-modal/p-89e1a012.js",
|
|
122
120
|
"./dist/mds-modal/p-e1255160.js",
|
|
121
|
+
"./dist/mds-modal/p-f4ea7656.system.entry.js",
|
|
122
|
+
"./dist/mds-modal/p-fceffab5.system.js",
|
|
123
123
|
"./www/build/index.esm.js",
|
|
124
124
|
"./www/build/mds-modal.esm.js",
|
|
125
125
|
"./www/build/mds-modal.js",
|
|
126
|
-
"./www/build/p-
|
|
127
|
-
"./www/build/p-3f4fe943.system.entry.js",
|
|
126
|
+
"./www/build/p-09408c0c.entry.js",
|
|
128
127
|
"./www/build/p-50ea2036.system.js",
|
|
129
128
|
"./www/build/p-56ba5cbf.system.js",
|
|
130
|
-
"./www/build/p-
|
|
131
|
-
"./www/build/p-
|
|
132
|
-
"./www/build/p-
|
|
133
|
-
"./www/build/p-
|
|
129
|
+
"./www/build/p-58e5c4e1.system.js",
|
|
130
|
+
"./www/build/p-89e1a012.js",
|
|
131
|
+
"./www/build/p-e1255160.js",
|
|
132
|
+
"./www/build/p-f4ea7656.system.entry.js",
|
|
133
|
+
"./www/build/p-fceffab5.system.js"
|
|
134
134
|
]
|
|
135
135
|
},
|
|
136
136
|
{
|
|
@@ -163,12 +163,12 @@
|
|
|
163
163
|
"components": [
|
|
164
164
|
"mds-modal"
|
|
165
165
|
],
|
|
166
|
-
"bundleId": "p-
|
|
167
|
-
"fileName": "p-
|
|
166
|
+
"bundleId": "p-09408c0c",
|
|
167
|
+
"fileName": "p-09408c0c.entry.js",
|
|
168
168
|
"imports": [
|
|
169
|
-
"p-
|
|
169
|
+
"p-89e1a012.js"
|
|
170
170
|
],
|
|
171
|
-
"originalByteSize":
|
|
171
|
+
"originalByteSize": 26170
|
|
172
172
|
}
|
|
173
173
|
],
|
|
174
174
|
"esm": [
|
|
@@ -180,9 +180,9 @@
|
|
|
180
180
|
"bundleId": "mds-modal",
|
|
181
181
|
"fileName": "mds-modal.entry.js",
|
|
182
182
|
"imports": [
|
|
183
|
-
"index-
|
|
183
|
+
"index-01d79020.js"
|
|
184
184
|
],
|
|
185
|
-
"originalByteSize":
|
|
185
|
+
"originalByteSize": 26174
|
|
186
186
|
}
|
|
187
187
|
],
|
|
188
188
|
"es5": [
|
|
@@ -194,9 +194,9 @@
|
|
|
194
194
|
"bundleId": "mds-modal",
|
|
195
195
|
"fileName": "mds-modal.entry.js",
|
|
196
196
|
"imports": [
|
|
197
|
-
"index-
|
|
197
|
+
"index-01d79020.js"
|
|
198
198
|
],
|
|
199
|
-
"originalByteSize":
|
|
199
|
+
"originalByteSize": 26174
|
|
200
200
|
}
|
|
201
201
|
],
|
|
202
202
|
"system": [
|
|
@@ -205,12 +205,12 @@
|
|
|
205
205
|
"components": [
|
|
206
206
|
"mds-modal"
|
|
207
207
|
],
|
|
208
|
-
"bundleId": "p-
|
|
209
|
-
"fileName": "p-
|
|
208
|
+
"bundleId": "p-f4ea7656.system",
|
|
209
|
+
"fileName": "p-f4ea7656.system.entry.js",
|
|
210
210
|
"imports": [
|
|
211
|
-
"p-
|
|
211
|
+
"p-58e5c4e1.system.js"
|
|
212
212
|
],
|
|
213
|
-
"originalByteSize":
|
|
213
|
+
"originalByteSize": 28925
|
|
214
214
|
}
|
|
215
215
|
],
|
|
216
216
|
"commonjs": [
|
|
@@ -222,9 +222,9 @@
|
|
|
222
222
|
"bundleId": "mds-modal.cjs",
|
|
223
223
|
"fileName": "mds-modal.cjs.entry.js",
|
|
224
224
|
"imports": [
|
|
225
|
-
"index-
|
|
225
|
+
"index-58bba9e7.js"
|
|
226
226
|
],
|
|
227
|
-
"originalByteSize":
|
|
227
|
+
"originalByteSize": 26293
|
|
228
228
|
}
|
|
229
229
|
]
|
|
230
230
|
},
|
|
@@ -981,7 +981,7 @@
|
|
|
981
981
|
"hasVdomPropOrAttr": true,
|
|
982
982
|
"hasVdomRef": false,
|
|
983
983
|
"hasVdomRender": true,
|
|
984
|
-
"hasVdomStyle":
|
|
984
|
+
"hasVdomStyle": true,
|
|
985
985
|
"hasVdomText": true,
|
|
986
986
|
"hasWatchCallback": true,
|
|
987
987
|
"isPlain": false,
|
|
@@ -992,6 +992,7 @@
|
|
|
992
992
|
"name",
|
|
993
993
|
"class",
|
|
994
994
|
"part",
|
|
995
|
+
"style",
|
|
995
996
|
"icon",
|
|
996
997
|
"variant",
|
|
997
998
|
"tone",
|
|
@@ -1022,7 +1023,7 @@
|
|
|
1022
1023
|
],
|
|
1023
1024
|
"componentGraph": {
|
|
1024
1025
|
"sc-mds-modal": [
|
|
1025
|
-
"p-
|
|
1026
|
+
"p-89e1a012.js"
|
|
1026
1027
|
]
|
|
1027
1028
|
},
|
|
1028
1029
|
"sourceGraph": {
|
|
@@ -16,6 +16,10 @@ export declare class MdsModal {
|
|
|
16
16
|
private bottom;
|
|
17
17
|
private cssTransitionDuration;
|
|
18
18
|
private windowElement;
|
|
19
|
+
private windowHeaderElement;
|
|
20
|
+
private windowFooterElement;
|
|
21
|
+
private windowHeaderHeight;
|
|
22
|
+
private windowFooterHeight;
|
|
19
23
|
private touchStartX;
|
|
20
24
|
private touchStartY;
|
|
21
25
|
private touchMargin;
|
|
@@ -53,6 +53,20 @@ export declare const Default: {
|
|
|
53
53
|
opened: boolean;
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
|
+
export declare const HeaderAndFooterFixedPosition: {
|
|
57
|
+
render: (args: any) => any;
|
|
58
|
+
args: {
|
|
59
|
+
position: string;
|
|
60
|
+
opened: boolean;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export declare const SmallContent: {
|
|
64
|
+
render: (args: any) => any;
|
|
65
|
+
args: {
|
|
66
|
+
position: string;
|
|
67
|
+
opened: boolean;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
56
70
|
export declare const Backdrop: {
|
|
57
71
|
render: (args: any) => any;
|
|
58
72
|
args: {
|
|
@@ -77,6 +91,14 @@ export declare const DefaultWindowCustomized: {
|
|
|
77
91
|
opened: boolean;
|
|
78
92
|
};
|
|
79
93
|
};
|
|
94
|
+
export declare const DefaultWindowCustomizedHeaderAndFooter: {
|
|
95
|
+
render: (args: any) => any;
|
|
96
|
+
args: {
|
|
97
|
+
position: string;
|
|
98
|
+
animation: string;
|
|
99
|
+
opened: boolean;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
80
102
|
export declare const CustomWindowAnimation: {
|
|
81
103
|
render: (args: any) => any;
|
|
82
104
|
};
|
package/documentation.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maggioli-design-system/mds-modal",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.6.0",
|
|
4
4
|
"description": "mds-modal is a web-component from Magma Design System, built with StencilJS, TypeScript, Storybook. It's based on the web-component standard and it's designed to be agnostic from the JavaScript framework you are using.",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"test": "stencil test --spec --e2e"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@maggioli-design-system/mds-button": "6.8.
|
|
27
|
+
"@maggioli-design-system/mds-button": "6.8.3",
|
|
28
28
|
"@maggioli-design-system/styles": "15.11.0",
|
|
29
29
|
"@stencil/core": "4.27.2",
|
|
30
30
|
"clsx": "2.1.0"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
:host([position="right"]),
|
|
2
2
|
:host([position="left"]) {
|
|
3
|
-
--mds-modal-window-height:
|
|
4
|
-
--mds-modal-window-max-height: 100dvh;
|
|
3
|
+
--mds-modal-window-height: 100%;
|
|
4
|
+
--mds-modal-window-max-height: calc(100dvh - calc(var(--mds-modal-window-distance) * 2));
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
/*
|
|
@@ -8,13 +8,38 @@
|
|
|
8
8
|
background-color: var(--mds-modal-window-background);
|
|
9
9
|
border-radius: var(--mds-modal-window-radius);
|
|
10
10
|
box-shadow: var(--mds-modal-window-shadow);
|
|
11
|
+
box-sizing: border-box;
|
|
11
12
|
display: grid;
|
|
12
|
-
grid-template-
|
|
13
|
+
grid-template-columns: repeat(1, minmax(0, 100%));
|
|
13
14
|
margin: var(--mds-modal-window-distance);
|
|
14
15
|
overflow: var(--mds-modal-window-overflow);
|
|
16
|
+
position: relative;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
|
-
.window--
|
|
19
|
+
.window-content--empty {
|
|
20
|
+
display: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.window-content-wrapper {
|
|
24
|
+
max-height: calc(100dvh - calc(var(--mds-modal-window-distance) * 2));
|
|
25
|
+
overflow: auto;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.window-header,
|
|
29
|
+
.window-footer {
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
position: absolute;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.window-header {
|
|
35
|
+
inset: 0 0 auto;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.window-footer {
|
|
39
|
+
inset: auto 0 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* .window--top {
|
|
18
43
|
grid-template-rows: auto 1fr;
|
|
19
44
|
}
|
|
20
45
|
|
|
@@ -24,7 +49,7 @@
|
|
|
24
49
|
|
|
25
50
|
.window--top-bottom {
|
|
26
51
|
grid-template-rows: auto 1fr auto;
|
|
27
|
-
}
|
|
52
|
+
} */
|
|
28
53
|
|
|
29
54
|
:host .window,
|
|
30
55
|
:host > ::slotted([slot="window"]) {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
--mds-modal-window-background: theme('colors.tone-neutral');
|
|
30
30
|
--mds-modal-window-distance: 0;
|
|
31
31
|
--mds-modal-window-max-width: 33%;
|
|
32
|
-
--mds-modal-window-height: 100dvh;
|
|
32
|
+
--mds-modal-window-height: calc(100dvh - calc(var(--mds-modal-window-distance) * 2));
|
|
33
33
|
--mds-modal-window-max-height: calc(100dvh - calc(var(--mds-modal-window-distance) * 2));
|
|
34
34
|
--mds-modal-window-min-width: 400px;
|
|
35
35
|
--mds-modal-window-overflow: auto;
|
|
@@ -27,6 +27,10 @@ export class MdsModal {
|
|
|
27
27
|
private bottom = false
|
|
28
28
|
private cssTransitionDuration: string = '500'
|
|
29
29
|
private windowElement: HTMLElement
|
|
30
|
+
private windowHeaderElement: HTMLElement
|
|
31
|
+
private windowFooterElement: HTMLElement
|
|
32
|
+
private windowHeaderHeight: number
|
|
33
|
+
private windowFooterHeight: number
|
|
30
34
|
private touchStartX: number
|
|
31
35
|
private touchStartY: number
|
|
32
36
|
private touchMargin: number = 50
|
|
@@ -179,6 +183,15 @@ export class MdsModal {
|
|
|
179
183
|
|
|
180
184
|
componentDidLoad (): void {
|
|
181
185
|
this.windowElement = this.host.shadowRoot?.querySelector('.window') as HTMLElement
|
|
186
|
+
this.windowHeaderElement = this.host.shadowRoot?.querySelector('.window-header') as HTMLElement
|
|
187
|
+
this.windowFooterElement = this.host.shadowRoot?.querySelector('.window-footer') as HTMLElement
|
|
188
|
+
|
|
189
|
+
if (this.windowHeaderElement) {
|
|
190
|
+
this.windowHeaderHeight = this.windowHeaderElement.offsetHeight
|
|
191
|
+
}
|
|
192
|
+
if (this.windowFooterElement) {
|
|
193
|
+
this.windowFooterHeight = this.windowFooterElement.offsetHeight
|
|
194
|
+
}
|
|
182
195
|
if (this.windowElement) {
|
|
183
196
|
this.addMobileEvents()
|
|
184
197
|
}
|
|
@@ -237,14 +250,18 @@ export class MdsModal {
|
|
|
237
250
|
<Host aria-modal={clsx(this.opened ? 'true' : 'false' )} onMouseDown={(e: Event) => { this.closeModal(e) }}>
|
|
238
251
|
{ this.window
|
|
239
252
|
? <slot name="window"/>
|
|
240
|
-
: <div class=
|
|
241
|
-
{ this.top
|
|
253
|
+
: <div class="window" part="window">
|
|
254
|
+
<div class={clsx('window-header', this.top ? '' : 'window-content--empty')}>
|
|
242
255
|
<slot name="top"/>
|
|
243
|
-
|
|
244
|
-
<
|
|
245
|
-
|
|
256
|
+
</div>
|
|
257
|
+
<div class="window-content-wrapper">
|
|
258
|
+
<div class="window-content" style={{ paddingTop: `${this.windowHeaderHeight}px`, paddingBottom: `${this.windowFooterHeight}px` }}>
|
|
259
|
+
<slot/>
|
|
260
|
+
</div>
|
|
261
|
+
</div>
|
|
262
|
+
<div class={clsx('window-footer', this.bottom ? '' : 'window-content--empty')}>
|
|
246
263
|
<slot name="bottom"/>
|
|
247
|
-
|
|
264
|
+
</div>
|
|
248
265
|
</div>
|
|
249
266
|
}
|
|
250
267
|
{ !this.window && <mds-button class="action-close" icon={miBaselineClose} variant="light" tone="quiet" size="xl" onClick={(e: Event) => { this.closeModal(e) }} part="action-close"></mds-button> }
|