PageSourceSearch

https://upload.mattenbach.ch/WebInterface/new-ui/assets/app/components/alert.js?v=11.W.1206-2026_07_18_05_00

js mattenbach.ch collected 2026-10-10 01:55:32 UTC 4,776 bytes, 2 lines download raw bytes

1import{_ as c}from"../../utils/dom.js?v=11.W.1206-2026_07_18_05_00";const R=({type:a="alert",warn:W=!1,animate:E=!0,title:x="",body:L="",confirm:P="Yes",cancel:g="No",style:H="card",extraClasses:S=[],append:u=null,prepend:f=null,parent:U=document.body,showHeader:B=!0,closable:m=!0,submitOnEnter:k=!0,placeholder:z="",inputAttrs:A={},textarea:D=!1,instructionLabel:T="",appendFooter:p=null,prependFooter:h=null,disableScroll:N=!0,animationInClass:q="fadeInDown",animationOutClass:Y="fadeOutUp",zIndex:y="",onBeforeShow:Z=()=>{},onAfterShow:$=()=>{},onBeforeHide:G=()=>{},onAfterHide:J=()=>{}})=>new Promise((b,X)=>{a==="alert"&&(g=null,P="Ok");const K=utils.getUId(),t={};E&&S.push("animate");var n=utils.createElement("div",["modal","is-active"].concat(S));if(y){const i=y>=9999999?9999999:y>=999999?999999:y>=100?100:1;c(n).css("zIndex",i)}const C=H==="card"?"card":"content";n.setAttribute("id","modal_"+K);var w=utils.createElement("div",["modal-background"]);const _=E?["animate",q]:[],v=H==="card"?utils.createElement("div",["modal-card"].concat(_)):utils.createElement("div",["modal-content"].concat(_)),Q=()=>{if(B&&x){t.header=utils.createElement("header",["modal-"+C+"-head"]);let e=utils.createElement("p",["modal-"+C+"-title","text-primaryMain"]);e.innerHTML=utils.sanitizePure(x),t.header.appendChild(e)}t.body=utils.createElement("section",["modal-"+C+"-body"]),f&&(typeof f=="string"?t.body.innerHTML=utils.sanitizePure(f+t.body.innerHTML):t.body.appendChild(f));const i=utils.createElement("label",["label","text-primaryMain"]);if(typeof L=="string"?i.innerHTML=utils.sanitizePure(L):i.appendChild(L),a==="alert"||a==="confirm")t.body.appendChild(i);else if(a==="prompt"){if(t.body.appendChild(i),T&&String(T).trim()){const s=utils.createElement("p",["label","text-primaryMain","has-text-weight-semibold","has-background-primary-light","px-3","py-2","mb-3","otp-instruction-label"]);s.textContent=String(T).trim(),t.body.appendChild(s)}const e=utils.createElement("div",["fields"]),l=utils.createElement("label",["label"]),r=utils.createElement("div",["control"]),d=D?utils.createElement("textarea",["textarea"],{placeholder:z,name:"value",...A}):utils.createElement("input",["input"],{type:"text",placeholder:z,name:"value",...A});e.appendChild(l),r.appendChild(d),e.appendChild(r),t.body.appendChild(e)}u&&(typeof u=="string"?t.body.innerHTML+=utils.sanitizePure(u):t.body.appendChild(u)),t.footer=utils.createElement("footer",["modal-"+C+"-foot","is-justify-content-end"]),h&&(typeof h=="string"?t.footer.innerHTML=utils.sanitizePure(h+t.footer.innerHTML):t.footer.appendChild(h))},o=()=>{G();const i=()=>{n.classList.remove("is-active"),document.documentElement.classList.remove("is-clipped"),c("html").removeClass("crushftp-opened-modal"),(m||k)&&document.removeEventListener("keyup",I),n.remove();for(var e in t)delete t[e];J()};if(E){const e=n.querySelector(".animate");e.classList.remove(q),e.classList.add(Y),setTimeout(()=>{i()},50)}else i()},j=()=>{const i=n.querySelectorAll("input, textarea"),e={};return i.forEach(l=>{const r=l.getAttribute("type");r==="checkbox"||r==="radio"?e[l.getAttribute("name")]=l.checked:e[l.getAttribute("name")]=l.value.trim()}),e},I=i=>{if(!n.classList.contains("is-active"))return;let e=i.key||i.keyCode;m&&(e==="Escape"||e==="Esc"||e===27)&&(b(null),o()),k&&(e==="Enter"||e===13)&&(b(j()),o())},V=()=>{var i={close:!0,onClick:function(){}},e=P;typeof e=="string"&&(e={label:e,classes:[]}),e={...i,...e};var l=utils.createElement("button",["primary-button","mr-3"].concat(e.classes));if(l.innerHTML=utils.sanitizePure(e.label),l.addEventListener("click",s=>{e.onClick(s),e.close&&(b(j()),o())}),t.footer.appendChild(l),g){var r=g;typeof r=="string"&&(r={label:r,classes:[]}),r={...i,...r};var d=utils.createElement("button",["primary-button","is-bordered"].concat(r.classes));d.innerHTML=utils.sanitizePure(r.label),d.addEventListener("click",s=>{r.onClick(s),r.close&&(b(null),o())}),t.footer.appendChild(d)}p&&(typeof p=="string"?t.footer.innerHTML+=utils.sanitizePure(p):t.footer.appendChild(p))};Q(),V(),t.header&&v.appendChild(t.header),t.body&&v.appendChild(t.body),t.footer&&v.appendChild(t.footer),n.appendChild(w),n.appendChild(v),c(".modal").removeClass("modal-on-top"),c(n).addClass("modal-on-top"),Z(n,o),c("html").addClass("crushftp-opened-modal"),N&&document.documentElement.classList.add("is-cl
1ipped"),U.appendChild(n),$(n,o);const M=n.querySelector("input, textarea");try{M&&M.setSelectionRange&&M.setSelectionRange(-1,-1)}catch{}n.querySelector("input, textarea, button").focus(),(m||k)&&(document.addEventListener("keyup",I),m&&w.addEventListener("click",o.bind(void 0)))}),O=a=>R({type:"prompt",...a}),ee=a=>R({type:"confirm",...a});export{R as A,ee as C,O as P};
2//# sourceMappingURL=alert.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.