@devtable/settings-form 9.18.3 → 9.18.4
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/settings-form.es.js
CHANGED
|
@@ -6040,7 +6040,7 @@ function ka({
|
|
|
6040
6040
|
] })
|
|
6041
6041
|
] });
|
|
6042
6042
|
}
|
|
6043
|
-
const Ta = () => import("./package-
|
|
6043
|
+
const Ta = () => import("./package-ea3a7b17.mjs").then(({
|
|
6044
6044
|
version: e
|
|
6045
6045
|
}) => (console.log(`[@devtable/dashboard] version: ${e}`), e));
|
|
6046
6046
|
export {
|
|
@@ -41,4 +41,4 @@ Check the top-level render call using <`+x+">.")}return S}}function Zt(i,S){{if(
|
|
|
41
41
|
`,empty:!0}):e.length===1&&e[0].content===""&&(e[0].content=`
|
|
42
42
|
`,e[0].empty=!0)},mt=function(e,t){var n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},Yn=function(e){for(var t=[[]],n=[e],r=[0],l=[e.length],o=0,u=0,f=[],g=[f];u>-1;){for(;(o=r[u]++)<l[u];){var m=void 0,h=t[u],s=n[u],c=s[o];if(typeof c=="string"?(h=u>0?h:["plain"],m=c):(h=mt(h,c.type),c.alias&&(h=mt(h,c.alias)),m=c.content),typeof m!="string"){u++,t.push(h),n.push(m),r.push(0),l.push(m.length);continue}var p=m.split(Un),v=p.length;f.push({types:h,content:p[0]});for(var b=1;b<v;b++)ht(f),g.push(f=[]),f.push({types:h,content:p[b]})}u--,t.pop(),n.pop(),r.pop(),l.pop()}return ht(f),g},Vn=function(e,t){var n=e.plain,r=Object.create(null),l=e.styles.reduce(function(o,u){var f=u.languages,g=u.style;return f&&!f.includes(t)||u.types.forEach(function(m){var h=Ee({},o[m],g);o[m]=h}),o},r);return l.root=n,l.plain=Ee({},n,{backgroundColor:null}),l};function bt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)===-1&&(n[r]=e[r]);return n}var Hn=function(e){function t(){for(var n=this,r=[],l=arguments.length;l--;)r[l]=arguments[l];e.apply(this,r),Ne(this,"getThemeDict",function(o){if(n.themeDict!==void 0&&o.theme===n.prevTheme&&o.language===n.prevLanguage)return n.themeDict;n.prevTheme=o.theme,n.prevLanguage=o.language;var u=o.theme?Vn(o.theme,o.language):void 0;return n.themeDict=u}),Ne(this,"getLineProps",function(o){var u=o.key,f=o.className,g=o.style,m=bt(o,["key","className","style","line"]),h=m,s=Ee({},h,{className:"token-line",style:void 0,key:void 0}),c=n.getThemeDict(n.props);return c!==void 0&&(s.style=c.plain),g!==void 0&&(s.style=s.style!==void 0?Ee({},s.style,g):g),u!==void 0&&(s.key=u),f&&(s.className+=" "+f),s}),Ne(this,"getStyleForToken",function(o){var u=o.types,f=o.empty,g=u.length,m=n.getThemeDict(n.props);if(m!==void 0){{if(g===1&&u[0]==="plain")return f?{display:"inline-block"}:void 0;if(g===1&&!f)return m[u[0]]}var h=f?{display:"inline-block"}:{},s=u.map(function(c){return m[c]});return Object.assign.apply(Object,[h].concat(s))}}),Ne(this,"getTokenProps",function(o){var u=o.key,f=o.className,g=o.style,m=o.token,h=bt(o,["key","className","style","token"]),s=h,c=Ee({},s,{className:"token "+m.types.join(" "),children:m.content,style:n.getStyleForToken(m),key:void 0});return g!==void 0&&(c.style=c.style!==void 0?Ee({},c.style,g):g),u!==void 0&&(c.key=u),f&&(c.className+=" "+f),c}),Ne(this,"tokenize",function(o,u,f,g){var m={code:u,grammar:f,language:g,tokens:[]};o.hooks.run("before-tokenize",m);var h=m.tokens=o.tokenize(m.code,m.grammar,m.language);return o.hooks.run("after-tokenize",m),h})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.render=function(){var r=this.props,l=r.Prism,o=r.language,u=r.code,f=r.children,g=this.getThemeDict(this.props),m=l.languages[o],h=m!==void 0?this.tokenize(l,u,m,o):[u],s=Yn(h);return f({tokens:s,className:"prism-code language-"+o,style:g!==void 0?g.root:{},getLineProps:this.getLineProps,getTokenProps:this.getTokenProps})},t}($.Component);const Wn=Hn;function yt({copied:e}){return $.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e?$.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}):$.createElement("path",{d:"M5 2V1H10V2H5ZM4.75 0C4.33579 0 4 0.335786 4 0.75V1H3.5C2.67157 1 2 1.67157 2 2.5V12.5C2 13.3284 2.67157 14 3.5 14H11.5C12.3284 14 13 13.3284 13 12.5V2.5C13 1.67157 12.3284 1 11.5 1H11V0.75C11 0.335786 10.6642 0 10.25 0H4.75ZM11 2V2.25C11 2.66421 10.6642 3 10.25 3H4.75C4.33579 3 4 2.66421 4 2.25V2H3.5C3.22386 2 3 2.22386 3 2.5V12.5C3 12.7761 3.22386 13 3.5 13H11.5C11.7761 13 12 12.7761 12 12.5V2.5C12 2.22386 11.7761 2 11.5 2H11Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}yt.displayName="@mantine/prism/CopyIcon";const Kn=e=>({plain:{color:e.colors.gray[4],backgroundColor:e.colors.dark[8]},styles:[{types:["comment"],style:{color:e.colors.gray[6]}},{types:["string","inserted","selector","atrule"],style:{color:e.colors.teal[4]}},{types:["number"],style:{color:e.colors.blue[4]}},{types:["builtin","char","constant","function"],style:{color:e.colors.orange[5]}},{types:["punctuation"],style:{color:e.colors.gray[5]}},{types:["variable"],style:{color:e.colors.gray[5]}},{types:["class-name","attr-name"],style:{color:e.colors.yellow[5]}},{types:["tag","deleted"],style:{color:e.colors.red[6]}},{types:["operator"],style:{color:e.colors.gray[5]}},{types:["boolean"],style:{color:e.colors.red[6]}},{types:["keyword"],style:{color:e.colors.indigo[3]}},{types:["doctype"],style:{color:e.colors.gray[5]}},{types:["url"],style:{color:e.colors.gray[5]}}]}),Zn=e=>({plain:{color:e.colors.gray[9],backgroundColor:e.fn.rgba(e.colors.gray[0],.65)},styles:[{types:["comment"],style:{color:e.colors.gray[6]}},{types:["string","inserted"],style:{color:e.colors.indigo[9]}},{types:["number"],style:{color:e.colors.blue[7]}},{types:["builtin","char","constant","function","selector","atrule"],style:{color:e.colors.lime[9]}},{types:["punctuation"],style:{color:e.colors.gray[7]}},{types:["variable"],style:{color:e.colors.violet[9]}},{types:["attr-name"],style:{color:e.colors.green[9]}},{types:["class-name"],style:{color:e.colors.red[9]}},{types:["tag","deleted"],style:{color:e.colors.violet[9]}},{types:["operator"],style:{color:e.colors.red[9]}},{types:["boolean"],style:{color:e.colors.red[9]}},{types:["keyword"],style:{color:e.colors.red[9]}},{types:["doctype"],style:{color:e.colors.gray[7]}},{types:["url"],style:{color:e.colors.gray[7]}}]}),Xn=(e,t)=>t==="dark"?Kn(e):Zn(e);var Qn=d.createStyles((e,{colorScheme:t,native:n,maxLineSize:r,radius:l})=>({scrollArea:{},root:{position:"relative"},code:{boxSizing:"border-box",position:"relative",fontFamily:e.fontFamilyMonospace,lineHeight:1.7,fontSize:13,overflowX:n?"auto":void 0,borderRadius:e.fn.radius(l),padding:`${e.spacing.sm}px 0`,marginTop:0,marginBottom:0},copy:{position:"absolute",top:e.spacing.xs,right:e.dir==="ltr"?e.spacing.xs:"unset",left:e.dir==="rtl"?e.spacing.xs:"unset",zIndex:2,"&, &:hover":{backgroundColor:t==="dark"?e.colors.dark[8]:e.colors.gray[0]}},line:{display:"flex",width:"100%",padding:`0 ${e.spacing.md}px`},lineNumber:{color:t==="dark"?e.colors.dark[4]:e.colors.gray[4],textAlign:"right",width:8*r,marginRight:e.dir==="ltr"?e.spacing.xs:void 0,marginLeft:e.dir==="rtl"?e.spacing.xs:void 0,userSelect:"none"},lineContent:{width:"100%"}}));const Jn=Qn;var er=Object.defineProperty,tr=Object.defineProperties,nr=Object.getOwnPropertyDescriptors,Ge=Object.getOwnPropertySymbols,vt=Object.prototype.hasOwnProperty,St=Object.prototype.propertyIsEnumerable,wt=(e,t,n)=>t in e?er(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ke=(e,t)=>{for(var n in t||(t={}))vt.call(t,n)&&wt(e,n,t[n]);if(Ge)for(var n of Ge(t))St.call(t,n)&&wt(e,n,t[n]);return e},$e=(e,t)=>tr(e,nr(t)),rr=(e,t)=>{var n={};for(var r in e)vt.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ge)for(var r of Ge(e))t.indexOf(r)<0&&St.call(e,r)&&(n[r]=e[r]);return n};const ar={noCopy:!1,copyLabel:"Copy code",copiedLabel:"Copied",withLineNumbers:!1,trim:!0,highlightLines:{},scrollAreaComponent:d.ScrollArea,getPrismTheme:Xn},Ze=$.forwardRef((e,t)=>{const n=d.useComponentDefaultProps("Prism",ar,e),{className:r,children:l,language:o,noCopy:u,classNames:f,styles:g,copyLabel:m,copiedLabel:h,withLineNumbers:s,highlightLines:c,scrollAreaComponent:p,colorScheme:v,trim:b,unstyled:_,radius:A,getPrismTheme:k}=n,z=rr(n,["className","children","language","noCopy","classNames","styles","copyLabel","copiedLabel","withLineNumbers","highlightLines","scrollAreaComponent","colorScheme","trim","unstyled","radius","getPrismTheme"]),Y=b&&typeof l=="string"?l.trim():l,oe=Y.split(`
|
|
43
43
|
`).length.toString().length,W=d.useMantineTheme(),X=rn.useClipboard(),ee=v||W.colorScheme,{classes:N,cx:F}=Jn({colorScheme:ee,native:p!==d.ScrollArea,maxLineSize:oe,radius:A},{classNames:f,styles:g,unstyled:_,name:"Prism"});return $.createElement(d.Box,$e(ke({className:F(N.root,r),ref:t},z),{translate:"no"}),!u&&$.createElement(d.Tooltip,{label:X.copied?h:m,position:"left",withArrow:!0,arrowSize:6,offset:6,color:X.copied?"teal":void 0,unstyled:_},$.createElement(d.ActionIcon,{className:N.copy,"aria-label":X.copied?h:m,onClick:()=>X.copy(Y),unstyled:_},$.createElement(yt,{copied:X.copied}))),$.createElement(Wn,$e(ke({},qn),{theme:k(W,ee),code:Y,language:o}),({className:K,style:te,tokens:C,getLineProps:T,getTokenProps:w})=>$.createElement(p,{className:N.scrollArea,dir:"ltr"},$.createElement("pre",{className:F(N.code,K),style:te,dir:"ltr"},C.map((O,E)=>{var R,D,B,H;if(E===C.length-1&&O.length===1&&O[0].content===`
|
|
44
|
-
`)return null;const M=E+1,Q=T({line:O,key:E}),se=M in c,ue=ee==="dark"?W.fn.rgba(W.fn.themeColor((R=c[M])==null?void 0:R.color,9),.25):W.fn.themeColor((D=c[M])==null?void 0:D.color,0);return $.createElement("div",$e(ke({},Q),{className:F(N.line,Q.className),style:ke({},se?{backgroundColor:ue}:null)}),s&&$.createElement("div",{className:N.lineNumber,style:{color:se?W.fn.themeColor((B=c[M])==null?void 0:B.color,ee==="dark"?5:8):void 0}},((H=c[M])==null?void 0:H.label)||M),$.createElement("div",{className:N.lineContent},O.map((ce,me)=>{var pe,ne;const le=w({token:ce,key:me});return $.createElement("span",$e(ke({},le),{style:$e(ke({},le.style),{color:se?W.fn.themeColor((pe=c[M])==null?void 0:pe.color,ee==="dark"?5:8):(ne=le==null?void 0:le.style)==null?void 0:ne.color})}))})))}).filter(Boolean)))))});Ze.displayName="@mantine/prism/Prism";var ir=d.createStyles((e,{radius:t})=>({tab:{paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,height:34,border:`1px solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3]}`,borderBottom:0,fontSize:e.fontSizes.sm,color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7],backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,borderRadius:0,"&:first-of-type":{borderTopLeftRadius:e.radius.sm},"&:not(:first-of-type)":{borderLeft:0},"&:last-of-type":{borderTopRightRadius:e.radius.sm},"&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.colors.gray[0]},"&[data-active]":{color:e.colorScheme==="dark"?e.white:e.black,backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.fn.rgba(e.colors.gray[0],.65),"&::before":{backgroundColor:"transparent"}}},prism:{borderRadius:e.fn.radius(t),borderTopRightRadius:0,borderTopLeftRadius:0,border:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,borderTop:0,overflow:"hidden"},code:{borderTopRightRadius:0,borderTopLeftRadius:0,border:0}}));const Et=ir;var or=Object.defineProperty,sr=Object.defineProperties,lr=Object.getOwnPropertyDescriptors,qe=Object.getOwnPropertySymbols,_t=Object.prototype.hasOwnProperty,Tt=Object.prototype.propertyIsEnumerable,At=(e,t,n)=>t in e?or(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kt=(e,t)=>{for(var n in t||(t={}))_t.call(t,n)&&At(e,n,t[n]);if(qe)for(var n of qe(t))Tt.call(t,n)&&At(e,n,t[n]);return e},ur=(e,t)=>sr(e,lr(t)),cr=(e,t)=>{var n={};for(var r in e)_t.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&qe)for(var r of qe(e))t.indexOf(r)<0&&Tt.call(e,r)&&(n[r]=e[r]);return n};function dr(e){const{classes:t}=Et({radius:e.radius});return $.createElement(d.Tabs,ur(kt({},e),{variant:"outline",classNames:{tab:t.tab},translate:"no"}))}function pr(e){var t=e,{language:n,children:r,radius:l,noCopy:o,copyLabel:u,copiedLabel:f,withLineNumbers:g,highlightLines:m,scrollAreaComponent:h,trim:s,getPrismTheme:c,colorScheme:p}=t,v=cr(t,["language","children","radius","noCopy","copyLabel","copiedLabel","withLineNumbers","highlightLines","scrollAreaComponent","trim","getPrismTheme","colorScheme"]);const{classes:b}=Et({radius:l});return $.createElement(d.Tabs.Panel,kt({},v),$.createElement(Ze,{language:n,classNames:{root:b.prism,code:b.code},radius:l,noCopy:o,copyLabel:u,copiedLabel:f,withLineNumbers:g,highlightLines:m,scrollAreaComponent:h,trim:s,getPrismTheme:c,colorScheme:p},r))}const Fe=Ze;Fe.Tabs=dr,Fe.Tab=d.Tabs.Tab,Fe.TabsList=d.Tabs.List,Fe.Panel=pr;function xt({id:e,onSuccess:t,styles:n=Ae}){const r=Te.useModals(),l=async()=>{if(e){G.showNotification({id:"for-deleting",title:"Pending",message:"Deleting SQL Snippet...",loading:!0});try{await ie.sql_snippet.delete(e),G.updateNotification({id:"for-deleting",title:"Successful",message:`SQL Snippet [${e}] is deleted`,color:"green"}),t()}catch(u){G.updateNotification({id:"for-deleting",title:"Failed",message:u.message,color:"red"})}}},o=()=>r.openConfirmModal({title:"Delete this SQL Snippet?",labels:{confirm:"Confirm",cancel:"Cancel"},onCancel:()=>console.log("Cancel"),onConfirm:l,confirmProps:{color:"red"}});return a(d.Button,{size:n.button.size,color:"red",onClick:o,leftIcon:a(he.Trash,{size:20}),children:"Delete"})}function gr({content:e}){return I(d.HoverCard,{width:"60vw",shadow:"md",children:[a(d.HoverCard.Target,{children:a(d.ActionIcon,{size:16,children:a(ye.IconEye,{})})}),a(d.HoverCard.Dropdown,{children:a(Fe,{language:"sql",noCopy:!0,withLineNumbers:!0,children:e})})]})}function fr({styles:e=Ae,config:t}){Le(t);const{data:n=[],loading:r,refresh:l}=Se.useRequest(async()=>{const{data:o}=await ie.sql_snippet.list({pagination:{page:1,pagesize:10}});return o},{refreshDeps:[]});return I(ge,{children:[a(d.Group,{pt:e.spacing,position:"right",children:a(gt,{onSuccess:l})}),I(d.Box,{mt:e.spacing,sx:{position:"relative"},children:[a(d.LoadingOverlay,{visible:r}),I(d.Table,{horizontalSpacing:e.spacing,verticalSpacing:e.spacing,fontSize:e.size,highlightOnHover:!0,children:[a("thead",{children:I("tr",{children:[a("th",{children:"Name"}),a("th",{}),a("th",{children:"Created At"}),a("th",{children:"Updated At"}),a("th",{children:"Action"})]})}),a("tbody",{children:n.map(o=>{const{id:u,content:f,create_time:g,update_time:m}=o;return I("tr",{children:[a("td",{children:u}),a("td",{width:50,children:a(gr,{content:f})}),a("td",{width:200,children:g}),a("td",{width:200,children:m}),a("td",{width:400,children:I(d.Group,{position:"left",children:[a(ft,{...o,onSuccess:l}),a(xt,{id:u,onSuccess:l})]})})]},u)})})]})]})]})}const hr=()=>Promise.resolve().then(()=>mr).then(({version:e})=>(console.log(`[@devtable/dashboard] version: ${e}`),e)),Ct="@devtable/settings-form",Ot="9.18.
|
|
44
|
+
`)return null;const M=E+1,Q=T({line:O,key:E}),se=M in c,ue=ee==="dark"?W.fn.rgba(W.fn.themeColor((R=c[M])==null?void 0:R.color,9),.25):W.fn.themeColor((D=c[M])==null?void 0:D.color,0);return $.createElement("div",$e(ke({},Q),{className:F(N.line,Q.className),style:ke({},se?{backgroundColor:ue}:null)}),s&&$.createElement("div",{className:N.lineNumber,style:{color:se?W.fn.themeColor((B=c[M])==null?void 0:B.color,ee==="dark"?5:8):void 0}},((H=c[M])==null?void 0:H.label)||M),$.createElement("div",{className:N.lineContent},O.map((ce,me)=>{var pe,ne;const le=w({token:ce,key:me});return $.createElement("span",$e(ke({},le),{style:$e(ke({},le.style),{color:se?W.fn.themeColor((pe=c[M])==null?void 0:pe.color,ee==="dark"?5:8):(ne=le==null?void 0:le.style)==null?void 0:ne.color})}))})))}).filter(Boolean)))))});Ze.displayName="@mantine/prism/Prism";var ir=d.createStyles((e,{radius:t})=>({tab:{paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,height:34,border:`1px solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3]}`,borderBottom:0,fontSize:e.fontSizes.sm,color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7],backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,borderRadius:0,"&:first-of-type":{borderTopLeftRadius:e.radius.sm},"&:not(:first-of-type)":{borderLeft:0},"&:last-of-type":{borderTopRightRadius:e.radius.sm},"&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.colors.gray[0]},"&[data-active]":{color:e.colorScheme==="dark"?e.white:e.black,backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.fn.rgba(e.colors.gray[0],.65),"&::before":{backgroundColor:"transparent"}}},prism:{borderRadius:e.fn.radius(t),borderTopRightRadius:0,borderTopLeftRadius:0,border:`1px solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,borderTop:0,overflow:"hidden"},code:{borderTopRightRadius:0,borderTopLeftRadius:0,border:0}}));const Et=ir;var or=Object.defineProperty,sr=Object.defineProperties,lr=Object.getOwnPropertyDescriptors,qe=Object.getOwnPropertySymbols,_t=Object.prototype.hasOwnProperty,Tt=Object.prototype.propertyIsEnumerable,At=(e,t,n)=>t in e?or(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kt=(e,t)=>{for(var n in t||(t={}))_t.call(t,n)&&At(e,n,t[n]);if(qe)for(var n of qe(t))Tt.call(t,n)&&At(e,n,t[n]);return e},ur=(e,t)=>sr(e,lr(t)),cr=(e,t)=>{var n={};for(var r in e)_t.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&qe)for(var r of qe(e))t.indexOf(r)<0&&Tt.call(e,r)&&(n[r]=e[r]);return n};function dr(e){const{classes:t}=Et({radius:e.radius});return $.createElement(d.Tabs,ur(kt({},e),{variant:"outline",classNames:{tab:t.tab},translate:"no"}))}function pr(e){var t=e,{language:n,children:r,radius:l,noCopy:o,copyLabel:u,copiedLabel:f,withLineNumbers:g,highlightLines:m,scrollAreaComponent:h,trim:s,getPrismTheme:c,colorScheme:p}=t,v=cr(t,["language","children","radius","noCopy","copyLabel","copiedLabel","withLineNumbers","highlightLines","scrollAreaComponent","trim","getPrismTheme","colorScheme"]);const{classes:b}=Et({radius:l});return $.createElement(d.Tabs.Panel,kt({},v),$.createElement(Ze,{language:n,classNames:{root:b.prism,code:b.code},radius:l,noCopy:o,copyLabel:u,copiedLabel:f,withLineNumbers:g,highlightLines:m,scrollAreaComponent:h,trim:s,getPrismTheme:c,colorScheme:p},r))}const Fe=Ze;Fe.Tabs=dr,Fe.Tab=d.Tabs.Tab,Fe.TabsList=d.Tabs.List,Fe.Panel=pr;function xt({id:e,onSuccess:t,styles:n=Ae}){const r=Te.useModals(),l=async()=>{if(e){G.showNotification({id:"for-deleting",title:"Pending",message:"Deleting SQL Snippet...",loading:!0});try{await ie.sql_snippet.delete(e),G.updateNotification({id:"for-deleting",title:"Successful",message:`SQL Snippet [${e}] is deleted`,color:"green"}),t()}catch(u){G.updateNotification({id:"for-deleting",title:"Failed",message:u.message,color:"red"})}}},o=()=>r.openConfirmModal({title:"Delete this SQL Snippet?",labels:{confirm:"Confirm",cancel:"Cancel"},onCancel:()=>console.log("Cancel"),onConfirm:l,confirmProps:{color:"red"}});return a(d.Button,{size:n.button.size,color:"red",onClick:o,leftIcon:a(he.Trash,{size:20}),children:"Delete"})}function gr({content:e}){return I(d.HoverCard,{width:"60vw",shadow:"md",children:[a(d.HoverCard.Target,{children:a(d.ActionIcon,{size:16,children:a(ye.IconEye,{})})}),a(d.HoverCard.Dropdown,{children:a(Fe,{language:"sql",noCopy:!0,withLineNumbers:!0,children:e})})]})}function fr({styles:e=Ae,config:t}){Le(t);const{data:n=[],loading:r,refresh:l}=Se.useRequest(async()=>{const{data:o}=await ie.sql_snippet.list({pagination:{page:1,pagesize:10}});return o},{refreshDeps:[]});return I(ge,{children:[a(d.Group,{pt:e.spacing,position:"right",children:a(gt,{onSuccess:l})}),I(d.Box,{mt:e.spacing,sx:{position:"relative"},children:[a(d.LoadingOverlay,{visible:r}),I(d.Table,{horizontalSpacing:e.spacing,verticalSpacing:e.spacing,fontSize:e.size,highlightOnHover:!0,children:[a("thead",{children:I("tr",{children:[a("th",{children:"Name"}),a("th",{}),a("th",{children:"Created At"}),a("th",{children:"Updated At"}),a("th",{children:"Action"})]})}),a("tbody",{children:n.map(o=>{const{id:u,content:f,create_time:g,update_time:m}=o;return I("tr",{children:[a("td",{children:u}),a("td",{width:50,children:a(gr,{content:f})}),a("td",{width:200,children:g}),a("td",{width:200,children:m}),a("td",{width:400,children:I(d.Group,{position:"left",children:[a(ft,{...o,onSuccess:l}),a(xt,{id:u,onSuccess:l})]})})]},u)})})]})]})]})}const hr=()=>Promise.resolve().then(()=>mr).then(({version:e})=>(console.log(`[@devtable/dashboard] version: ${e}`),e)),Ct="@devtable/settings-form",Ot="9.18.4",Rt="Apache-2.0",It={access:"public",registry:"https://registry.npmjs.org/"},Dt=["dist"],Lt="./dist/settings-form.umd.js",Nt="./dist/settings-form.es.js",$t="./dist/index.d.ts",Ft={".":{import:"./dist/settings-form.es.js",require:"./dist/settings-form.umd.js"},"./dist/style.css":{import:"./dist/style.css",require:"./dist/style.css"}},Pt={"dev-build":"tsc && vite build --watch",build:"tsc && vite build",preview:"vite preview"},Bt={"@monaco-editor/react":"4.4.6","@tabler/icons":"1.119.0","monaco-editor":"0.36.0"},zt={"@emotion/babel-plugin":"11.11.0","@types/crypto-js":"v4.1.1","@types/lodash":"^4.14.182","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","@types/react-grid-layout":"^1.3.2","rollup-plugin-visualizer":"5.9.0",typescript:"^4.6.3","vite-plugin-static-copy":"0.13.1"},Mt={"@emotion/react":"11.10.6","@mantine/core":"5.9.5","@mantine/hooks":"5.9.5","@mantine/modals":"5.9.5","@mantine/notifications":"5.9.5",ahooks:"^3.3.11",axios:"^0.27.2","crypto-js":"^4.1.1",lodash:"^4.17.21",react:"^16.8.0 || 17.x || 18.x","react-dom":"^16.8.0 || 17.x || 18.x","react-hook-form":"^7.31.2","tabler-icons-react":"^1.48.0"},mr=Object.freeze(Object.defineProperty({__proto__:null,default:{name:Ct,version:Ot,license:Rt,publishConfig:It,files:Dt,main:Lt,module:Nt,types:$t,exports:Ft,scripts:Pt,dependencies:Bt,devDependencies:zt,peerDependencies:Mt},dependencies:Bt,devDependencies:zt,exports:Ft,files:Dt,license:Rt,main:Lt,module:Nt,name:Ct,peerDependencies:Mt,publishConfig:It,scripts:Pt,types:$t,version:Ot},Symbol.toStringTag,{value:"Module"}));U.APIKeyList=Bn,U.AccountList=Nn,U.AddAPIKey=ct,U.AddAccount=lt,U.AddDataSource=it,U.AddSQLSnippet=gt,U.DataSourceList=On,U.DeleteAPIKey=dt,U.DeleteAccount=ut,U.DeleteDataSource=ot,U.DeleteSQLSnippet=xt,U.Login=Fn,U.SQLSnippetList=fr,U.UpdateSQLSnippet=ft,U.getVersion=hr,Object.defineProperty(U,Symbol.toStringTag,{value:"Module"})});
|