Files
ferrovia-panel/public/wcs/p-dfb52a1c.entry.js
T
AdminGit 935b9cf92b V5.0.0 //
-> Refonte du système de GESTION DES ROULEMENTS de matériels roulants
-> Cartographie Infra + Widget
2026-10-04 23:47:21 +02:00

2 lines
4.3 KiB
JavaScript

import{r as t,h as o,H as i,g as e}from"./p-32e583ea.js";import{p as s}from"./p-52d77e1f.js";const a="@keyframes slide-in-bottom{from{transform:translateY(100%)}to{transform:translateY(0%)}}@keyframes slide-out{from{opacity:1}to{opacity:0}}@keyframes slide-in-top{from{opacity:0;transform:translateY(-100%)}to{opacity:1;transform:translateY(0%)}}:host{--wcs-alert-drawer-gap:var(--wcs-semantic-spacing-base);--wcs-alert-drawer-margin-horizontal:var(--wcs-semantic-spacing-base);--wcs-alert-drawer-margin-vertical:var(--wcs-semantic-spacing-base);--wcs-alert-drawer-min-width:400px;--wcs-alert-drawer-hide-alert-animation-duration:var(--wcs-semantic-motion-duration-feedback-slow);position:fixed;z-index:99999;width:fit-content}:host wcs-alert{--wcs-alert-min-width:var(--wcs-alert-drawer-min-width)}:host wcs-alert:not([show]){animation-duration:var(--wcs-alert-drawer-hide-alert-animation-duration);animation-timing-function:ease;animation-name:slide-out;animation-fill-mode:forwards}@media (prefers-reduced-motion: reduce){:host wcs-alert:not([show]){animation:none}}:host #alerts-container{display:flex;flex-direction:column;gap:var(--wcs-alert-drawer-gap)}@media (max-width: 575px){:host{left:50% !important;transform:translate(-50%, 0);width:calc(100% - 2 * var(--wcs-alert-drawer-margin-horizontal))}:host wcs-alert{--wcs-alert-min-width:100%}}:host([position=top]),:host([position=top-left]),:host([position=top-right]){top:var(--wcs-alert-drawer-margin-vertical);flex-direction:column-reverse}:host([position=top]) wcs-alert[show],:host([position=top-left]) wcs-alert[show],:host([position=top-right]) wcs-alert[show]{animation:slide-in-top var(--wcs-alert-drawer-hide-alert-animation-duration) ease}@media (prefers-reduced-motion: reduce){:host([position=top]) wcs-alert[show],:host([position=top-left]) wcs-alert[show],:host([position=top-right]) wcs-alert[show]{animation:none}}:host([position=bottom]),:host([position=bottom-left]),:host([position=bottom-right]){bottom:var(--wcs-alert-drawer-margin-vertical)}:host([position=bottom]) wcs-alert[show],:host([position=bottom-left]) wcs-alert[show],:host([position=bottom-right]) wcs-alert[show]{animation:slide-in-bottom var(--wcs-alert-drawer-hide-alert-animation-duration) ease}@media (prefers-reduced-motion: reduce){:host([position=bottom]) wcs-alert[show],:host([position=bottom-left]) wcs-alert[show],:host([position=bottom-right]) wcs-alert[show]{animation:none}}:host([position=top-right]),:host([position=bottom-right]){right:var(--wcs-alert-drawer-margin-horizontal)}:host([position=top-left]),:host([position=bottom-left]){left:var(--wcs-alert-drawer-margin-horizontal)}:host([position=bottom]),:host([position=top]){left:50%;transform:translate(-50%, 0)}";const r=a;const n=class{constructor(o){t(this,o);this.alertEventListeners=new WeakMap;this.timeoutId=undefined;this.userPrefersReducedMotion=window.matchMedia("(prefers-reduced-motion: reduce)").matches;this.close=t=>{if(!this.userPrefersReducedMotion){this.timeoutId=setTimeout((()=>{t.remove();this.alertEventListeners.delete(t)}),s(window.getComputedStyle(this.el).getPropertyValue("--wcs-alert-drawer-hide-alert-animation-duration"))||300)}else{t.remove();this.alertEventListeners.delete(t)}};this.position="bottom-right";this.timeout=5e3;this.showProgressBar=false}async show(t){this.alertsContainer.appendChild(this.renderToast(t))}renderToast(t){var o,i;const e=document.createElement("wcs-alert");e.setAttribute("intent",t.intent);if((o=t.showProgressBar)!==null&&o!==void 0?o:this.showProgressBar){e.setAttribute("show-progress-bar","")}e.setAttribute("timeout",String((i=t.timeout)!==null&&i!==void 0?i:this.timeout));const s=()=>this.close(e);this.alertEventListeners.set(e,s);e.addEventListener("wcsAlertDismiss",s);const a=document.createElement("span");a.setAttribute("slot","title");a.textContent=t.title;e.appendChild(a);const r=document.createElement("span");r.setAttribute("slot","subtitle");r.textContent=t.subtitle;e.appendChild(r);return e}render(){return o(i,{key:"18a68f9f7727b29da85e0852dc87de30d79581ed",role:"region","aria-label":"Informations","aria-live":"polite","aria-atomic":"true"},o("div",{key:"ee0d30077439b991e5ff6eb02b24873f015dce5e",ref:t=>this.alertsContainer=t,id:"alerts-container"}))}disconnectedCallback(){this.alertEventListeners=new WeakMap;clearTimeout(this.timeoutId)}get el(){return e(this)}};n.style=r;export{n as wcs_alert_drawer};
//# sourceMappingURL=p-dfb52a1c.entry.js.map