dsql-admin/dsql-app/.local_dist/server/chunks/7847.js

1 line
4.9 KiB
JavaScript
Raw Normal View History

2024-12-08 08:57:48 +00:00
"use strict";exports.id=7847,exports.ids=[7847],exports.modules={84759:(e,t,r)=>{r.d(t,{A:()=>s});function s({editorHTMLElementRef:e,fieldObject:t,setRefresh:r,language:s="javascript",entry:i,jsonTextEditors:a,editorRef:n,readOnly:l,initialContent:o,options:c}){try{if(!ace?.edit||!e.current){console.log("Ace Editor not found!"),setTimeout(()=>{r?.(e=>e+1)},1e3);return}let d=ace.edit(e.current);d.setOptions({mode:"ace/mode/"+s,value:o||(t?.defaultValue?t.defaultValue:t?.fieldName&&i?.[t.fieldName]?(()=>{if("json"!==s)return i[t.fieldName];try{return JSON.stringify(JSON.parse(i[t.fieldName]),null,4)}catch(e){return i[t.fieldName]}})():""),placeholder:"json"==s?"{}":"",enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,readOnly:l,...c}),n&&t?.fieldName&&(a?.current.push({fieldName:t.fieldName,ref:n}),n.current=d);try{ace.require("ace/ext/beautify").beautify(d.session)}catch(e){}}catch(e){console.log("JSON Editor ERROR =>",e.message)}}},51548:(e,t,r)=>{r.d(t,{A:()=>a});var s=r(8732),i=r(58526);function a({selectOptions:e,name:t,onChangeHandler:r,required:a,setAlert:n,title:l,defaultValue:o,info:c,id:d}){try{function u(e){if(e.type.match(/enter/i)&&window.innerWidth<1200)return;let t=e.target.closest(".info-wrapper"),r=t.querySelector(".info-dropdown");if(e.type.match(/leave/i)&&!r.classList.contains("hidden")){r.classList.add("hidden");return}if(!(e.type.match(/leave/i)&&r.classList.contains("hidden"))){if(!t){r.classList.add("hidden");return}if(r.classList.contains("hidden")){r.classList.remove("hidden");return}r.classList.add("hidden")}}return(0,s.jsxs)("div",{className:"form-select-block flex items-start flex-col gap-0.5 w-full relative"+(c?" pr-8":""),children:[l&&(0,s.jsxs)("label",{htmlFor:t,children:[l,a?"":" (optional)"]}),(0,s.jsxs)("div",{className:"flex items-center w-full relative",children:[(0,s.jsx)("select",{name:t,id:d||t,className:"w-full bg-white",required:a,onChange:e=>{n&&n(null),e.target.classList.remove("warning"),r&&r(e)},defaultValue:o||void 0,children:e.map((e,t)=>{let{payload:r,title:i}=e;return(0,s.jsx)("option",{value:r,selected:!!e.default,children:i},t+1)})}),(0,s.jsx)(i.A,{className:"absolute right-2 text-base text-slate-500 pointer-events-none",size:20}),c&&(0,s.jsxs)("div",{className:"info-wrapper absolute -right-10 w-8 h-8 rounded-full bg-white flex items-center justify-center z-10",style:{top:"50%",transform:"translate(0,-50%)"},onMouseEnter:u,onMouseLeave:u,onClick:u,children:[(0,s.jsx)("img",{src:"/images/info-outlined-black.png",alt:"",className:"w-6 h-6 object-contain opacity-60 pointer-events-none"}),(0,s.jsx)("div",{className:"info-dropdown absolute top-9 right-0 bg-white w-52 md:w-96 p-2 sm:p-6 shadow-xl rounded hidden text-center border border-slate-300 border-solid",children:(0,s.jsx)("span",{children:c})}),(0,s.jsx)("div",{className:"absolute -top-2 w-12",style:{height:"45px"}})]})]})]})}catch(e){return console.log("ERROR in FormSelect =>",e),(0,s.jsx)("div",{children:"Form Select Error"})}}r(82015)},89788:(e,t,r)=>{r.a(e,async(e,s)=>{try{r.d(t,{A:()=>c});var i=r(8732);r(63715);var a=r(82015),n=r.n(a);r(84759);var l=r(75979),o=e([l]);function c({editorRef:e,content:t,readOnly:r,language:s="javascript",options:a,wrapperProps:o}){try{let e=n().useRef(),[t,r]=n().useState(0);return(0,i.jsx)("div",{...o,ref:e,className:(0,l.twMerge)("ace-editor-wrapper w-full h-full minimal-scrollbars all-children",o?.className)})}catch(e){return(0,i.jsx)(n().Fragment,{children:(0,i.jsx)("h2",{className:"text-xl m-0",children:"Editor Error"})})}}l=(o.then?(await o)():o)[0],s()}catch(e){s(e)}})},34844:(e,t,r)=>{r.d(t,{A:()=>c});var s=r(8732),i=r(82015),a=r.n(i),n=r(11790),l=r.n(n),o=r(96089);function c({content:e,language:t,style:r,showCopy:i}){let[n,c]=a().useState(!1),d=()=>{c(!0)},u=(e,t)=>{"clickaway"!==t&&c(!1)},h=(0,s.jsx)(a().Fragment,{children:(0,s.jsx)("button",{className:"outlined gray",style:{border:"none",padding:"2px",width:"20px",height:"20px",color:"white"},onClick:u,children:"✖"})}),f={};return(0,s.jsxs)("pre",{className:`language-${t||"javascript"} w-auto overflow-hidden skip-