@devtable/dashboard 9.13.0 → 9.14.1

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.
@@ -2093,7 +2093,7 @@ const Ru = (e) => {
2093
2093
  getColor: xr(["#fff7f1", "darkorange", "#b60000"]),
2094
2094
  name: "orange",
2095
2095
  category: "sequential"
2096
- }, Vs = "@devtable/dashboard", Yi = "9.13.0", Os = "Apache-2.0", Fs = {
2096
+ }, Vs = "@devtable/dashboard", Yi = "9.14.1", Os = "Apache-2.0", Fs = {
2097
2097
  access: "public",
2098
2098
  registry: "https://registry.npmjs.org/"
2099
2099
  }, Ps = [
@@ -2126,7 +2126,7 @@ const Ru = (e) => {
2126
2126
  "rc-tree-select": "5.5.5",
2127
2127
  reactflow: "^11.5.3"
2128
2128
  }, Ys = {
2129
- "@emotion/babel-plugin": "11.10.6",
2129
+ "@emotion/babel-plugin": "11.11.0",
2130
2130
  "@faker-js/faker": "7.6.0",
2131
2131
  "@mantine/core": "5.9.5",
2132
2132
  "@mantine/dates": "5.9.5",
@@ -2188,7 +2188,7 @@ const Ru = (e) => {
2188
2188
  "prosemirror-schema-list": "^1.2.2",
2189
2189
  "react-grid-layout": "^1.3.4",
2190
2190
  "react-hook-form": "^7.31.2",
2191
- "rollup-plugin-visualizer": "5.6.0",
2191
+ "rollup-plugin-visualizer": "5.9.0",
2192
2192
  "tabler-icons-react": "^1.48.0",
2193
2193
  typescript: "^4.6.3",
2194
2194
  "vite-plugin-static-copy": "0.13.1"
@@ -24,7 +24,7 @@ Check the render method of \``+_+"`."}return""}}function G1(_){{if(_!==void 0){v
24
24
 
25
25
  Check your code at `+M+":"+E+"."}return""}}var ao={};function F1(_){{var M=io();if(!M){var E=typeof _=="string"?_:_.displayName||_.name;E&&(M=`
26
26
 
27
- Check the top-level render call using <`+E+">.")}return M}}function so(_,M){{if(!_._store||_._store.validated||_.key!=null)return;_._store.validated=!0;var E=F1(M);if(ao[E])return;ao[E]=!0;var R="";_&&_._owner&&_._owner!==ui.current&&(R=" It was passed a child from "+oe(_._owner.type)+"."),bt(_),$('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',E,R),bt(null)}}function oo(_,M){{if(typeof _!="object")return;if(oi(_))for(var E=0;E<_.length;E++){var R=_[E];ci(R)&&so(R,M)}else if(ci(_))_._store&&(_._store.validated=!0);else if(_){var se=S(_);if(typeof se=="function"&&se!==_.entries)for(var ue=se.call(_),te;!(te=ue.next()).done;)ci(te.value)&&so(te.value,M)}}}function q1(_){{var M=_.type;if(M==null||typeof M=="string")return;var E;if(typeof M=="function")E=M.propTypes;else if(typeof M=="object"&&(M.$$typeof===d||M.$$typeof===g))E=M.propTypes;else return;if(E){var R=oe(M);I1(E,_.props,"prop",R,_)}else if(M.PropTypes!==void 0&&!di){di=!0;var se=oe(M);$("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",se||"Unknown")}typeof M.getDefaultProps=="function"&&!M.getDefaultProps.isReactClassApproved&&$("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function W1(_){{for(var M=Object.keys(_.props),E=0;E<M.length;E++){var R=M[E];if(R!=="children"&&R!=="key"){bt(_),$("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",R),bt(null);break}}_.ref!==null&&(bt(_),$("Invalid attribute `ref` supplied to `React.Fragment`."),bt(null))}}function lo(_,M,E,R,se,ue){{var te=Q(_);if(!te){var J="";(_===void 0||typeof _=="object"&&_!==null&&Object.keys(_).length===0)&&(J+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ie=G1(se);Ie?J+=Ie:J+=io();var me;_===null?me="null":oi(_)?me="array":_!==void 0&&_.$$typeof===t?(me="<"+(oe(_.type)||"Unknown")+" />",J=" Did you accidentally export a JSX literal instead of a component?"):me=typeof _,$("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",me,J)}var ye=N1(_,M,E,se,ue);if(ye==null)return ye;if(te){var Ee=M.children;if(Ee!==void 0)if(R)if(oi(Ee)){for(var yt=0;yt<Ee.length;yt++)oo(Ee[yt],_);Object.freeze&&Object.freeze(Ee)}else $("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else oo(Ee,_)}return _===i?W1(ye):q1(ye),ye}}function j1(_,M,E){return lo(_,M,E,!0)}function Y1(_,M,E){return lo(_,M,E,!1)}var R1=Y1,Q1=j1;wt.Fragment=i,wt.jsx=R1,wt.jsxs=Q1}()),wt}(function(e){process.env.NODE_ENV==="production"?e.exports=wo():e.exports=_o()})(Co);const V=xt.Fragment,n=xt.jsx,c=xt.jsxs;function zi(e,t){b.useEffect(()=>{const r=i=>{console.log(i);const{viewID:s}=i.detail;if(!s){console.error(new Error("[Open View] Needs to pick a view first"));return}e.views.appendToVisibles(s),t&&e.views.setIDOfVIE(s)};return window.addEventListener("open-view",r),()=>{window.removeEventListener("open-view",r)}},[e,t]),b.useEffect(()=>{const r=i=>{console.log(i);const{dictionary:s,payload:o}=i.detail;if(!o||Object.keys(o).length===0){console.error(new Error("[Set Filter Values] payload is empty"));return}Object.entries(s).forEach(([u,l])=>{e.filters.setValueByKey(u,v.get(o,l))})};return window.addEventListener("set-filter-values",r),()=>{window.removeEventListener("set-filter-values",r)}},[e]),b.useEffect(()=>{function r(s){return Array.isArray(s)?[]:typeof s=="object"?{}:typeof s=="boolean"?!1:typeof s=="string"?"":typeof s=="number"?0:s}const i=s=>{console.log(s);const{filter_keys:o}=s.detail;o.forEach(u=>{const l=v.get(e.filters.values,u),d=r(l);console.log(`${u}: ${d}`),e.filters.setValueByKey(u,d)})};return window.addEventListener("clear-filter-values",i),()=>{window.removeEventListener("clear-filter-values",i)}},[e]),b.useEffect(()=>{const r=i=>{console.log(i);const{urlTemplate:s,openInNewTab:o,enableEncoding:u=!1,payload:l}=i.detail;if(!s){console.error(new Error("[Open Link] URL is empty"));return}function d(g){return v.cloneDeepWith(g,m=>{if(u&&typeof m=="string")return encodeURIComponent(m)})}const f=v.template(s||"")(d({...l,filters:e.payloadForSQL.filterValues,context:e.payloadForSQL.context}));window.open(f,o?"_blank":"_self","noopener")};return window.addEventListener("open-link",r),()=>{window.removeEventListener("open-link",r)}},[e])}class So{constructor(t){P(this,"symbol");this.symbol=Symbol(t)}}function Ye(e){return new So(e)}class mn{constructor(){P(this,"parent");P(this,"factoryRegistry",new Map);P(this,"instanceRegistry",new Map)}createScoped(){const t=new mn;return t.parent=this,t}getRequired(t){return this.get(t)}get(t){if(this.instanceRegistry.has(t.symbol))return this.instanceRegistry.get(t.symbol);const r=this.factoryRegistry.get(t.symbol);if(r){const i=r(this);return this.instanceRegistry.set(t.symbol,i),i}if(this.parent)return this.parent.get(t)}provideFactory(t,r){return this.factoryRegistry.has(t.symbol)?console.warn(`Token ${t.symbol.toString()} is already registered`):this.factoryRegistry.set(t.symbol,r),this}provideValue(t,r){return this.factoryRegistry.has(t.symbol)?console.warn(`Token ${t.symbol.toString()} is already registered`):this.factoryRegistry.set(t.symbol,()=>r),this}dispose(){this.instanceRegistry.forEach(t=>{const r=v.get(t,"dispose");v.isFunction(r)&&r.bind(t)()}),this.instanceRegistry.clear(),this.factoryRegistry.clear()}}const bn=b.createContext(null);function Gt(e){const t=b.useContext(bn),r=Z.useCreation(()=>e.configure(t||new mn),[e.configure]),i=Z.usePrevious(r);return i&&i!==r&&i.dispose(),n(bn.Provider,{value:r,children:e.children})}function Ei(){return b.useContext(bn)}const To={viewPanelInFullScreen:v.noop,inFullScreen:!1},yn=b.createContext(To),Li=b.createContext(null),vn=Li.Provider;function ce(){const e=b.useContext(Li);if(!e)throw new Error("Please use ModelContextProvider");return e}const Pi=b.createContext(null),xn=Pi.Provider;function Y(){const e=b.useContext(Pi);if(!e)throw new Error("Please use ContentModelContextProvider");return e}const ko={layoutFrozen:!1,freezeLayout:v.noop,inEditMode:!1},Ke=b.createContext(ko),Oi=b.createContext({panel:null,data:[],loading:!1}),Cn=Oi.Provider;function Ce(){const e=b.useContext(Oi);if(!e.panel)throw new Error("Please use PanelContextProvider");return e}const Do={fullScreenPanelID:"",setFullScreenPanelID:v.noop},wn=b.createContext(Do);function Vi(){const e=b.useContext(wn);if(!e)throw new Error("Please use FullScreenPanelContext.Provider");return e}class ke extends b.Component{constructor(t){super(t),this.state={error:null}}componentDidCatch(t){this.setState({error:t})}render(){var t;if(this.state.error){const r=()=>{this.setState({error:null})};return c(a.Box,{children:[n(a.Text,{size:"xs",children:(t=this.state.error)==null?void 0:t.message}),n(a.Button,{variant:"subtle",size:"xs",mx:"auto",compact:!0,sx:{display:"block"},onClick:r,children:"Retry"})]})}return this.props.children}}const _n={fontSize:"14px",lineHeight:"32px",color:"#3D3E45",ul:{paddingLeft:"2em",margin:"6px 0 0"},p:{margin:0},a:{WebkitTapHighlightColor:"transparent",color:"rgb(34, 139, 230)",textDecoration:"none","&:hover":{textDecoration:"underline"},"&:active, &:hover":{outlineWidth:0}},table:{tr:{"th, td":{padding:"0 .5em"}}},"table.rich-text-table-render, div.tableWrapper table":{"th, td":{border:"1px solid #eaeaea"},"tr:last-of-type td":{borderBottom:"1px solid #eaeaea"}},".resize-cursor":{cursor:"col-resize"},details:{summary:{listStyle:"none",cursor:"pointer",transition:"color 300ms ease",userSelect:"none"},"summary::-webkit-details-marker":{display:"none"},"summary:hover":{color:"black","&::before":{opacity:1}},"summary::before":{content:'"►"',fontSize:"10px",margin:"0px 5px",opacity:.5,display:"inline-block",transition:"opacity 300ms ease, transform 300ms ease"}},"details[open] summary::before":{transform:"rotate(90deg)"},"details + details":{marginTop:"10px"}},Ft=({value:e,styles:t={}})=>{const r=Si.useEditor({extensions:[Ti,_i,X.Link,mi,gi,hi,vi.configure({resizable:!1,HTMLAttributes:{class:"rich-text-table-render"}}),wi,Ci,xi,bi.configure({types:["heading","paragraph"]}),fi.configure({placeholder:"This is placeholder"}),yi,pi.Color],content:e,editable:!1});b.useEffect(()=>{r==null||r.commands.setContent(e)},[e,r]);const i=b.useMemo(()=>v.defaultsDeep({},{content:_n},t),[t]);return n(X.RichTextEditor,{editor:r,styles:i,children:n(X.RichTextEditor.Content,{})})},Io=({description:e,isDescriptionEmpty:t})=>t?null:n(a.Tooltip,{color:"white",label:n(Ft,{value:e,styles:{root:{border:"none"},content:{padding:0}}}),styles:{tooltip:{border:"0.0625rem solid rgb(233, 236, 239)",boxShadow:"rgb(0 0 0 / 5%) 0px 0.0625rem 0.1875rem, rgb(0 0 0 / 5%) 0px 1.25rem 1.5625rem -0.3125rem, rgb(0 0 0 / 4%) 0px 0.625rem 0.625rem -0.3125rem"}},withArrow:!0,children:n(a.Box,{sx:{height:"16px",alignSelf:"center"},children:n(O.IconInfoCircle,{size:16,color:"gray"})})}),Mo=T.observer(({label:e,config:{default_value:t,description:r,isDescriptionEmpty:i,...s},value:o,onChange:u})=>c(a.Box,{children:[n(a.Text,{children:" "}),n(a.Checkbox,{label:c(a.Group,{noWrap:!0,position:"apart",align:"middle",spacing:6,children:[n(a.Box,{sx:{flexGrow:1},children:e}),n(Io,{description:r,isDescriptionEmpty:i})]}),checked:o||!1,onChange:l=>u(l.currentTarget.checked),...s,pt:".4em",styles:{input:{borderColor:"#e9ecef"}}})]})),Bi=T.observer(({label:e,config:t,value:r=[null,null],onChange:i})=>{const s=Array.isArray(r)?r.map(d=>d?j(d).toDate():null):[null,null],o=d=>{i(d.map(p=>p&&j(p).format(t.inputFormat)))},u=t.getMinDate(s[0]),l=t.getMaxDate(s[0]);return n(co.DateRangePicker,{label:e,value:s,onChange:o,icon:n(k.Calendar,{size:16}),sx:{minWidth:"16em"},minDate:u,maxDate:l,styles:{input:{borderColor:"#e9ecef"}},...t})}),Ao=a.createStyles((e,{radius:t=4})=>({root:{borderRadius:e.fn.radius(t),display:"flex",flexWrap:"nowrap",border:"1px solid #ced4da",paddingLeft:"0px",paddingRight:"30px",backgroundColor:"#fff",transition:"border-color 100ms ease",borderColor:"#e9ecef","&.rc-select.rc-select-open":{borderColor:"#228be6 !important",".rc-select-selection-overflow-item-rest":{display:"none"},".rc-select-selection-overflow-item-suffix":{display:"block"}},".rc-select-selector":{height:"auto",lineHeight:1.55,paddingLeft:"12px",resize:"none",boxSizing:"border-box",fontSize:"14px",width:"100%",color:"#000",display:"block",textAlign:"left",minHeight:"36px",cursor:"pointer",flexGrow:1},".rc-select-selection-search-mirror":{display:"none"},".rc-select-selection-search":{flexGrow:1,width:"auto !important"},".rc-select-selection-overflow":{display:"flex",minHeight:"34px",alignItems:"center",flexWrap:"nowrap",marginLeft:"calc(-10px / 2)",boxSizing:"border-box"},".rc-select-selection-overflow-item":{display:"flex",alignItems:"center",backgroundColor:"#f1f3f5",color:"#495057",height:"24px",paddingLeft:"12px",paddingRight:"12px",fontWeight:500,fontSize:"12px",borderRadius:"4px",cursor:"default",userSelect:"none",maxWidth:"calc(100% - 20px)",margin:"calc(10px / 2 - 2px) calc(10px / 2)"},".rc-select-selection-overflow-item-rest":{cursor:"pointer"},".rc-select-selection-overflow-item-suffix":{display:"none",backgroundColor:"transparent",width:"100%",maxWidth:"100%",height:"28px",margin:0,paddingLeft:0,paddingRight:0},input:{flex:1,minWidth:"60px",backgroundColor:"transparent",border:0,outline:0,fontSize:"14px",padding:0,marginLeft:0,color:"inherit",height:"28px",lineHeight:"32px",cursor:"pointer",width:"100%","&::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration":{display:"none"}},".rc-select-clear":{marginRight:"-24px",alignSelf:"center",cursor:"pointer"},"&.rc-select-disabled":{backgroundColor:"rgb(241, 243, 245)",color:"rgb(144, 146, 150)",opacity:.6,"&, .rc-select-selector, input":{cursor:"not-allowed"}}},label:{fontSize:e.fontSizes.sm,fontWeight:500,color:"#212529"},dropdown:{fontSize:e.fontSizes.xs,zIndex:300,backgroundColor:"#fff",border:"1px solid #e9ecef",marginTop:6,padding:0,boxShadow:"0 1px 3px rgb(0 0 0 / 5%), rgb(0 0 0 / 5%) 0px 10px 15px -5px, rgb(0 0 0 / 4%) 0px 7px 7px -5px",borderRadius:"4px","&.rc-select-dropdown-slide-up-leave-active":{display:"none"},".rc-select-item-empty":{padding:"8px 12px"},".rc-select-item-option":{boxSizing:"border-box",textAlign:"left",width:"100%",padding:"8px 12px 8px 2px",cursor:"pointer",fontSize:"14px",color:"#000",borderRadius:"4px",display:"flex",flexWrap:"nowrap",overflow:"hidden","&:hover":{backgroundColor:"#f1f3f5"},flexDirection:"row-reverse",".rc-select-item-option-state":{flexGrow:0,flexShrink:0,width:"30px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},".rc-select-item-option-content":{flexGrow:1}}}})),Ni=({errorMessage:e})=>e?n(a.Text,{color:"red",size:12,children:e}):n(a.Text,{color:"dimmed",size:12,children:"Not found"}),$o=({disabled:e,classNames:t,styles:r,unstyled:i,radius:s,style:o,label:u,value:l,onChange:d,options:p,errorMessage:f})=>{const{classes:g,cx:h}=Ao({radius:s},{name:"MultiSelectWidget",classNames:t,styles:r,unstyled:i}),[m,w]=b.useState(!1),C=B=>{w(B)},S=m&&(l==null?void 0:l.length)>0,[I,$]=b.useState(""),G=b.useMemo(()=>{if(!I)return p;const B=I.toLowerCase(),L=z=>{var A;return((A=z.description)==null?void 0:A.toLowerCase().includes(B))||z.label.toLowerCase().includes(B)};return p.filter(L)},[I,p]);return c(a.Stack,{spacing:3,children:[c(a.Group,{position:"apart",children:[n(a.Text,{className:g.label,children:u}),S&&n(a.Tooltip,{label:`${l.length} selected`,children:n(a.Badge,{children:l.length})})]}),n(ki,{disabled:e,allowClear:!0,className:h(g.root,"check-select"),dropdownClassName:h(g.dropdown,""),onDropdownVisibleChange:C,transitionName:"rc-select-dropdown-slide-up",choiceTransitionName:"rc-select-selection__choice-zoom",style:o,clearIcon:()=>n(a.CloseButton,{}),value:l,onChange:d,onSelect:console.log,mode:"multiple",maxTagCount:0,notFoundContent:n(Ni,{errorMessage:f}),maxTagTextLength:10,maxTagPlaceholder:B=>`${B.length} selected`,searchValue:I,onSearch:$,filterOption:!1,children:G.map(B=>n(ki.Option,{children:n(a.Group,{noWrap:!0,children:c("div",{children:[n(a.Text,{size:"sm","data-role":"label",children:B.label}),n(a.Text,{size:"xs",color:"dimmed","data-role":"description",children:B.description})]})})},B.value))})]})},zo=T.observer(({label:e,config:t,value:r,onChange:i})=>{const s=Y(),o=!!t.options_query_id,{state:u,error:l}=s.getDataStuffByID(t.options_query_id),d=u==="loading",p=t.min_width?t.min_width:"200px",f=o?d:!1,g=h=>i(h,!1);return n($o,{label:e,options:t.options,style:{minWidth:"160px",width:p,maxWidth:f?p:"unset",borderColor:"#e9ecef"},disabled:f,value:r,onChange:g,errorMessage:l})}),Eo=b.forwardRef(({label:e,description:t,...r},i)=>n("div",{ref:i,...r,children:n(a.Group,{noWrap:!0,children:c("div",{children:[n(a.Text,{size:"sm","data-role":"label",children:e}),n(a.Text,{size:"xs",color:"dimmed","data-role":"description",children:t})]})})})),Lo=T.observer(({label:e,config:t,value:r,onChange:i})=>{const s=Y(),o=!!t.options_query_id,{state:u,error:l}=s.getDataStuffByID(t.options_query_id),d=u==="loading";return b.useEffect(()=>{var g;const{default_selection_count:p}=t;if(!p)return;const f=((g=t.options[0])==null?void 0:g.value)??"";console.log("Selecting the first option by default. New value: ",f),i(f,!0)},[t.default_selection_count,t.options]),n(a.Select,{label:e,data:t.options,disabled:o?d:!1,value:r,onChange:i,error:!!l,placeholder:l,maxDropdownHeight:500,styles:{root:{width:t.width?t.width:"200px"},input:{borderColor:"#e9ecef"}},sx:{".mantine-Select-item[data-selected] .mantine-Text-root[data-role=description]":{color:"rgba(255,255,255,.7)"}},itemComponent:Eo})});function Po({label:e,config:t,value:r,onChange:i}){return n(a.TextInput,{label:e,value:r||"",onChange:s=>i(s.currentTarget.value),...t,styles:{input:{borderColor:"#e9ecef"}}})}const Oo=({rotate:e,onClick:t})=>n("svg",{onClick:t,className:"caret-icon",viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"14px",height:"14px",fill:"currentColor","aria-hidden":"true",transform:`rotate(${e})`,children:n("path",{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"})}),Vo=({expanded:e,isLeaf:t,value:r,onClick:i,...s})=>(r==="0-0-value"&&console.log(s),t?n("span",{style:{width:"14px",display:"inline-block"}}):n(Oo,{rotate:e?"0":"-90",onClick:i,...s})),Bo=({onClick:e})=>c("svg",{onClick:e,className:"checkbox-icon",width:"16",height:"16",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[n("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),n("rect",{className:"border",x:"4",y:"4",width:"16",height:"16",rx:"2"}),n("rect",{className:"checkmark-indeterminate",x:"8",y:"8",width:"8",height:"8",rx:"2",stroke:"none"}),n("path",{className:"checkmark-checked",d:"M9 12l2 2l4 -4"})]}),No=({onClick:e,...t})=>n(Bo,{onClick:e,...t}),Go=a.createStyles((e,{radius:t=4})=>({root:{borderRadius:e.fn.radius(t),display:"flex",flexWrap:"nowrap",border:"1px solid #ced4da",paddingLeft:"0px",paddingRight:"30px",backgroundColor:"#fff",transition:"border-color 100ms ease",borderColor:"#e9ecef","&.rc-tree-select.rc-tree-select-open":{borderColor:"#228be6 !important",".rc-tree-select-selection-overflow-item-rest":{display:"none"},".rc-tree-select-selection-overflow-item-suffix":{display:"block"}},".rc-tree-select-selector":{height:"auto",lineHeight:1.55,paddingLeft:"12px",resize:"none",boxSizing:"border-box",fontSize:"14px",width:"100%",color:"#000",display:"block",textAlign:"left",minHeight:"36px",cursor:"pointer",flexGrow:1},".rc-tree-select-selection-search-mirror":{display:"none"},".rc-tree-select-selection-search":{flexGrow:1,width:"auto !important"},".rc-tree-select-selection-overflow":{display:"flex",minHeight:"34px",alignItems:"center",flexWrap:"nowrap",marginLeft:"calc(-10px / 2)",boxSizing:"border-box"},".rc-tree-select-selection-overflow-item":{display:"flex",alignItems:"center",backgroundColor:"#f1f3f5",color:"#495057",height:"24px",paddingLeft:"12px",paddingRight:"12px",fontWeight:500,fontSize:"12px",borderRadius:"4px",cursor:"default",userSelect:"none",maxWidth:"calc(100% - 20px)",margin:"calc(10px / 2 - 2px) calc(10px / 2)"},".rc-tree-select-selection-overflow-item-rest":{cursor:"pointer"},".rc-tree-select-selection-overflow-item-suffix":{display:"none",backgroundColor:"transparent",width:"100%",maxWidth:"100%",height:"28px",margin:0,paddingLeft:0,paddingRight:0},input:{flex:1,minWidth:"60px",backgroundColor:"transparent",border:0,outline:0,fontSize:"14px",padding:0,marginLeft:0,color:"inherit",height:"28px",lineHeight:"32px",cursor:"pointer",width:"100%","&::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration":{display:"none"}},".rc-tree-select-clear":{marginRight:"-24px",alignSelf:"center",cursor:"pointer"},"&.rc-tree-select-disabled":{backgroundColor:"rgb(241, 243, 245)",color:"rgb(144, 146, 150)",opacity:.6,"&, .rc-tree-select-selector, input":{cursor:"not-allowed"}}},label:{fontSize:e.fontSizes.sm,fontWeight:500,color:"#212529"},dropdown:{fontSize:e.fontSizes.xs,zIndex:300,paddingTop:"6px","&.rc-tree-select-dropdown-slide-up-leave-active":{display:"none"},".rc-tree-select-tree-list .rc-tree-select-tree-list-holder":{},".rc-tree-select-tree-list, .rc-tree-select-empty":{backgroundColor:"#fff",border:"1px solid #e9ecef",padding:0,boxShadow:"0 1px 3px rgb(0 0 0 / 5%), rgb(0 0 0 / 5%) 0px 10px 15px -5px, rgb(0 0 0 / 4%) 0px 7px 7px -5px",borderRadius:"4px"},".rc-tree-select-empty":{padding:"8px 12px"},".rc-tree-select-tree-treenode":{boxSizing:"border-box",textAlign:"left",width:"100%",padding:"8px 12px",cursor:"pointer",fontSize:"14px",color:"#000",borderRadius:"4px",display:"flex",flexWrap:"nowrap",overflow:"hidden","&:hover":{backgroundColor:"#f1f3f5"},"&.rc-tree-select-tree-treenode-checkbox-checked":{".rc-tree-select-tree-iconEle .checkbox-icon .checkmark-checked":{stroke:"rgb(64, 192, 87)",animation:"check 200ms linear forwards"}},"&.rc-tree-select-tree-treenode-checkbox-indeterminate":{".rc-tree-select-tree-iconEle .checkbox-icon .checkmark-indeterminate":{fill:"rgb(64, 192, 87)"}},".rc-tree-select-tree-switcher":{height:"16px",alignSelf:"center",paddingRight:"2px",transition:"color 200ms ease","&:hover":{color:"#228be6","svg.caret-icon":{color:"#228be6"}},"svg.caret-icon":{color:"#ced4da",transition:"all 200ms ease"}},".rc-tree-select-tree-node-content-wrapper":{display:"flex",flexWrap:"nowrap",overflow:"hidden",alignItems:"center",gap:"8px",transition:"color 200ms ease","&:hover":{color:"#228be6"}},".rc-tree-select-tree-iconEle":{height:"16px","svg .border":{stroke:"#ced4da"},".checkbox-icon .checkmark-indeterminate":{fill:"transparent",transition:"fill 200ms ease"},".checkbox-icon .checkmark-checked":{transform:"scale(1.2)",transformOrigin:"center center",strokeDasharray:10,strokeDashoffset:-10},"@keyframes check":{"0%":{strokeDashoffset:10},"100%":{strokeDashoffset:0}}},".rc-tree-select-tree-title":{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",".rc-tree-select-tree-title-desc":{fontSize:"12px",maxWidth:"100%",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}},".rc-tree-select-tree-indent":{flexGrow:0,height:0,verticalAlign:"bottom"},".rc-tree-select-tree-indent-unit":{display:"inline-block",width:"1em"}}}})),Fo=({disabled:e,classNames:t,styles:r,unstyled:i,radius:s,style:o,label:u,value:l,onChange:d,treeData:p,errorMessage:f})=>{const{classes:g,cx:h}=Go({radius:s},{name:"FilterTreeSelectWidget",classNames:t,styles:r,unstyled:i}),[m,w]=b.useState(!1),C=I=>{w(I)},S=m&&(l==null?void 0:l.length)>0;return c(a.Stack,{spacing:3,children:[c(a.Group,{position:"apart",children:[n(a.Text,{className:g.label,children:u}),S&&n(a.Tooltip,{label:`${l.length} selected`,children:n(a.Badge,{children:l.length})})]}),n(Di,{disabled:e,allowClear:!0,className:h(g.root,"check-select"),dropdownClassName:h(g.dropdown,""),onDropdownVisibleChange:C,transitionName:"rc-tree-select-dropdown-slide-up",choiceTransitionName:"rc-tree-select-selection__choice-zoom",style:o,treeLine:!0,clearIcon:()=>n(a.CloseButton,{}),switcherIcon:Vo,treeIcon:No,maxTagTextLength:10,value:l,treeData:p,notFoundContent:n(Ni,{errorMessage:f}),treeNodeFilterProp:"filterBasis",treeCheckable:!0,showCheckedStrategy:Di.SHOW_PARENT,onChange:d,onSelect:console.log,maxTagCount:0,maxTagPlaceholder:I=>`${I.length} selected`})]})},qo=T.observer(({label:e,config:t,value:r,onChange:i})=>{const{treeData:s,treeDataLoading:o,errorMessage:u}=t,l=t.min_width?t.min_width:"200px",p=!!t.options_query_id?o:!1;return n(Fo,{disabled:p,style:{minWidth:"160px",width:l,maxWidth:p?l:"unset",borderColor:"#e9ecef"},value:r,onChange:f=>i(f,!1),treeData:s,errorMessage:u,label:e})}),Wo=T.observer(({filter:{type:e,config:t,key:r,...i},formFieldProps:s})=>{switch(e){case"select":return n(Lo,{...i,...s,config:t});case"multi-select":return n(zo,{...i,...s,config:t});case"tree-select":return n(qo,{...i,...s,config:t});case"text-input":return n(Po,{...i,...s,config:t});case"date-range":return n(Bi,{...i,...s,config:t});case"checkbox":return n(Mo,{...i,...s,config:t});default:return null}}),Gi=T.observer(b.forwardRef(({filter:e,...t},r)=>n("div",{className:"filter-root",ref:r,children:n(ke,{children:n(Wo,{filter:e,formFieldProps:t})})}))),Fi=T.observer(function({view:t}){const r=Y(),{control:i,handleSubmit:s,reset:o}=x.useForm({defaultValues:r.filters.values,reValidateMode:"onBlur"}),u=x.useWatch({control:i});b.useEffect(()=>{o(r.filters.values)},[r.filters.values,o]),b.useEffect(()=>{r.filters.updatePreviewValues(u)},[u]);const l=r.filters.visibleInView(t.id),d=b.useMemo(()=>l.every(h=>h.should_auto_submit),[l]),p=b.useMemo(()=>l.filter(h=>v.get(h,"config.required",!1)),[l]),f=b.useMemo(()=>p.length===0?!1:p.some(h=>!h.requiredAndPass(u[h.key])),[u,p]);if(l.length===0)return null;const g=(h,m)=>(w,C)=>{m(w),(h.should_auto_submit||C)&&r.filters.setValueByKey(h.key,w)};return n("form",{onSubmit:s(r.filters.setValues),children:c(a.Group,{className:"dashboard-filters",position:"apart",noWrap:!0,sx:d?{}:{border:"1px solid #e9ecef",borderRadius:"4px",padding:"16px"},children:[n(a.Group,{align:"flex-start",children:l.map(h=>n(x.Controller,{name:h.key,control:i,render:({field:m})=>n(Gi,{filter:h,value:m.value,onChange:g(h,m.onChange)})},h.id))}),!d&&n(a.Group,{sx:{alignSelf:"flex-end"},children:n(a.Button,{color:"blue",size:"sm",type:"submit",disabled:f,children:"Search"})})]})})}),K1="";function jo(e){return e?["<p><br></p>","<p></p>"].includes(e):!0}const qi=T.observer(()=>{const{freezeLayout:e}=b.useContext(Ke),[t,r]=b.useState(!1),{panel:i}=Ce();return b.useEffect(()=>{e(t)},[t]),jo(i.description)?null:c(V,{children:[n(a.Modal,{opened:t,onClose:()=>r(!1),title:i.title,withCloseButton:!1,withinPortal:!0,zIndex:310,children:n(Ft,{value:i.description,styles:{root:{border:"none"},content:{padding:0}}})}),n(a.Tooltip,{label:"Click to see description",position:"top-start",withinPortal:!0,children:n(a.ActionIcon,{variant:"subtle",color:"blue",onClick:()=>r(s=>!s),sx:{verticalAlign:"baseline",cursor:"pointer"},children:n(k.InfoCircle,{size:20})})})]})}),Yo=T.observer(({view:e})=>{const t=ce(),r=Y(),i=Le.useModals(),{panel:s}=Ce(),{id:o,query:u}=s,{inEditMode:l}=b.useContext(Ke),d=()=>u==null?void 0:u.fetchData(),{viewPanelInFullScreen:p,inFullScreen:f}=b.useContext(yn),g=()=>{r.duplicatePanelByID(o,e.id)},h=()=>{t.editor.open(["_VIEWS_",e.id,"_PANELS_",o])},m=()=>i.openConfirmModal({title:"Delete this panel?",labels:{confirm:"Confirm",cancel:"Cancel"},onCancel:()=>console.log("Cancel"),onConfirm:()=>r.removePanelByID(o,e.id),confirmProps:{color:"red"},zIndex:320}),w=b.useCallback(()=>{p(o)},[o,p]),C=!f&&e.type!==K.Modal;return n(V,{children:n(a.Box,{sx:{position:"absolute",top:0,left:0,right:0,zIndex:300},children:c(a.Menu,{withinPortal:!0,children:[n(a.Menu.Target,{children:n(a.Box,{className:"panel-dropdown-target",sx:{width:"100%",height:"25px"}})}),c(a.Menu.Dropdown,{children:[n(a.Menu.Item,{onClick:d,icon:n(k.Refresh,{size:14}),children:"Refresh"}),n(a.Menu.Item,{onClick:()=>r.queries.downloadDataByQueryID((u==null?void 0:u.id)??""),icon:n(k.Download,{size:14}),children:"Download Data"}),C&&n(a.Menu.Item,{onClick:w,icon:n(k.ArrowsMaximize,{size:14}),disabled:l,children:"Full Screen"}),l&&c(V,{children:[n(a.Divider,{label:"Edit",labelPosition:"center"}),n(a.Menu.Item,{onClick:h,icon:n(k.Settings,{size:14}),children:"Settings"}),n(a.Menu.Item,{onClick:g,icon:n(k.Copy,{size:14}),children:"Duplicate"}),n(a.Menu.Item,{color:"red",onClick:m,icon:n(k.Trash,{size:14}),children:"Delete"})]})]})]})})})}),J1="",Ro=T.observer(function(){const{panel:t}=Ce(),{title:r}=t;return r?n(a.Group,{grow:!0,position:"center",px:20,className:"panel-title-wrapper",sx:{flexGrow:1},children:n(a.Text,{align:"center",lineClamp:1,weight:"bold",children:r})}):null}),Ne=(e,t)=>{const[r,i]=b.useState([]);return b.useEffect(()=>e.watchTriggerSnapshotList(s=>i(s.filter(o=>o.schemaRef===t))),[]),r};class lt{constructor(t,r){this.root=t,this.path=r}async deleteItem(t){t===null&&await this.root.deleteItem(this.path);const r=await this.root.getItem(this.path)||{};await this.root.setItem(this.path,v.omit(r,t))}async getItem(t){const r=await this.root.getItem(this.path);return t===null?r:v.get(r,t)}async setItem(t,r){if(t===null)await this.root.setItem(this.path,r);else{const i=await this.root.getItem(this.path)||{};await this.root.setItem(this.path,{...i,[t]:r})}return await this.getItem(t)}watchItem(t,r,i){return t===null?this.root.watchItem(this.path,(s,o)=>{r(s,o)},i):this.root.watchItem(this.path,(s,o)=>{const u=v.get(s,t),l=v.get(o,t);u!==l&&r(u,l)},i)}}class Sn{constructor(t,r,i){P(this,"attachmentStorage");this.instance=t,this.attachmentKey=r,this.constructInstance=i,this.attachmentStorage=new lt(t.instanceData,r)}async getInstance(t){if(await this.attachmentStorage.getItem(t))return this.constructInstance(new lt(this.attachmentStorage,t))}async create(t,r){return await this.attachmentStorage.setItem(t,r),this.constructInstance(new lt(this.attachmentStorage,t))}async remove(t){await this.attachmentStorage.deleteItem(t)}async list(){const t=await this.attachmentStorage.getItem(null);return Promise.all(v.values(t).map(r=>this.constructInstance(new lt(this.attachmentStorage,r.id))))}}class Wi{constructor(t){P(this,"rootRef");this.rootRef=ie.observable({current:t})}async deleteItem(t){ie.runInAction(()=>{v.unset(this.rootRef.current,[t])})}getItem(t){const r=this.getValueFromRoot(t);return Promise.resolve(r)}getValueFromRoot(t){return t===null?ie.toJS(this.rootRef.current):v.get(this.rootRef.current,[t])}setItem(t,r){if(t===null)if(v.isObject(r))ie.runInAction(()=>{this.rootRef.current=r});else throw new Error("Cannot set root value to non-object");else ie.runInAction(()=>{v.set(this.rootRef.current,[t],r)});return Promise.resolve(this.getItem(t))}watchItem(t,r,i){return ie.reaction(()=>this.getValueFromRoot(t),(s,o)=>{r(s,o)},{requiresObservable:!0,fireImmediately:v.get(i,"fireImmediately",!1)})}}class Qo{constructor(){P(this,"channels",new Map);P(this,"globalChannel",new Ii)}getChannel(t){const r=this.channels.get(t);if(r)return r;const i=new Ii;return this.channels.set(t,i),i}}class Uo{constructor(t){P(this,"instances",new Map);this.pluginManager=t}get availableVizList(){return this.pluginManager.installedPlugins.flatMap(t=>t.manifest.viz)}resolveComponent(t){return this.pluginManager.factory.viz(t)}getOrCreateInstance(t){const r=this.instances.get(t.id);if(r)return r;const i={id:t.id,name:t.viz.type,type:t.viz.type,messageChannels:new Qo,instanceData:new Wi(t.viz.conf)};return this.instances.set(t.id,i),i}}function ji(e,t,r,i){return{vizManager:r,locale:"zh",msgChannels:e.messageChannels,instanceData:e.instanceData,pluginData:new Wi({}),colorPalette:{getColor(){return()=>""}},data:t,variables:i}}const Xo=e=>{const{panel:t,vizManager:r,data:i,variables:s}=e,o=r.resolveComponent(t.viz.type),u=r.getOrCreateInstance(t),l={...ji(u,i,r,s),viewport:{width:t.layout.w,height:t.layout.h}},d=o.viewRender;return n(d,{context:l,instance:u,...v.omit(e,["panel","vizManager","data"])})},Zo=e=>{const{vizManager:t,panel:r,panelInfoEditor:i,data:s,variables:o}=e,u=t.resolveComponent(r.viz.type),l=t.getOrCreateInstance(r),d={...ji(l,s,t,o),panelInfoEditor:i},p=u.configRender;return n(p,{context:d,instance:l,...v.omit(e,["panel","vizManager","data","panelInfoEditor"])})},Yi=(e,t)=>{const r=je.bezier(e),i=je.bezier(t);return function(s){return s<50?r(s*2/100).hex():i((s-50)*2/100).hex()}},qt=e=>{const t=je.bezier(e);return function(r){return t(r/100).hex()}},Ko={type:"interpolation",displayName:"Red / Green",getColor:Yi(["darkred","deeppink","lightyellow"],["lightyellow","lightgreen","teal"]),name:"red-green",category:"diverging"},Jo={type:"interpolation",displayName:"Yellow / Blue",getColor:Yi(["#8f531d","#ffd347","#e3efe3"],["#eefaee","#4ecbbf","#003f94"]),name:"yellow-blue",category:"diverging"},Ho={type:"interpolation",displayName:"Red",getColor:qt(["#fff7f1","darkred"]),name:"red",category:"sequential"},el={type:"interpolation",displayName:"Green",getColor:qt(["#f0ffed","darkgreen"]),name:"green",category:"sequential"},tl={type:"interpolation",displayName:"Blue",getColor:qt(["#f9fcff","#48b3e9","darkblue"]),name:"blue",category:"sequential"},nl={type:"interpolation",displayName:"Orange",getColor:qt(["#fff7f1","darkorange","#b60000"]),name:"orange",category:"sequential"},Ri="@devtable/dashboard",Tn="9.13.0",Qi="Apache-2.0",Ui={access:"public",registry:"https://registry.npmjs.org/"},Xi=["dist"],Zi="./dist/dashboard.umd.js",Ki="./dist/dashboard.es.js",Ji="./dist/index.d.ts",Hi={".":{import:"./dist/dashboard.es.js",require:"./dist/dashboard.umd.js"},"./dist/style.css":{import:"./dist/style.css",require:"./dist/style.css"}},ea={"dev-build":"tsc && vite build --watch",build:"tsc && vite build",preview:"vite preview",test:"vitest","test:ui":"vitest --ui",coverage:"vitest --coverage"},ta={"@monaco-editor/react":"4.4.6","@types/chroma-js":"^2.1.4","file-saver":"2.0.5",mathjs:"11.8.0","monaco-editor":"0.36.0","performant-array-to-tree":"1.11.0",popmotion:"^11.0.3","rc-select":"14.1.0","rc-tree-select":"5.5.5",reactflow:"^11.5.3"},na={"@emotion/babel-plugin":"11.10.6","@faker-js/faker":"7.6.0","@mantine/core":"5.9.5","@mantine/dates":"5.9.5","@mantine/hooks":"5.9.5","@mantine/modals":"5.9.5","@mantine/notifications":"5.9.5","@mantine/prism":"5.9.5","@mantine/tiptap":"5.9.5","@tabler/icons":"1.119.0","@testing-library/cypress":"^9.0.0","@testing-library/jest-dom":"^5.16.4","@testing-library/react":"^13.3.0","@testing-library/react-hooks":"^8.0.1","@testing-library/user-event":"^14.3.0","@tiptap/extension-code-block-lowlight":"2.0.3","@tiptap/extension-color":"2.0.3","@tiptap/extension-highlight":"2.0.3","@tiptap/extension-link":"2.0.3","@tiptap/extension-placeholder":"2.0.3","@tiptap/extension-subscript":"2.0.3","@tiptap/extension-superscript":"2.0.3","@tiptap/extension-table":"2.0.3","@tiptap/extension-table-cell":"2.0.3","@tiptap/extension-table-header":"2.0.3","@tiptap/extension-table-row":"2.0.3","@tiptap/extension-text-align":"2.0.3","@tiptap/extension-text-style":"2.0.3","@tiptap/extension-underline":"2.0.3","@tiptap/pm":"2.0.3","@tiptap/react":"2.0.3","@tiptap/starter-kit":"2.0.3","@types/crypto-js":"v4.1.1","@types/d3-array":"3.0.4","@types/eventemitter2":"^4.1.0","@types/file-saver":"2.0.5","@types/lodash":"^4.14.182","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","@types/react-grid-layout":"^1.3.2",ahooks:"^3.3.11",ajv:"8.12.0",axios:"^0.27.2","crypto-js":"^4.1.1",cypress:"^12.9.0","cypress-wait-until":"^1.7.2",echarts:"^5.3.2","echarts-for-react":"^3.0.2","echarts-gl":"^2.0.9",jsdom:"^20.0.0","jsdom-testing-mocks":"^1.5.0",lodash:"^4.17.21",lowlight:"^2.8.0",numbro:"^2.3.6","prosemirror-commands":"^1.5.0","prosemirror-dropcursor":"^1.6.1","prosemirror-gapcursor":"^1.3.1","prosemirror-history":"^1.3.0","prosemirror-keymap":"^1.2.0","prosemirror-schema-list":"^1.2.2","react-grid-layout":"^1.3.4","react-hook-form":"^7.31.2","rollup-plugin-visualizer":"5.6.0","tabler-icons-react":"^1.48.0",typescript:"^4.6.3","vite-plugin-static-copy":"0.13.1"},ra={"@emotion/react":"11.10.6","@faker-js/faker":"7.6.0","@mantine/core":"5.9.5","@mantine/dates":"5.9.5","@mantine/hooks":"5.9.5","@mantine/modals":"5.9.5","@mantine/notifications":"5.9.5","@mantine/prism":"5.9.5","@mantine/tiptap":"5.9.5","@tabler/icons":"1.119.0","@tanstack/react-table":"^8.5.13","@tiptap/extension-code-block-lowlight":"2.0.3","@tiptap/extension-color":"2.0.3","@tiptap/extension-highlight":"2.0.3","@tiptap/extension-link":"2.0.3","@tiptap/extension-placeholder":"2.0.3","@tiptap/extension-subscript":"2.0.3","@tiptap/extension-superscript":"2.0.3","@tiptap/extension-table":"2.0.3","@tiptap/extension-table-cell":"2.0.3","@tiptap/extension-table-header":"2.0.3","@tiptap/extension-table-row":"2.0.3","@tiptap/extension-text-align":"2.0.3","@tiptap/extension-text-style":"2.0.3","@tiptap/extension-underline":"2.0.3","@tiptap/pm":"2.0.3","@tiptap/react":"2.0.3","@tiptap/starter-kit":"2.0.3",ahooks:"^3.3.11",axios:"^0.27.2","chroma-js":"^2.4.2","crypto-js":"^4.1.1","d3-array":"3.2.3","d3-regression":"1.3.10",dayjs:"1.11.7",echarts:"^5.3.2","echarts-for-react":"^3.0.2","echarts-gl":"^2.0.9",eventemitter2:"^6.4.6",jszip:"3.10.1",lodash:"^4.17.21",lowlight:"^2.8.0",mobx:"^6.6.1","mobx-react-lite":"^3.4.0","mobx-state-tree":"^5.1.5",numbro:"^2.3.6","prosemirror-commands":"^1.5.0","prosemirror-dropcursor":"^1.6.1","prosemirror-gapcursor":"^1.3.1","prosemirror-history":"^1.3.0","prosemirror-keymap":"^1.2.0","prosemirror-schema-list":"^1.2.2",react:"^16.8.0 || 17.x || 18.x","react-dom":"^16.8.0 || 17.x || 18.x","react-grid-layout":"^1.3.4","react-hook-form":"^7.31.2","react-router-dom":"^6.3.0","react-virtual":"^2.10.4","tabler-icons-react":"^1.48.0"},rl=Object.freeze(Object.defineProperty({__proto__:null,default:{name:Ri,version:Tn,license:Qi,publishConfig:Ui,files:Xi,main:Zi,module:Ki,types:Ji,exports:Hi,scripts:ea,dependencies:ta,devDependencies:na,peerDependencies:ra},dependencies:ta,devDependencies:na,exports:Hi,files:Xi,license:Qi,main:Zi,module:Ki,name:Ri,peerDependencies:ra,publishConfig:Ui,scripts:ea,types:Ji,version:Tn},Symbol.toStringTag,{value:"Module"}));class il{constructor(t){P(this,"staticColors",new Map);P(this,"interpolations",new Map);t.installedPlugins.forEach(r=>{r.manifest.color.forEach(i=>{this.register(i)})})}getStaticColors(){return Array.from(this.staticColors.values())}register(t){const r=this.encodeColor(t);t.type==="single"?(this.staticColors.has(r)&&console.warn(`the color '${t.name}' has been registered under '${t.category}', previous registered value will be overridden`),this.staticColors.set(r,t)):t.type==="interpolation"&&(this.interpolations.has(r)&&console.warn(`the interpolation '${t.name}' has been registered under '${t.category}', previous registered value will be overridden`,`the interpolation '${t.name}' has been registered under '${t.category}', previous registered value will be overridden`),this.interpolations.set(r,t))}decodeStaticColor(t){return this.staticColors.get(t)}encodeColor(t){return`\${${t.category}}.{${t.name}}`}decodeInterpolation(t){return this.interpolations.get(t)}getColorInterpolations(){return Array.from(this.interpolations.values())}}class al{constructor(){P(this,"plugins",new Map);P(this,"vizComponents",new Map);P(this,"factory",{viz:t=>{const r=this.vizComponents.get(t);if(r)return r;throw new Error(`Viz Component (${t}) not found`)}})}install(t){if(this.plugins.has(t.id))throw new Error(`Plugin (${t.id}) has been installed before`);this.plugins.set(t.id,t);for(const r of t.manifest.viz){if(this.vizComponents.has(r.name))throw new Error(`Viz Component (${r.name}) has been installed before`);this.vizComponents.set(r.name,r)}}get installedPlugins(){return Array.from(this.plugins.values())}}class sl{constructor(){P(this,"migrations",[])}version(t,r){return this.migrations.push({version:t,handler:r}),this}run(t,r,i){var u;if(t.from===t.to)return r;if(t.from>t.to)throw new Error(`Can not downgrade from version '${t.from}' to (${t.to})`);const s=this.migrations.filter(l=>l.version>t.from&&l.version<=t.to),o=v.orderBy(s,"version","asc");if(((u=v.last(o))==null?void 0:u.version)!==t.to)throw new Error(`Migration to version ${t.to} not found`);return o.reduce((l,d)=>d.handler(l,i),r)}}class fe extends sl{constructor(){super(),this.configVersions()}version(t,r){return super.version(t,(i,s)=>({version:t,...r(i,s)}))}async migrate({configData:t,panelModel:r}){const i=await t.getItem(null),s=v.get(i,"version",0),o=this.run({from:s,to:this.VERSION},i,{panelModel:r});await t.setItem(null,o)}async needMigration({configData:t}){const r=await t.getItem(null);return v.get(r,"version",0)<this.VERSION}}const W=(e,t)=>{const[r,{setFalse:i}]=Z.useBoolean(!0),[s,o]=b.useState();b.useEffect(()=>(e.getItem(t).then(l=>{o(l),i()}),e.watchItem(t,l=>{o(l)})));const u=b.useCallback(async l=>{await e.setItem(t,l),o(l)},[e,t]);return{loading:r,value:s,set:u}},kn={x_axis_data_key:"",y_axis_data_key:"",z_axis_data_key:"",xAxis3D:{type:"value",name:"X Axis Name"},yAxis3D:{type:"value",name:"Y Axis Name"},zAxis3D:{type:"value",name:"Z Axis Name"}};le.use([N.GridComponent,N.VisualMapComponent,N.LegendComponent,N.TooltipComponent,Me.CanvasRenderer]);function ol({context:e}){const{value:t}=W(e.instanceData,"config"),r=e.data,{width:i,height:s}=e.viewport,{x_axis_data_key:o,y_axis_data_key:u,z_axis_data_key:l,xAxis3D:d,yAxis3D:p,zAxis3D:f}=v.defaults({},t,kn),g=b.useMemo(()=>{const w=v.minBy(r,C=>C[l]);return v.get(w,l)},[r,l]),h=b.useMemo(()=>{const w=v.maxBy(r,C=>C[l]);return v.get(w,l)},[r,l]),m={tooltip:{},backgroundColor:"#fff",visualMap:{show:!0,dimension:2,min:g,max:h,inRange:{color:["#313695","#4575b4","#74add1","#abd9e9","#e0f3f8","#ffffbf","#fee090","#fdae61","#f46d43","#d73027","#a50026"]}},xAxis3D:d,yAxis3D:p,zAxis3D:f,grid3D:{viewControl:{projection:"orthographic",autoRotate:!1},light:{main:{shadow:!0,quality:"ultra",intensity:1.5}}},series:[{type:"bar3D",wireframe:{},data:r.map(w=>[w[o],w[u],w[l]])}]};return t?n(Ae,{echarts:le,option:m,style:{width:i,height:s},notMerge:!0,theme:"merico-light"}):null}function ll({label:e,required:t,value:r,onChange:i,data:s,clearable:o=!1,sx:u,...l},d){const p=b.useMemo(()=>{if(!Array.isArray(s)||s.length===0)return[];const g=Object.keys(s[0]).map(h=>({label:h,value:h}));return o?g.concat([{label:"unset",value:""}]):g},[s]);return n(a.Select,{ref:d,label:e,data:p,value:r,onChange:i,required:t,sx:u,...l})}const q=b.forwardRef(ll);function ul({context:e}){const{value:t,set:r}=W(e.instanceData,"config"),i=e.data,s=v.defaults({},t,kn),{control:o,handleSubmit:u,reset:l}=x.useForm({defaultValues:s});return b.useEffect(()=>{l(s)},[t]),t?n(a.Stack,{spacing:"xs",children:c("form",{onSubmit:u(r),children:[n(a.Text,{children:"X Axis"}),c(a.Group,{position:"apart",grow:!0,p:"md",sx:{position:"relative",border:"1px solid #eee"},children:[n(x.Controller,{name:"x_axis_data_key",control:o,render:({field:d})=>n(q,{label:"Data Field",required:!0,data:i,...d})}),n(x.Controller,{name:"xAxis3D.name",control:o,render:({field:d})=>n(a.TextInput,{sx:{flexGrow:1},size:"md",label:"Name",...d})})]}),n(a.Text,{mt:"lg",children:"Y Axis"}),c(a.Group,{position:"apart",grow:!0,p:"md",sx:{position:"relative",border:"1px solid #eee"},children:[n(x.Controller,{name:"y_axis_data_key",control:o,render:({field:d})=>n(q,{label:"Data Field",required:!0,data:i,...d})}),n(x.Controller,{name:"yAxis3D.name",control:o,render:({field:d})=>n(a.TextInput,{sx:{flexGrow:1},size:"md",label:"Name",...d})})]}),n(a.Text,{mt:"lg",children:"Z Axis"}),c(a.Group,{position:"apart",grow:!0,p:"md",sx:{position:"relative",border:"1px solid #eee"},children:[n(x.Controller,{name:"z_axis_data_key",control:o,render:({field:d})=>n(q,{label:"Data Field",required:!0,data:i,...d})}),n(x.Controller,{name:"zAxis3D.name",control:o,render:({field:d})=>n(a.TextInput,{sx:{flexGrow:1},size:"md",label:"Name",...d})})]}),n(a.Group,{position:"center",mt:"xl",grow:!0,sx:{width:"60%"},mx:"auto",children:c(a.Button,{color:"blue",type:"submit",children:[n(k.DeviceFloppy,{size:20}),n(a.Text,{ml:"md",children:"Save"})]})})]})}):null}class dl extends fe{constructor(){super(...arguments);P(this,"VERSION",1)}configVersions(){this.version(1,r=>({version:1,config:r}))}}const cl={displayName:"Bar Chart (3D)",displayGroup:"ECharts-based charts",migrator:new dl,name:"bar-3d",viewRender:ol,configRender:ul,createConfig(){return{version:1,config:v.cloneDeep(kn)}}},Se={mantissa:0,output:"number",trimMantissa:!1,average:!1};function pl({value:e,onChange:t},r){const i=l=>{t({...e,output:l})},s=l=>{const d=l===0?!1:e.trimMantissa;t({...e,mantissa:l,trimMantissa:d})},o=l=>{t({...e,trimMantissa:l.currentTarget.checked})},u=l=>{t({...e,average:l.currentTarget.checked})};return c(a.Stack,{ref:r,children:[c(a.Group,{grow:!0,children:[n(a.Select,{label:"Format",data:[{label:"1234",value:"number"},{label:"99%",value:"percent"}],value:e.output,onChange:i,sx:{flexGrow:1}}),n(a.Switch,{label:c(a.Stack,{spacing:0,children:[n(a.Text,{children:"Average"}),n(a.Text,{size:12,color:"gray",children:"like 1.234k, 1.234m"})]}),checked:e.average,onChange:u,disabled:e.output!=="number",sx:{flexGrow:1},styles:{root:{alignSelf:"flex-end"},body:{alignItems:"center"},label:{display:"block"}}})]}),c(a.Group,{grow:!0,children:[n(a.NumberInput,{label:"Mantissa",defaultValue:0,min:0,step:1,max:4,value:e.mantissa,onChange:s}),n(a.Switch,{label:"Trim mantissa",checked:e.trimMantissa,onChange:o,disabled:e.mantissa===0,styles:{root:{alignSelf:"flex-end"},body:{alignItems:"center"}}})]}),c(a.Stack,{spacing:0,children:[n(a.Text,{weight:"bold",children:"Preview"}),n(ke,{children:c(a.Group,{position:"apart",children:[c(a.Text,{size:12,color:"gray",children:["123456789 ",n(k.ArrowRight,{size:9})," ",H(123456789).format(e)]}),c(a.Text,{size:12,color:"gray",children:["1234 ",n(k.ArrowRight,{size:9})," ",H(1234).format(e)]}),c(a.Text,{size:12,color:"gray",children:["0.1234 ",n(k.ArrowRight,{size:9})," ",H(.1234).format(e)]})]})})]})]})}const Oe=b.forwardRef(pl),Ge={enabled:!1,func_content:["function label(value, index) {"," // your code goes here"," // return value","}"].join(`
27
+ Check the top-level render call using <`+E+">.")}return M}}function so(_,M){{if(!_._store||_._store.validated||_.key!=null)return;_._store.validated=!0;var E=F1(M);if(ao[E])return;ao[E]=!0;var R="";_&&_._owner&&_._owner!==ui.current&&(R=" It was passed a child from "+oe(_._owner.type)+"."),bt(_),$('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',E,R),bt(null)}}function oo(_,M){{if(typeof _!="object")return;if(oi(_))for(var E=0;E<_.length;E++){var R=_[E];ci(R)&&so(R,M)}else if(ci(_))_._store&&(_._store.validated=!0);else if(_){var se=S(_);if(typeof se=="function"&&se!==_.entries)for(var ue=se.call(_),te;!(te=ue.next()).done;)ci(te.value)&&so(te.value,M)}}}function q1(_){{var M=_.type;if(M==null||typeof M=="string")return;var E;if(typeof M=="function")E=M.propTypes;else if(typeof M=="object"&&(M.$$typeof===d||M.$$typeof===g))E=M.propTypes;else return;if(E){var R=oe(M);I1(E,_.props,"prop",R,_)}else if(M.PropTypes!==void 0&&!di){di=!0;var se=oe(M);$("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",se||"Unknown")}typeof M.getDefaultProps=="function"&&!M.getDefaultProps.isReactClassApproved&&$("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function W1(_){{for(var M=Object.keys(_.props),E=0;E<M.length;E++){var R=M[E];if(R!=="children"&&R!=="key"){bt(_),$("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",R),bt(null);break}}_.ref!==null&&(bt(_),$("Invalid attribute `ref` supplied to `React.Fragment`."),bt(null))}}function lo(_,M,E,R,se,ue){{var te=Q(_);if(!te){var J="";(_===void 0||typeof _=="object"&&_!==null&&Object.keys(_).length===0)&&(J+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ie=G1(se);Ie?J+=Ie:J+=io();var me;_===null?me="null":oi(_)?me="array":_!==void 0&&_.$$typeof===t?(me="<"+(oe(_.type)||"Unknown")+" />",J=" Did you accidentally export a JSX literal instead of a component?"):me=typeof _,$("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",me,J)}var ye=N1(_,M,E,se,ue);if(ye==null)return ye;if(te){var Ee=M.children;if(Ee!==void 0)if(R)if(oi(Ee)){for(var yt=0;yt<Ee.length;yt++)oo(Ee[yt],_);Object.freeze&&Object.freeze(Ee)}else $("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else oo(Ee,_)}return _===i?W1(ye):q1(ye),ye}}function j1(_,M,E){return lo(_,M,E,!0)}function Y1(_,M,E){return lo(_,M,E,!1)}var R1=Y1,Q1=j1;wt.Fragment=i,wt.jsx=R1,wt.jsxs=Q1}()),wt}(function(e){process.env.NODE_ENV==="production"?e.exports=wo():e.exports=_o()})(Co);const V=xt.Fragment,n=xt.jsx,c=xt.jsxs;function zi(e,t){b.useEffect(()=>{const r=i=>{console.log(i);const{viewID:s}=i.detail;if(!s){console.error(new Error("[Open View] Needs to pick a view first"));return}e.views.appendToVisibles(s),t&&e.views.setIDOfVIE(s)};return window.addEventListener("open-view",r),()=>{window.removeEventListener("open-view",r)}},[e,t]),b.useEffect(()=>{const r=i=>{console.log(i);const{dictionary:s,payload:o}=i.detail;if(!o||Object.keys(o).length===0){console.error(new Error("[Set Filter Values] payload is empty"));return}Object.entries(s).forEach(([u,l])=>{e.filters.setValueByKey(u,v.get(o,l))})};return window.addEventListener("set-filter-values",r),()=>{window.removeEventListener("set-filter-values",r)}},[e]),b.useEffect(()=>{function r(s){return Array.isArray(s)?[]:typeof s=="object"?{}:typeof s=="boolean"?!1:typeof s=="string"?"":typeof s=="number"?0:s}const i=s=>{console.log(s);const{filter_keys:o}=s.detail;o.forEach(u=>{const l=v.get(e.filters.values,u),d=r(l);console.log(`${u}: ${d}`),e.filters.setValueByKey(u,d)})};return window.addEventListener("clear-filter-values",i),()=>{window.removeEventListener("clear-filter-values",i)}},[e]),b.useEffect(()=>{const r=i=>{console.log(i);const{urlTemplate:s,openInNewTab:o,enableEncoding:u=!1,payload:l}=i.detail;if(!s){console.error(new Error("[Open Link] URL is empty"));return}function d(g){return v.cloneDeepWith(g,m=>{if(u&&typeof m=="string")return encodeURIComponent(m)})}const f=v.template(s||"")(d({...l,filters:e.payloadForSQL.filterValues,context:e.payloadForSQL.context}));window.open(f,o?"_blank":"_self","noopener")};return window.addEventListener("open-link",r),()=>{window.removeEventListener("open-link",r)}},[e])}class So{constructor(t){P(this,"symbol");this.symbol=Symbol(t)}}function Ye(e){return new So(e)}class mn{constructor(){P(this,"parent");P(this,"factoryRegistry",new Map);P(this,"instanceRegistry",new Map)}createScoped(){const t=new mn;return t.parent=this,t}getRequired(t){return this.get(t)}get(t){if(this.instanceRegistry.has(t.symbol))return this.instanceRegistry.get(t.symbol);const r=this.factoryRegistry.get(t.symbol);if(r){const i=r(this);return this.instanceRegistry.set(t.symbol,i),i}if(this.parent)return this.parent.get(t)}provideFactory(t,r){return this.factoryRegistry.has(t.symbol)?console.warn(`Token ${t.symbol.toString()} is already registered`):this.factoryRegistry.set(t.symbol,r),this}provideValue(t,r){return this.factoryRegistry.has(t.symbol)?console.warn(`Token ${t.symbol.toString()} is already registered`):this.factoryRegistry.set(t.symbol,()=>r),this}dispose(){this.instanceRegistry.forEach(t=>{const r=v.get(t,"dispose");v.isFunction(r)&&r.bind(t)()}),this.instanceRegistry.clear(),this.factoryRegistry.clear()}}const bn=b.createContext(null);function Gt(e){const t=b.useContext(bn),r=Z.useCreation(()=>e.configure(t||new mn),[e.configure]),i=Z.usePrevious(r);return i&&i!==r&&i.dispose(),n(bn.Provider,{value:r,children:e.children})}function Ei(){return b.useContext(bn)}const To={viewPanelInFullScreen:v.noop,inFullScreen:!1},yn=b.createContext(To),Li=b.createContext(null),vn=Li.Provider;function ce(){const e=b.useContext(Li);if(!e)throw new Error("Please use ModelContextProvider");return e}const Pi=b.createContext(null),xn=Pi.Provider;function Y(){const e=b.useContext(Pi);if(!e)throw new Error("Please use ContentModelContextProvider");return e}const ko={layoutFrozen:!1,freezeLayout:v.noop,inEditMode:!1},Ke=b.createContext(ko),Oi=b.createContext({panel:null,data:[],loading:!1}),Cn=Oi.Provider;function Ce(){const e=b.useContext(Oi);if(!e.panel)throw new Error("Please use PanelContextProvider");return e}const Do={fullScreenPanelID:"",setFullScreenPanelID:v.noop},wn=b.createContext(Do);function Vi(){const e=b.useContext(wn);if(!e)throw new Error("Please use FullScreenPanelContext.Provider");return e}class ke extends b.Component{constructor(t){super(t),this.state={error:null}}componentDidCatch(t){this.setState({error:t})}render(){var t;if(this.state.error){const r=()=>{this.setState({error:null})};return c(a.Box,{children:[n(a.Text,{size:"xs",children:(t=this.state.error)==null?void 0:t.message}),n(a.Button,{variant:"subtle",size:"xs",mx:"auto",compact:!0,sx:{display:"block"},onClick:r,children:"Retry"})]})}return this.props.children}}const _n={fontSize:"14px",lineHeight:"32px",color:"#3D3E45",ul:{paddingLeft:"2em",margin:"6px 0 0"},p:{margin:0},a:{WebkitTapHighlightColor:"transparent",color:"rgb(34, 139, 230)",textDecoration:"none","&:hover":{textDecoration:"underline"},"&:active, &:hover":{outlineWidth:0}},table:{tr:{"th, td":{padding:"0 .5em"}}},"table.rich-text-table-render, div.tableWrapper table":{"th, td":{border:"1px solid #eaeaea"},"tr:last-of-type td":{borderBottom:"1px solid #eaeaea"}},".resize-cursor":{cursor:"col-resize"},details:{summary:{listStyle:"none",cursor:"pointer",transition:"color 300ms ease",userSelect:"none"},"summary::-webkit-details-marker":{display:"none"},"summary:hover":{color:"black","&::before":{opacity:1}},"summary::before":{content:'"►"',fontSize:"10px",margin:"0px 5px",opacity:.5,display:"inline-block",transition:"opacity 300ms ease, transform 300ms ease"}},"details[open] summary::before":{transform:"rotate(90deg)"},"details + details":{marginTop:"10px"}},Ft=({value:e,styles:t={}})=>{const r=Si.useEditor({extensions:[Ti,_i,X.Link,mi,gi,hi,vi.configure({resizable:!1,HTMLAttributes:{class:"rich-text-table-render"}}),wi,Ci,xi,bi.configure({types:["heading","paragraph"]}),fi.configure({placeholder:"This is placeholder"}),yi,pi.Color],content:e,editable:!1});b.useEffect(()=>{r==null||r.commands.setContent(e)},[e,r]);const i=b.useMemo(()=>v.defaultsDeep({},{content:_n},t),[t]);return n(X.RichTextEditor,{editor:r,styles:i,children:n(X.RichTextEditor.Content,{})})},Io=({description:e,isDescriptionEmpty:t})=>t?null:n(a.Tooltip,{color:"white",label:n(Ft,{value:e,styles:{root:{border:"none"},content:{padding:0}}}),styles:{tooltip:{border:"0.0625rem solid rgb(233, 236, 239)",boxShadow:"rgb(0 0 0 / 5%) 0px 0.0625rem 0.1875rem, rgb(0 0 0 / 5%) 0px 1.25rem 1.5625rem -0.3125rem, rgb(0 0 0 / 4%) 0px 0.625rem 0.625rem -0.3125rem"}},withArrow:!0,children:n(a.Box,{sx:{height:"16px",alignSelf:"center"},children:n(O.IconInfoCircle,{size:16,color:"gray"})})}),Mo=T.observer(({label:e,config:{default_value:t,description:r,isDescriptionEmpty:i,...s},value:o,onChange:u})=>c(a.Box,{children:[n(a.Text,{children:" "}),n(a.Checkbox,{label:c(a.Group,{noWrap:!0,position:"apart",align:"middle",spacing:6,children:[n(a.Box,{sx:{flexGrow:1},children:e}),n(Io,{description:r,isDescriptionEmpty:i})]}),checked:o||!1,onChange:l=>u(l.currentTarget.checked),...s,pt:".4em",styles:{input:{borderColor:"#e9ecef"}}})]})),Bi=T.observer(({label:e,config:t,value:r=[null,null],onChange:i})=>{const s=Array.isArray(r)?r.map(d=>d?j(d).toDate():null):[null,null],o=d=>{i(d.map(p=>p&&j(p).format(t.inputFormat)))},u=t.getMinDate(s[0]),l=t.getMaxDate(s[0]);return n(co.DateRangePicker,{label:e,value:s,onChange:o,icon:n(k.Calendar,{size:16}),sx:{minWidth:"16em"},minDate:u,maxDate:l,styles:{input:{borderColor:"#e9ecef"}},...t})}),Ao=a.createStyles((e,{radius:t=4})=>({root:{borderRadius:e.fn.radius(t),display:"flex",flexWrap:"nowrap",border:"1px solid #ced4da",paddingLeft:"0px",paddingRight:"30px",backgroundColor:"#fff",transition:"border-color 100ms ease",borderColor:"#e9ecef","&.rc-select.rc-select-open":{borderColor:"#228be6 !important",".rc-select-selection-overflow-item-rest":{display:"none"},".rc-select-selection-overflow-item-suffix":{display:"block"}},".rc-select-selector":{height:"auto",lineHeight:1.55,paddingLeft:"12px",resize:"none",boxSizing:"border-box",fontSize:"14px",width:"100%",color:"#000",display:"block",textAlign:"left",minHeight:"36px",cursor:"pointer",flexGrow:1},".rc-select-selection-search-mirror":{display:"none"},".rc-select-selection-search":{flexGrow:1,width:"auto !important"},".rc-select-selection-overflow":{display:"flex",minHeight:"34px",alignItems:"center",flexWrap:"nowrap",marginLeft:"calc(-10px / 2)",boxSizing:"border-box"},".rc-select-selection-overflow-item":{display:"flex",alignItems:"center",backgroundColor:"#f1f3f5",color:"#495057",height:"24px",paddingLeft:"12px",paddingRight:"12px",fontWeight:500,fontSize:"12px",borderRadius:"4px",cursor:"default",userSelect:"none",maxWidth:"calc(100% - 20px)",margin:"calc(10px / 2 - 2px) calc(10px / 2)"},".rc-select-selection-overflow-item-rest":{cursor:"pointer"},".rc-select-selection-overflow-item-suffix":{display:"none",backgroundColor:"transparent",width:"100%",maxWidth:"100%",height:"28px",margin:0,paddingLeft:0,paddingRight:0},input:{flex:1,minWidth:"60px",backgroundColor:"transparent",border:0,outline:0,fontSize:"14px",padding:0,marginLeft:0,color:"inherit",height:"28px",lineHeight:"32px",cursor:"pointer",width:"100%","&::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration":{display:"none"}},".rc-select-clear":{marginRight:"-24px",alignSelf:"center",cursor:"pointer"},"&.rc-select-disabled":{backgroundColor:"rgb(241, 243, 245)",color:"rgb(144, 146, 150)",opacity:.6,"&, .rc-select-selector, input":{cursor:"not-allowed"}}},label:{fontSize:e.fontSizes.sm,fontWeight:500,color:"#212529"},dropdown:{fontSize:e.fontSizes.xs,zIndex:300,backgroundColor:"#fff",border:"1px solid #e9ecef",marginTop:6,padding:0,boxShadow:"0 1px 3px rgb(0 0 0 / 5%), rgb(0 0 0 / 5%) 0px 10px 15px -5px, rgb(0 0 0 / 4%) 0px 7px 7px -5px",borderRadius:"4px","&.rc-select-dropdown-slide-up-leave-active":{display:"none"},".rc-select-item-empty":{padding:"8px 12px"},".rc-select-item-option":{boxSizing:"border-box",textAlign:"left",width:"100%",padding:"8px 12px 8px 2px",cursor:"pointer",fontSize:"14px",color:"#000",borderRadius:"4px",display:"flex",flexWrap:"nowrap",overflow:"hidden","&:hover":{backgroundColor:"#f1f3f5"},flexDirection:"row-reverse",".rc-select-item-option-state":{flexGrow:0,flexShrink:0,width:"30px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},".rc-select-item-option-content":{flexGrow:1}}}})),Ni=({errorMessage:e})=>e?n(a.Text,{color:"red",size:12,children:e}):n(a.Text,{color:"dimmed",size:12,children:"Not found"}),$o=({disabled:e,classNames:t,styles:r,unstyled:i,radius:s,style:o,label:u,value:l,onChange:d,options:p,errorMessage:f})=>{const{classes:g,cx:h}=Ao({radius:s},{name:"MultiSelectWidget",classNames:t,styles:r,unstyled:i}),[m,w]=b.useState(!1),C=B=>{w(B)},S=m&&(l==null?void 0:l.length)>0,[I,$]=b.useState(""),G=b.useMemo(()=>{if(!I)return p;const B=I.toLowerCase(),L=z=>{var A;return((A=z.description)==null?void 0:A.toLowerCase().includes(B))||z.label.toLowerCase().includes(B)};return p.filter(L)},[I,p]);return c(a.Stack,{spacing:3,children:[c(a.Group,{position:"apart",children:[n(a.Text,{className:g.label,children:u}),S&&n(a.Tooltip,{label:`${l.length} selected`,children:n(a.Badge,{children:l.length})})]}),n(ki,{disabled:e,allowClear:!0,className:h(g.root,"check-select"),dropdownClassName:h(g.dropdown,""),onDropdownVisibleChange:C,transitionName:"rc-select-dropdown-slide-up",choiceTransitionName:"rc-select-selection__choice-zoom",style:o,clearIcon:()=>n(a.CloseButton,{}),value:l,onChange:d,onSelect:console.log,mode:"multiple",maxTagCount:0,notFoundContent:n(Ni,{errorMessage:f}),maxTagTextLength:10,maxTagPlaceholder:B=>`${B.length} selected`,searchValue:I,onSearch:$,filterOption:!1,children:G.map(B=>n(ki.Option,{children:n(a.Group,{noWrap:!0,children:c("div",{children:[n(a.Text,{size:"sm","data-role":"label",children:B.label}),n(a.Text,{size:"xs",color:"dimmed","data-role":"description",children:B.description})]})})},B.value))})]})},zo=T.observer(({label:e,config:t,value:r,onChange:i})=>{const s=Y(),o=!!t.options_query_id,{state:u,error:l}=s.getDataStuffByID(t.options_query_id),d=u==="loading",p=t.min_width?t.min_width:"200px",f=o?d:!1,g=h=>i(h,!1);return n($o,{label:e,options:t.options,style:{minWidth:"160px",width:p,maxWidth:f?p:"unset",borderColor:"#e9ecef"},disabled:f,value:r,onChange:g,errorMessage:l})}),Eo=b.forwardRef(({label:e,description:t,...r},i)=>n("div",{ref:i,...r,children:n(a.Group,{noWrap:!0,children:c("div",{children:[n(a.Text,{size:"sm","data-role":"label",children:e}),n(a.Text,{size:"xs",color:"dimmed","data-role":"description",children:t})]})})})),Lo=T.observer(({label:e,config:t,value:r,onChange:i})=>{const s=Y(),o=!!t.options_query_id,{state:u,error:l}=s.getDataStuffByID(t.options_query_id),d=u==="loading";return b.useEffect(()=>{var g;const{default_selection_count:p}=t;if(!p)return;const f=((g=t.options[0])==null?void 0:g.value)??"";console.log("Selecting the first option by default. New value: ",f),i(f,!0)},[t.default_selection_count,t.options]),n(a.Select,{label:e,data:t.options,disabled:o?d:!1,value:r,onChange:i,error:!!l,placeholder:l,maxDropdownHeight:500,styles:{root:{width:t.width?t.width:"200px"},input:{borderColor:"#e9ecef"}},sx:{".mantine-Select-item[data-selected] .mantine-Text-root[data-role=description]":{color:"rgba(255,255,255,.7)"}},itemComponent:Eo})});function Po({label:e,config:t,value:r,onChange:i}){return n(a.TextInput,{label:e,value:r||"",onChange:s=>i(s.currentTarget.value),...t,styles:{input:{borderColor:"#e9ecef"}}})}const Oo=({rotate:e,onClick:t})=>n("svg",{onClick:t,className:"caret-icon",viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"14px",height:"14px",fill:"currentColor","aria-hidden":"true",transform:`rotate(${e})`,children:n("path",{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"})}),Vo=({expanded:e,isLeaf:t,value:r,onClick:i,...s})=>(r==="0-0-value"&&console.log(s),t?n("span",{style:{width:"14px",display:"inline-block"}}):n(Oo,{rotate:e?"0":"-90",onClick:i,...s})),Bo=({onClick:e})=>c("svg",{onClick:e,className:"checkbox-icon",width:"16",height:"16",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[n("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),n("rect",{className:"border",x:"4",y:"4",width:"16",height:"16",rx:"2"}),n("rect",{className:"checkmark-indeterminate",x:"8",y:"8",width:"8",height:"8",rx:"2",stroke:"none"}),n("path",{className:"checkmark-checked",d:"M9 12l2 2l4 -4"})]}),No=({onClick:e,...t})=>n(Bo,{onClick:e,...t}),Go=a.createStyles((e,{radius:t=4})=>({root:{borderRadius:e.fn.radius(t),display:"flex",flexWrap:"nowrap",border:"1px solid #ced4da",paddingLeft:"0px",paddingRight:"30px",backgroundColor:"#fff",transition:"border-color 100ms ease",borderColor:"#e9ecef","&.rc-tree-select.rc-tree-select-open":{borderColor:"#228be6 !important",".rc-tree-select-selection-overflow-item-rest":{display:"none"},".rc-tree-select-selection-overflow-item-suffix":{display:"block"}},".rc-tree-select-selector":{height:"auto",lineHeight:1.55,paddingLeft:"12px",resize:"none",boxSizing:"border-box",fontSize:"14px",width:"100%",color:"#000",display:"block",textAlign:"left",minHeight:"36px",cursor:"pointer",flexGrow:1},".rc-tree-select-selection-search-mirror":{display:"none"},".rc-tree-select-selection-search":{flexGrow:1,width:"auto !important"},".rc-tree-select-selection-overflow":{display:"flex",minHeight:"34px",alignItems:"center",flexWrap:"nowrap",marginLeft:"calc(-10px / 2)",boxSizing:"border-box"},".rc-tree-select-selection-overflow-item":{display:"flex",alignItems:"center",backgroundColor:"#f1f3f5",color:"#495057",height:"24px",paddingLeft:"12px",paddingRight:"12px",fontWeight:500,fontSize:"12px",borderRadius:"4px",cursor:"default",userSelect:"none",maxWidth:"calc(100% - 20px)",margin:"calc(10px / 2 - 2px) calc(10px / 2)"},".rc-tree-select-selection-overflow-item-rest":{cursor:"pointer"},".rc-tree-select-selection-overflow-item-suffix":{display:"none",backgroundColor:"transparent",width:"100%",maxWidth:"100%",height:"28px",margin:0,paddingLeft:0,paddingRight:0},input:{flex:1,minWidth:"60px",backgroundColor:"transparent",border:0,outline:0,fontSize:"14px",padding:0,marginLeft:0,color:"inherit",height:"28px",lineHeight:"32px",cursor:"pointer",width:"100%","&::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration":{display:"none"}},".rc-tree-select-clear":{marginRight:"-24px",alignSelf:"center",cursor:"pointer"},"&.rc-tree-select-disabled":{backgroundColor:"rgb(241, 243, 245)",color:"rgb(144, 146, 150)",opacity:.6,"&, .rc-tree-select-selector, input":{cursor:"not-allowed"}}},label:{fontSize:e.fontSizes.sm,fontWeight:500,color:"#212529"},dropdown:{fontSize:e.fontSizes.xs,zIndex:300,paddingTop:"6px","&.rc-tree-select-dropdown-slide-up-leave-active":{display:"none"},".rc-tree-select-tree-list .rc-tree-select-tree-list-holder":{},".rc-tree-select-tree-list, .rc-tree-select-empty":{backgroundColor:"#fff",border:"1px solid #e9ecef",padding:0,boxShadow:"0 1px 3px rgb(0 0 0 / 5%), rgb(0 0 0 / 5%) 0px 10px 15px -5px, rgb(0 0 0 / 4%) 0px 7px 7px -5px",borderRadius:"4px"},".rc-tree-select-empty":{padding:"8px 12px"},".rc-tree-select-tree-treenode":{boxSizing:"border-box",textAlign:"left",width:"100%",padding:"8px 12px",cursor:"pointer",fontSize:"14px",color:"#000",borderRadius:"4px",display:"flex",flexWrap:"nowrap",overflow:"hidden","&:hover":{backgroundColor:"#f1f3f5"},"&.rc-tree-select-tree-treenode-checkbox-checked":{".rc-tree-select-tree-iconEle .checkbox-icon .checkmark-checked":{stroke:"rgb(64, 192, 87)",animation:"check 200ms linear forwards"}},"&.rc-tree-select-tree-treenode-checkbox-indeterminate":{".rc-tree-select-tree-iconEle .checkbox-icon .checkmark-indeterminate":{fill:"rgb(64, 192, 87)"}},".rc-tree-select-tree-switcher":{height:"16px",alignSelf:"center",paddingRight:"2px",transition:"color 200ms ease","&:hover":{color:"#228be6","svg.caret-icon":{color:"#228be6"}},"svg.caret-icon":{color:"#ced4da",transition:"all 200ms ease"}},".rc-tree-select-tree-node-content-wrapper":{display:"flex",flexWrap:"nowrap",overflow:"hidden",alignItems:"center",gap:"8px",transition:"color 200ms ease","&:hover":{color:"#228be6"}},".rc-tree-select-tree-iconEle":{height:"16px","svg .border":{stroke:"#ced4da"},".checkbox-icon .checkmark-indeterminate":{fill:"transparent",transition:"fill 200ms ease"},".checkbox-icon .checkmark-checked":{transform:"scale(1.2)",transformOrigin:"center center",strokeDasharray:10,strokeDashoffset:-10},"@keyframes check":{"0%":{strokeDashoffset:10},"100%":{strokeDashoffset:0}}},".rc-tree-select-tree-title":{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",".rc-tree-select-tree-title-desc":{fontSize:"12px",maxWidth:"100%",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}},".rc-tree-select-tree-indent":{flexGrow:0,height:0,verticalAlign:"bottom"},".rc-tree-select-tree-indent-unit":{display:"inline-block",width:"1em"}}}})),Fo=({disabled:e,classNames:t,styles:r,unstyled:i,radius:s,style:o,label:u,value:l,onChange:d,treeData:p,errorMessage:f})=>{const{classes:g,cx:h}=Go({radius:s},{name:"FilterTreeSelectWidget",classNames:t,styles:r,unstyled:i}),[m,w]=b.useState(!1),C=I=>{w(I)},S=m&&(l==null?void 0:l.length)>0;return c(a.Stack,{spacing:3,children:[c(a.Group,{position:"apart",children:[n(a.Text,{className:g.label,children:u}),S&&n(a.Tooltip,{label:`${l.length} selected`,children:n(a.Badge,{children:l.length})})]}),n(Di,{disabled:e,allowClear:!0,className:h(g.root,"check-select"),dropdownClassName:h(g.dropdown,""),onDropdownVisibleChange:C,transitionName:"rc-tree-select-dropdown-slide-up",choiceTransitionName:"rc-tree-select-selection__choice-zoom",style:o,treeLine:!0,clearIcon:()=>n(a.CloseButton,{}),switcherIcon:Vo,treeIcon:No,maxTagTextLength:10,value:l,treeData:p,notFoundContent:n(Ni,{errorMessage:f}),treeNodeFilterProp:"filterBasis",treeCheckable:!0,showCheckedStrategy:Di.SHOW_PARENT,onChange:d,onSelect:console.log,maxTagCount:0,maxTagPlaceholder:I=>`${I.length} selected`})]})},qo=T.observer(({label:e,config:t,value:r,onChange:i})=>{const{treeData:s,treeDataLoading:o,errorMessage:u}=t,l=t.min_width?t.min_width:"200px",p=!!t.options_query_id?o:!1;return n(Fo,{disabled:p,style:{minWidth:"160px",width:l,maxWidth:p?l:"unset",borderColor:"#e9ecef"},value:r,onChange:f=>i(f,!1),treeData:s,errorMessage:u,label:e})}),Wo=T.observer(({filter:{type:e,config:t,key:r,...i},formFieldProps:s})=>{switch(e){case"select":return n(Lo,{...i,...s,config:t});case"multi-select":return n(zo,{...i,...s,config:t});case"tree-select":return n(qo,{...i,...s,config:t});case"text-input":return n(Po,{...i,...s,config:t});case"date-range":return n(Bi,{...i,...s,config:t});case"checkbox":return n(Mo,{...i,...s,config:t});default:return null}}),Gi=T.observer(b.forwardRef(({filter:e,...t},r)=>n("div",{className:"filter-root",ref:r,children:n(ke,{children:n(Wo,{filter:e,formFieldProps:t})})}))),Fi=T.observer(function({view:t}){const r=Y(),{control:i,handleSubmit:s,reset:o}=x.useForm({defaultValues:r.filters.values,reValidateMode:"onBlur"}),u=x.useWatch({control:i});b.useEffect(()=>{o(r.filters.values)},[r.filters.values,o]),b.useEffect(()=>{r.filters.updatePreviewValues(u)},[u]);const l=r.filters.visibleInView(t.id),d=b.useMemo(()=>l.every(h=>h.should_auto_submit),[l]),p=b.useMemo(()=>l.filter(h=>v.get(h,"config.required",!1)),[l]),f=b.useMemo(()=>p.length===0?!1:p.some(h=>!h.requiredAndPass(u[h.key])),[u,p]);if(l.length===0)return null;const g=(h,m)=>(w,C)=>{m(w),(h.should_auto_submit||C)&&r.filters.setValueByKey(h.key,w)};return n("form",{onSubmit:s(r.filters.setValues),children:c(a.Group,{className:"dashboard-filters",position:"apart",noWrap:!0,sx:d?{}:{border:"1px solid #e9ecef",borderRadius:"4px",padding:"16px"},children:[n(a.Group,{align:"flex-start",children:l.map(h=>n(x.Controller,{name:h.key,control:i,render:({field:m})=>n(Gi,{filter:h,value:m.value,onChange:g(h,m.onChange)})},h.id))}),!d&&n(a.Group,{sx:{alignSelf:"flex-end"},children:n(a.Button,{color:"blue",size:"sm",type:"submit",disabled:f,children:"Search"})})]})})}),K1="";function jo(e){return e?["<p><br></p>","<p></p>"].includes(e):!0}const qi=T.observer(()=>{const{freezeLayout:e}=b.useContext(Ke),[t,r]=b.useState(!1),{panel:i}=Ce();return b.useEffect(()=>{e(t)},[t]),jo(i.description)?null:c(V,{children:[n(a.Modal,{opened:t,onClose:()=>r(!1),title:i.title,withCloseButton:!1,withinPortal:!0,zIndex:310,children:n(Ft,{value:i.description,styles:{root:{border:"none"},content:{padding:0}}})}),n(a.Tooltip,{label:"Click to see description",position:"top-start",withinPortal:!0,children:n(a.ActionIcon,{variant:"subtle",color:"blue",onClick:()=>r(s=>!s),sx:{verticalAlign:"baseline",cursor:"pointer"},children:n(k.InfoCircle,{size:20})})})]})}),Yo=T.observer(({view:e})=>{const t=ce(),r=Y(),i=Le.useModals(),{panel:s}=Ce(),{id:o,query:u}=s,{inEditMode:l}=b.useContext(Ke),d=()=>u==null?void 0:u.fetchData(),{viewPanelInFullScreen:p,inFullScreen:f}=b.useContext(yn),g=()=>{r.duplicatePanelByID(o,e.id)},h=()=>{t.editor.open(["_VIEWS_",e.id,"_PANELS_",o])},m=()=>i.openConfirmModal({title:"Delete this panel?",labels:{confirm:"Confirm",cancel:"Cancel"},onCancel:()=>console.log("Cancel"),onConfirm:()=>r.removePanelByID(o,e.id),confirmProps:{color:"red"},zIndex:320}),w=b.useCallback(()=>{p(o)},[o,p]),C=!f&&e.type!==K.Modal;return n(V,{children:n(a.Box,{sx:{position:"absolute",top:0,left:0,right:0,zIndex:300},children:c(a.Menu,{withinPortal:!0,children:[n(a.Menu.Target,{children:n(a.Box,{className:"panel-dropdown-target",sx:{width:"100%",height:"25px"}})}),c(a.Menu.Dropdown,{children:[n(a.Menu.Item,{onClick:d,icon:n(k.Refresh,{size:14}),children:"Refresh"}),n(a.Menu.Item,{onClick:()=>r.queries.downloadDataByQueryID((u==null?void 0:u.id)??""),icon:n(k.Download,{size:14}),children:"Download Data"}),C&&n(a.Menu.Item,{onClick:w,icon:n(k.ArrowsMaximize,{size:14}),disabled:l,children:"Full Screen"}),l&&c(V,{children:[n(a.Divider,{label:"Edit",labelPosition:"center"}),n(a.Menu.Item,{onClick:h,icon:n(k.Settings,{size:14}),children:"Settings"}),n(a.Menu.Item,{onClick:g,icon:n(k.Copy,{size:14}),children:"Duplicate"}),n(a.Menu.Item,{color:"red",onClick:m,icon:n(k.Trash,{size:14}),children:"Delete"})]})]})]})})})}),J1="",Ro=T.observer(function(){const{panel:t}=Ce(),{title:r}=t;return r?n(a.Group,{grow:!0,position:"center",px:20,className:"panel-title-wrapper",sx:{flexGrow:1},children:n(a.Text,{align:"center",lineClamp:1,weight:"bold",children:r})}):null}),Ne=(e,t)=>{const[r,i]=b.useState([]);return b.useEffect(()=>e.watchTriggerSnapshotList(s=>i(s.filter(o=>o.schemaRef===t))),[]),r};class lt{constructor(t,r){this.root=t,this.path=r}async deleteItem(t){t===null&&await this.root.deleteItem(this.path);const r=await this.root.getItem(this.path)||{};await this.root.setItem(this.path,v.omit(r,t))}async getItem(t){const r=await this.root.getItem(this.path);return t===null?r:v.get(r,t)}async setItem(t,r){if(t===null)await this.root.setItem(this.path,r);else{const i=await this.root.getItem(this.path)||{};await this.root.setItem(this.path,{...i,[t]:r})}return await this.getItem(t)}watchItem(t,r,i){return t===null?this.root.watchItem(this.path,(s,o)=>{r(s,o)},i):this.root.watchItem(this.path,(s,o)=>{const u=v.get(s,t),l=v.get(o,t);u!==l&&r(u,l)},i)}}class Sn{constructor(t,r,i){P(this,"attachmentStorage");this.instance=t,this.attachmentKey=r,this.constructInstance=i,this.attachmentStorage=new lt(t.instanceData,r)}async getInstance(t){if(await this.attachmentStorage.getItem(t))return this.constructInstance(new lt(this.attachmentStorage,t))}async create(t,r){return await this.attachmentStorage.setItem(t,r),this.constructInstance(new lt(this.attachmentStorage,t))}async remove(t){await this.attachmentStorage.deleteItem(t)}async list(){const t=await this.attachmentStorage.getItem(null);return Promise.all(v.values(t).map(r=>this.constructInstance(new lt(this.attachmentStorage,r.id))))}}class Wi{constructor(t){P(this,"rootRef");this.rootRef=ie.observable({current:t})}async deleteItem(t){ie.runInAction(()=>{v.unset(this.rootRef.current,[t])})}getItem(t){const r=this.getValueFromRoot(t);return Promise.resolve(r)}getValueFromRoot(t){return t===null?ie.toJS(this.rootRef.current):v.get(this.rootRef.current,[t])}setItem(t,r){if(t===null)if(v.isObject(r))ie.runInAction(()=>{this.rootRef.current=r});else throw new Error("Cannot set root value to non-object");else ie.runInAction(()=>{v.set(this.rootRef.current,[t],r)});return Promise.resolve(this.getItem(t))}watchItem(t,r,i){return ie.reaction(()=>this.getValueFromRoot(t),(s,o)=>{r(s,o)},{requiresObservable:!0,fireImmediately:v.get(i,"fireImmediately",!1)})}}class Qo{constructor(){P(this,"channels",new Map);P(this,"globalChannel",new Ii)}getChannel(t){const r=this.channels.get(t);if(r)return r;const i=new Ii;return this.channels.set(t,i),i}}class Uo{constructor(t){P(this,"instances",new Map);this.pluginManager=t}get availableVizList(){return this.pluginManager.installedPlugins.flatMap(t=>t.manifest.viz)}resolveComponent(t){return this.pluginManager.factory.viz(t)}getOrCreateInstance(t){const r=this.instances.get(t.id);if(r)return r;const i={id:t.id,name:t.viz.type,type:t.viz.type,messageChannels:new Qo,instanceData:new Wi(t.viz.conf)};return this.instances.set(t.id,i),i}}function ji(e,t,r,i){return{vizManager:r,locale:"zh",msgChannels:e.messageChannels,instanceData:e.instanceData,pluginData:new Wi({}),colorPalette:{getColor(){return()=>""}},data:t,variables:i}}const Xo=e=>{const{panel:t,vizManager:r,data:i,variables:s}=e,o=r.resolveComponent(t.viz.type),u=r.getOrCreateInstance(t),l={...ji(u,i,r,s),viewport:{width:t.layout.w,height:t.layout.h}},d=o.viewRender;return n(d,{context:l,instance:u,...v.omit(e,["panel","vizManager","data"])})},Zo=e=>{const{vizManager:t,panel:r,panelInfoEditor:i,data:s,variables:o}=e,u=t.resolveComponent(r.viz.type),l=t.getOrCreateInstance(r),d={...ji(l,s,t,o),panelInfoEditor:i},p=u.configRender;return n(p,{context:d,instance:l,...v.omit(e,["panel","vizManager","data","panelInfoEditor"])})},Yi=(e,t)=>{const r=je.bezier(e),i=je.bezier(t);return function(s){return s<50?r(s*2/100).hex():i((s-50)*2/100).hex()}},qt=e=>{const t=je.bezier(e);return function(r){return t(r/100).hex()}},Ko={type:"interpolation",displayName:"Red / Green",getColor:Yi(["darkred","deeppink","lightyellow"],["lightyellow","lightgreen","teal"]),name:"red-green",category:"diverging"},Jo={type:"interpolation",displayName:"Yellow / Blue",getColor:Yi(["#8f531d","#ffd347","#e3efe3"],["#eefaee","#4ecbbf","#003f94"]),name:"yellow-blue",category:"diverging"},Ho={type:"interpolation",displayName:"Red",getColor:qt(["#fff7f1","darkred"]),name:"red",category:"sequential"},el={type:"interpolation",displayName:"Green",getColor:qt(["#f0ffed","darkgreen"]),name:"green",category:"sequential"},tl={type:"interpolation",displayName:"Blue",getColor:qt(["#f9fcff","#48b3e9","darkblue"]),name:"blue",category:"sequential"},nl={type:"interpolation",displayName:"Orange",getColor:qt(["#fff7f1","darkorange","#b60000"]),name:"orange",category:"sequential"},Ri="@devtable/dashboard",Tn="9.14.1",Qi="Apache-2.0",Ui={access:"public",registry:"https://registry.npmjs.org/"},Xi=["dist"],Zi="./dist/dashboard.umd.js",Ki="./dist/dashboard.es.js",Ji="./dist/index.d.ts",Hi={".":{import:"./dist/dashboard.es.js",require:"./dist/dashboard.umd.js"},"./dist/style.css":{import:"./dist/style.css",require:"./dist/style.css"}},ea={"dev-build":"tsc && vite build --watch",build:"tsc && vite build",preview:"vite preview",test:"vitest","test:ui":"vitest --ui",coverage:"vitest --coverage"},ta={"@monaco-editor/react":"4.4.6","@types/chroma-js":"^2.1.4","file-saver":"2.0.5",mathjs:"11.8.0","monaco-editor":"0.36.0","performant-array-to-tree":"1.11.0",popmotion:"^11.0.3","rc-select":"14.1.0","rc-tree-select":"5.5.5",reactflow:"^11.5.3"},na={"@emotion/babel-plugin":"11.11.0","@faker-js/faker":"7.6.0","@mantine/core":"5.9.5","@mantine/dates":"5.9.5","@mantine/hooks":"5.9.5","@mantine/modals":"5.9.5","@mantine/notifications":"5.9.5","@mantine/prism":"5.9.5","@mantine/tiptap":"5.9.5","@tabler/icons":"1.119.0","@testing-library/cypress":"^9.0.0","@testing-library/jest-dom":"^5.16.4","@testing-library/react":"^13.3.0","@testing-library/react-hooks":"^8.0.1","@testing-library/user-event":"^14.3.0","@tiptap/extension-code-block-lowlight":"2.0.3","@tiptap/extension-color":"2.0.3","@tiptap/extension-highlight":"2.0.3","@tiptap/extension-link":"2.0.3","@tiptap/extension-placeholder":"2.0.3","@tiptap/extension-subscript":"2.0.3","@tiptap/extension-superscript":"2.0.3","@tiptap/extension-table":"2.0.3","@tiptap/extension-table-cell":"2.0.3","@tiptap/extension-table-header":"2.0.3","@tiptap/extension-table-row":"2.0.3","@tiptap/extension-text-align":"2.0.3","@tiptap/extension-text-style":"2.0.3","@tiptap/extension-underline":"2.0.3","@tiptap/pm":"2.0.3","@tiptap/react":"2.0.3","@tiptap/starter-kit":"2.0.3","@types/crypto-js":"v4.1.1","@types/d3-array":"3.0.4","@types/eventemitter2":"^4.1.0","@types/file-saver":"2.0.5","@types/lodash":"^4.14.182","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","@types/react-grid-layout":"^1.3.2",ahooks:"^3.3.11",ajv:"8.12.0",axios:"^0.27.2","crypto-js":"^4.1.1",cypress:"^12.9.0","cypress-wait-until":"^1.7.2",echarts:"^5.3.2","echarts-for-react":"^3.0.2","echarts-gl":"^2.0.9",jsdom:"^20.0.0","jsdom-testing-mocks":"^1.5.0",lodash:"^4.17.21",lowlight:"^2.8.0",numbro:"^2.3.6","prosemirror-commands":"^1.5.0","prosemirror-dropcursor":"^1.6.1","prosemirror-gapcursor":"^1.3.1","prosemirror-history":"^1.3.0","prosemirror-keymap":"^1.2.0","prosemirror-schema-list":"^1.2.2","react-grid-layout":"^1.3.4","react-hook-form":"^7.31.2","rollup-plugin-visualizer":"5.9.0","tabler-icons-react":"^1.48.0",typescript:"^4.6.3","vite-plugin-static-copy":"0.13.1"},ra={"@emotion/react":"11.10.6","@faker-js/faker":"7.6.0","@mantine/core":"5.9.5","@mantine/dates":"5.9.5","@mantine/hooks":"5.9.5","@mantine/modals":"5.9.5","@mantine/notifications":"5.9.5","@mantine/prism":"5.9.5","@mantine/tiptap":"5.9.5","@tabler/icons":"1.119.0","@tanstack/react-table":"^8.5.13","@tiptap/extension-code-block-lowlight":"2.0.3","@tiptap/extension-color":"2.0.3","@tiptap/extension-highlight":"2.0.3","@tiptap/extension-link":"2.0.3","@tiptap/extension-placeholder":"2.0.3","@tiptap/extension-subscript":"2.0.3","@tiptap/extension-superscript":"2.0.3","@tiptap/extension-table":"2.0.3","@tiptap/extension-table-cell":"2.0.3","@tiptap/extension-table-header":"2.0.3","@tiptap/extension-table-row":"2.0.3","@tiptap/extension-text-align":"2.0.3","@tiptap/extension-text-style":"2.0.3","@tiptap/extension-underline":"2.0.3","@tiptap/pm":"2.0.3","@tiptap/react":"2.0.3","@tiptap/starter-kit":"2.0.3",ahooks:"^3.3.11",axios:"^0.27.2","chroma-js":"^2.4.2","crypto-js":"^4.1.1","d3-array":"3.2.3","d3-regression":"1.3.10",dayjs:"1.11.7",echarts:"^5.3.2","echarts-for-react":"^3.0.2","echarts-gl":"^2.0.9",eventemitter2:"^6.4.6",jszip:"3.10.1",lodash:"^4.17.21",lowlight:"^2.8.0",mobx:"^6.6.1","mobx-react-lite":"^3.4.0","mobx-state-tree":"^5.1.5",numbro:"^2.3.6","prosemirror-commands":"^1.5.0","prosemirror-dropcursor":"^1.6.1","prosemirror-gapcursor":"^1.3.1","prosemirror-history":"^1.3.0","prosemirror-keymap":"^1.2.0","prosemirror-schema-list":"^1.2.2",react:"^16.8.0 || 17.x || 18.x","react-dom":"^16.8.0 || 17.x || 18.x","react-grid-layout":"^1.3.4","react-hook-form":"^7.31.2","react-router-dom":"^6.3.0","react-virtual":"^2.10.4","tabler-icons-react":"^1.48.0"},rl=Object.freeze(Object.defineProperty({__proto__:null,default:{name:Ri,version:Tn,license:Qi,publishConfig:Ui,files:Xi,main:Zi,module:Ki,types:Ji,exports:Hi,scripts:ea,dependencies:ta,devDependencies:na,peerDependencies:ra},dependencies:ta,devDependencies:na,exports:Hi,files:Xi,license:Qi,main:Zi,module:Ki,name:Ri,peerDependencies:ra,publishConfig:Ui,scripts:ea,types:Ji,version:Tn},Symbol.toStringTag,{value:"Module"}));class il{constructor(t){P(this,"staticColors",new Map);P(this,"interpolations",new Map);t.installedPlugins.forEach(r=>{r.manifest.color.forEach(i=>{this.register(i)})})}getStaticColors(){return Array.from(this.staticColors.values())}register(t){const r=this.encodeColor(t);t.type==="single"?(this.staticColors.has(r)&&console.warn(`the color '${t.name}' has been registered under '${t.category}', previous registered value will be overridden`),this.staticColors.set(r,t)):t.type==="interpolation"&&(this.interpolations.has(r)&&console.warn(`the interpolation '${t.name}' has been registered under '${t.category}', previous registered value will be overridden`,`the interpolation '${t.name}' has been registered under '${t.category}', previous registered value will be overridden`),this.interpolations.set(r,t))}decodeStaticColor(t){return this.staticColors.get(t)}encodeColor(t){return`\${${t.category}}.{${t.name}}`}decodeInterpolation(t){return this.interpolations.get(t)}getColorInterpolations(){return Array.from(this.interpolations.values())}}class al{constructor(){P(this,"plugins",new Map);P(this,"vizComponents",new Map);P(this,"factory",{viz:t=>{const r=this.vizComponents.get(t);if(r)return r;throw new Error(`Viz Component (${t}) not found`)}})}install(t){if(this.plugins.has(t.id))throw new Error(`Plugin (${t.id}) has been installed before`);this.plugins.set(t.id,t);for(const r of t.manifest.viz){if(this.vizComponents.has(r.name))throw new Error(`Viz Component (${r.name}) has been installed before`);this.vizComponents.set(r.name,r)}}get installedPlugins(){return Array.from(this.plugins.values())}}class sl{constructor(){P(this,"migrations",[])}version(t,r){return this.migrations.push({version:t,handler:r}),this}run(t,r,i){var u;if(t.from===t.to)return r;if(t.from>t.to)throw new Error(`Can not downgrade from version '${t.from}' to (${t.to})`);const s=this.migrations.filter(l=>l.version>t.from&&l.version<=t.to),o=v.orderBy(s,"version","asc");if(((u=v.last(o))==null?void 0:u.version)!==t.to)throw new Error(`Migration to version ${t.to} not found`);return o.reduce((l,d)=>d.handler(l,i),r)}}class fe extends sl{constructor(){super(),this.configVersions()}version(t,r){return super.version(t,(i,s)=>({version:t,...r(i,s)}))}async migrate({configData:t,panelModel:r}){const i=await t.getItem(null),s=v.get(i,"version",0),o=this.run({from:s,to:this.VERSION},i,{panelModel:r});await t.setItem(null,o)}async needMigration({configData:t}){const r=await t.getItem(null);return v.get(r,"version",0)<this.VERSION}}const W=(e,t)=>{const[r,{setFalse:i}]=Z.useBoolean(!0),[s,o]=b.useState();b.useEffect(()=>(e.getItem(t).then(l=>{o(l),i()}),e.watchItem(t,l=>{o(l)})));const u=b.useCallback(async l=>{await e.setItem(t,l),o(l)},[e,t]);return{loading:r,value:s,set:u}},kn={x_axis_data_key:"",y_axis_data_key:"",z_axis_data_key:"",xAxis3D:{type:"value",name:"X Axis Name"},yAxis3D:{type:"value",name:"Y Axis Name"},zAxis3D:{type:"value",name:"Z Axis Name"}};le.use([N.GridComponent,N.VisualMapComponent,N.LegendComponent,N.TooltipComponent,Me.CanvasRenderer]);function ol({context:e}){const{value:t}=W(e.instanceData,"config"),r=e.data,{width:i,height:s}=e.viewport,{x_axis_data_key:o,y_axis_data_key:u,z_axis_data_key:l,xAxis3D:d,yAxis3D:p,zAxis3D:f}=v.defaults({},t,kn),g=b.useMemo(()=>{const w=v.minBy(r,C=>C[l]);return v.get(w,l)},[r,l]),h=b.useMemo(()=>{const w=v.maxBy(r,C=>C[l]);return v.get(w,l)},[r,l]),m={tooltip:{},backgroundColor:"#fff",visualMap:{show:!0,dimension:2,min:g,max:h,inRange:{color:["#313695","#4575b4","#74add1","#abd9e9","#e0f3f8","#ffffbf","#fee090","#fdae61","#f46d43","#d73027","#a50026"]}},xAxis3D:d,yAxis3D:p,zAxis3D:f,grid3D:{viewControl:{projection:"orthographic",autoRotate:!1},light:{main:{shadow:!0,quality:"ultra",intensity:1.5}}},series:[{type:"bar3D",wireframe:{},data:r.map(w=>[w[o],w[u],w[l]])}]};return t?n(Ae,{echarts:le,option:m,style:{width:i,height:s},notMerge:!0,theme:"merico-light"}):null}function ll({label:e,required:t,value:r,onChange:i,data:s,clearable:o=!1,sx:u,...l},d){const p=b.useMemo(()=>{if(!Array.isArray(s)||s.length===0)return[];const g=Object.keys(s[0]).map(h=>({label:h,value:h}));return o?g.concat([{label:"unset",value:""}]):g},[s]);return n(a.Select,{ref:d,label:e,data:p,value:r,onChange:i,required:t,sx:u,...l})}const q=b.forwardRef(ll);function ul({context:e}){const{value:t,set:r}=W(e.instanceData,"config"),i=e.data,s=v.defaults({},t,kn),{control:o,handleSubmit:u,reset:l}=x.useForm({defaultValues:s});return b.useEffect(()=>{l(s)},[t]),t?n(a.Stack,{spacing:"xs",children:c("form",{onSubmit:u(r),children:[n(a.Text,{children:"X Axis"}),c(a.Group,{position:"apart",grow:!0,p:"md",sx:{position:"relative",border:"1px solid #eee"},children:[n(x.Controller,{name:"x_axis_data_key",control:o,render:({field:d})=>n(q,{label:"Data Field",required:!0,data:i,...d})}),n(x.Controller,{name:"xAxis3D.name",control:o,render:({field:d})=>n(a.TextInput,{sx:{flexGrow:1},size:"md",label:"Name",...d})})]}),n(a.Text,{mt:"lg",children:"Y Axis"}),c(a.Group,{position:"apart",grow:!0,p:"md",sx:{position:"relative",border:"1px solid #eee"},children:[n(x.Controller,{name:"y_axis_data_key",control:o,render:({field:d})=>n(q,{label:"Data Field",required:!0,data:i,...d})}),n(x.Controller,{name:"yAxis3D.name",control:o,render:({field:d})=>n(a.TextInput,{sx:{flexGrow:1},size:"md",label:"Name",...d})})]}),n(a.Text,{mt:"lg",children:"Z Axis"}),c(a.Group,{position:"apart",grow:!0,p:"md",sx:{position:"relative",border:"1px solid #eee"},children:[n(x.Controller,{name:"z_axis_data_key",control:o,render:({field:d})=>n(q,{label:"Data Field",required:!0,data:i,...d})}),n(x.Controller,{name:"zAxis3D.name",control:o,render:({field:d})=>n(a.TextInput,{sx:{flexGrow:1},size:"md",label:"Name",...d})})]}),n(a.Group,{position:"center",mt:"xl",grow:!0,sx:{width:"60%"},mx:"auto",children:c(a.Button,{color:"blue",type:"submit",children:[n(k.DeviceFloppy,{size:20}),n(a.Text,{ml:"md",children:"Save"})]})})]})}):null}class dl extends fe{constructor(){super(...arguments);P(this,"VERSION",1)}configVersions(){this.version(1,r=>({version:1,config:r}))}}const cl={displayName:"Bar Chart (3D)",displayGroup:"ECharts-based charts",migrator:new dl,name:"bar-3d",viewRender:ol,configRender:ul,createConfig(){return{version:1,config:v.cloneDeep(kn)}}},Se={mantissa:0,output:"number",trimMantissa:!1,average:!1};function pl({value:e,onChange:t},r){const i=l=>{t({...e,output:l})},s=l=>{const d=l===0?!1:e.trimMantissa;t({...e,mantissa:l,trimMantissa:d})},o=l=>{t({...e,trimMantissa:l.currentTarget.checked})},u=l=>{t({...e,average:l.currentTarget.checked})};return c(a.Stack,{ref:r,children:[c(a.Group,{grow:!0,children:[n(a.Select,{label:"Format",data:[{label:"1234",value:"number"},{label:"99%",value:"percent"}],value:e.output,onChange:i,sx:{flexGrow:1}}),n(a.Switch,{label:c(a.Stack,{spacing:0,children:[n(a.Text,{children:"Average"}),n(a.Text,{size:12,color:"gray",children:"like 1.234k, 1.234m"})]}),checked:e.average,onChange:u,disabled:e.output!=="number",sx:{flexGrow:1},styles:{root:{alignSelf:"flex-end"},body:{alignItems:"center"},label:{display:"block"}}})]}),c(a.Group,{grow:!0,children:[n(a.NumberInput,{label:"Mantissa",defaultValue:0,min:0,step:1,max:4,value:e.mantissa,onChange:s}),n(a.Switch,{label:"Trim mantissa",checked:e.trimMantissa,onChange:o,disabled:e.mantissa===0,styles:{root:{alignSelf:"flex-end"},body:{alignItems:"center"}}})]}),c(a.Stack,{spacing:0,children:[n(a.Text,{weight:"bold",children:"Preview"}),n(ke,{children:c(a.Group,{position:"apart",children:[c(a.Text,{size:12,color:"gray",children:["123456789 ",n(k.ArrowRight,{size:9})," ",H(123456789).format(e)]}),c(a.Text,{size:12,color:"gray",children:["1234 ",n(k.ArrowRight,{size:9})," ",H(1234).format(e)]}),c(a.Text,{size:12,color:"gray",children:["0.1234 ",n(k.ArrowRight,{size:9})," ",H(.1234).format(e)]})]})})]})]})}const Oe=b.forwardRef(pl),Ge={enabled:!1,func_content:["function label(value, index) {"," // your code goes here"," // return value","}"].join(`
28
28
  `)},ia={id:"builtin:echarts:click-echart:series",displayName:"Click Chart Series",nameRender:fl,configRender:hl,payload:[{name:"type",description:"Always 'click'",valueType:"string"},{name:"seriesType",description:"'boxplot'",valueType:"string"},{name:"name",description:"Name of the series clicked",valueType:"string"},{name:"color",description:"Color",valueType:"string"},{name:"value",description:"Record of 'name', 'min', 'q1', 'median', 'q3', 'max'",valueType:"object"},{name:"rowData",description:"Data of the row",valueType:"object"}]};function hl(e){return n(V,{})}function fl(e){return n(a.Text,{children:"Click chart's series"})}const gl=[{label:"Truncate",value:"truncate"},{label:"Break Line",value:"break"},{label:"Break Word",value:"breakAll"}],Wt=b.forwardRef(({sectionTitle:e,value:t,onChange:r},i)=>{const s=o=>u=>{const l=v.cloneDeep(t);v.set(l,o,u),r(l)};return c(a.Stack,{spacing:0,children:[e&&n(a.Divider,{mb:-5,mt:5,variant:"dotted",label:e,labelPosition:"right",labelProps:{color:"dimmed"}}),c(a.Group,{grow:!0,noWrap:!0,children:[n(a.NumberInput,{label:"Max Width",hideControls:!0,value:t.width,onChange:s("width")}),n(a.Select,{label:"Overflow",data:gl,value:t.overflow,onChange:s("overflow")}),n(a.TextInput,{label:"Ellipsis",value:t.ellipsis,disabled:!0})]})]})}),Je=b.forwardRef(({value:e,onChange:t},r)=>{const i=o=>{t({...e,on_axis:o})},s=o=>{t({...e,in_tooltip:o})};return c(a.Stack,{ref:r,spacing:0,children:[n(Wt,{sectionTitle:"Overflow on Axis",value:e.on_axis,onChange:i}),n(Wt,{sectionTitle:"Overflow in Tooltip",value:e.in_tooltip,onChange:s})]})}),Ve={on_axis:{width:80,overflow:"truncate",ellipsis:"..."},in_tooltip:{width:200,overflow:"break",ellipsis:"..."}};function He({overflow:e,width:t}){const r={truncate:"initial",break:"break-all",breakAll:"break-word"}[e],i=e==="truncate"?"nowrap":"initial",s={truncate:"ellipsis",break:"clip",breakAll:"clip"}[e];return`
29
29
  max-width: ${t}px;
30
30
  word-break: ${r};
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .panel-root{height:100%;width:100%;max-width:100%;background:transparent;border-radius:4px;position:relative}.panel-dropdown-target{text-align:center;transition:background-color .3s ease}.panel-dropdown-target:hover{cursor:pointer;background-color:#6464640d}.viz-root{width:100%;overflow:auto;flex-grow:1;background-color:#fff}.dashboard-layout{margin:5px}.react-grid-item{padding:0}.panel-grid-item{padding:5px;min-height:38px}.remove-panel{position:absolute;right:2px;top:0;cursor:pointer}.code-textarea textarea{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.preview-sql-in-monaco-editor{overflow:hidden}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;cursor:-webkit-grab;cursor:grab}.react-flow__pane.selection{cursor:pointer}.react-flow__pane.dragging{cursor:-webkit-grabbing;cursor:grabbing}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow .react-flow__edges{pointer-events:none;overflow:visible}.react-flow__edge-path,.react-flow__connection-path{stroke:#b1b1b7;stroke-width:1;fill:none}.react-flow__edge{pointer-events:visibleStroke;cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;-webkit-animation:dashdraw .5s linear infinite;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;-webkit-animation:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge:focus .react-flow__edge-path,.react-flow__edge:focus-visible .react-flow__edge-path{stroke:#555}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge-textbg{fill:#fff}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;-webkit-animation:dashdraw .5s linear infinite;animation:dashdraw .5s linear infinite}.react-flow__connectionline{z-index:1001}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:-webkit-grab;cursor:grab}.react-flow__node.dragging{cursor:-webkit-grabbing;cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:-webkit-grab;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background:#1a192b;border:1px solid white;border-radius:100%}.react-flow__handle.connectable{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:-4px;transform:translate(-50%)}.react-flow__handle-top{left:50%;top:-4px;transform:translate(-50%)}.react-flow__handle-left{top:50%;left:-4px;transform:translateY(-50%)}.react-flow__handle-right{right:-4px;top:50%;transform:translateY(-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.center{left:50%;transform:translate(-50%)}.react-flow__attribution{font-size:10px;background:rgba(255,255,255,.5);padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@-webkit-keyframes dashdraw{0%{stroke-dashoffset:10}}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-default,.react-flow__node-input,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:3px;width:150px;font-size:12px;color:#222;text-align:center;border-width:1px;border-style:solid;border-color:#1a192b;background-color:#fff}.react-flow__node-default.selectable:hover,.react-flow__node-input.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:0 1px 4px 1px #00000014}.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:0 0 0 .5px #1a192b}.react-flow__node-group{background-color:#f0f0f040}.react-flow__nodesselection-rect,.react-flow__selection{background:rgba(0,89,220,.08);border:1px dotted rgba(0,89,220,.8)}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls{box-shadow:0 0 2px 1px #00000014}.react-flow__controls-button{border:none;background:#fefefe;border-bottom:1px solid #eee;box-sizing:content-box;display:flex;justify-content:center;align-items:center;width:16px;height:16px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:5px}.react-flow__controls-button:hover{background:#f4f4f4}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px}.react-flow__minimap{background-color:#fff}.react-flow__node-interaction{padding:10px;border-radius:3px;width:150px;font-size:12px;color:#222;text-align:center;border-width:1px;border-style:solid;border-color:#1a192b;background-color:#fff}.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:0 0 12px 6px #ff0;border-style:dashed}.dashboard-root{overflow:auto;overflow-x:hidden;padding:0;height:100%}.dashboard-view{position:relative;height:100%;overflow-y:auto;overflow-x:hidden;-ms-overflow-style:initial!important}.dashboard-sticky-area{z-index:100;background:white;margin:0;padding:0 10px}.mantine-RichTextEditor-root{overflow-y:auto!important;-ms-overflow-style:initial!important}.dashboard-root *:not(.mantine-RichTextEditor-root):not(.dashboard-view):not(.mantine-Modal-body):not([data-enable-scrollbar])::-webkit-scrollbar{width:0!important;height:0!important}.dashboard-root *:not([data-enable-scrollbar]){overflow:-moz-scrollbars-none;-ms-overflow-style:none}.function-editor{border-radius:4px;overflow:hidden;background-color:#1e1e1e}.minimal-monaco-editor{border-radius:4px;overflow:hidden;background-color:#1e1e1e;padding-top:14px}
1
+ .panel-root{height:100%;width:100%;max-width:100%;background:transparent;border-radius:4px;position:relative}.panel-dropdown-target{text-align:center;transition:background-color .3s ease}.panel-dropdown-target:hover{cursor:pointer;background-color:#6464640d}.viz-root{width:100%;overflow:auto;flex-grow:1;background-color:#fff}.dashboard-layout{margin:5px}.react-grid-item{padding:0}.panel-grid-item{padding:5px;min-height:38px}.remove-panel{position:absolute;right:2px;top:0;cursor:pointer}.code-textarea textarea{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.preview-sql-in-monaco-editor{overflow:hidden}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;cursor:-webkit-grab;cursor:grab}.react-flow__pane.selection{cursor:pointer}.react-flow__pane.dragging{cursor:-webkit-grabbing;cursor:grabbing}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow .react-flow__edges{pointer-events:none;overflow:visible}.react-flow__edge-path,.react-flow__connection-path{stroke:#b1b1b7;stroke-width:1;fill:none}.react-flow__edge{pointer-events:visibleStroke;cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;-webkit-animation:dashdraw .5s linear infinite;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;-webkit-animation:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge:focus .react-flow__edge-path,.react-flow__edge:focus-visible .react-flow__edge-path{stroke:#555}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge-textbg{fill:#fff}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;-webkit-animation:dashdraw .5s linear infinite;animation:dashdraw .5s linear infinite}.react-flow__connectionline{z-index:1001}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:-webkit-grab;cursor:grab}.react-flow__node.dragging{cursor:-webkit-grabbing;cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:-webkit-grab;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background:#1a192b;border:1px solid white;border-radius:100%}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:-4px;transform:translate(-50%)}.react-flow__handle-top{left:50%;top:-4px;transform:translate(-50%)}.react-flow__handle-left{top:50%;left:-4px;transform:translateY(-50%)}.react-flow__handle-right{right:-4px;top:50%;transform:translateY(-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.center{left:50%;transform:translate(-50%)}.react-flow__attribution{font-size:10px;background:rgba(255,255,255,.5);padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@-webkit-keyframes dashdraw{0%{stroke-dashoffset:10}}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-default,.react-flow__node-input,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:3px;width:150px;font-size:12px;color:#222;text-align:center;border-width:1px;border-style:solid;border-color:#1a192b;background-color:#fff}.react-flow__node-default.selectable:hover,.react-flow__node-input.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:0 1px 4px 1px #00000014}.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:0 0 0 .5px #1a192b}.react-flow__node-group{background-color:#f0f0f040}.react-flow__nodesselection-rect,.react-flow__selection{background:rgba(0,89,220,.08);border:1px dotted rgba(0,89,220,.8)}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls{box-shadow:0 0 2px 1px #00000014}.react-flow__controls-button{border:none;background:#fefefe;border-bottom:1px solid #eee;box-sizing:content-box;display:flex;justify-content:center;align-items:center;width:16px;height:16px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:5px}.react-flow__controls-button:hover{background:#f4f4f4}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__minimap{background-color:#fff}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:4px;height:4px;border:1px solid #fff;border-radius:1px;background-color:#3367d9;transform:translate(-50%,-50%)}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:#3367d9;border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__node-interaction{padding:10px;border-radius:3px;width:150px;font-size:12px;color:#222;text-align:center;border-width:1px;border-style:solid;border-color:#1a192b;background-color:#fff}.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:0 0 12px 6px #ff0;border-style:dashed}.dashboard-root{overflow:auto;overflow-x:hidden;padding:0;height:100%}.dashboard-view{position:relative;height:100%;overflow-y:auto;overflow-x:hidden;-ms-overflow-style:initial!important}.dashboard-sticky-area{z-index:100;background:white;margin:0;padding:0 10px}.mantine-RichTextEditor-root{overflow-y:auto!important;-ms-overflow-style:initial!important}.dashboard-root *:not(.mantine-RichTextEditor-root):not(.dashboard-view):not(.mantine-Modal-body):not([data-enable-scrollbar])::-webkit-scrollbar{width:0!important;height:0!important}.dashboard-root *:not([data-enable-scrollbar]){overflow:-moz-scrollbars-none;-ms-overflow-style:none}.function-editor{border-radius:4px;overflow:hidden;background-color:#1e1e1e}.minimal-monaco-editor{border-radius:4px;overflow:hidden;background-color:#1e1e1e;padding-top:14px}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtable/dashboard",
3
- "version": "9.13.0",
3
+ "version": "9.14.1",
4
4
  "license": "Apache-2.0",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -43,7 +43,7 @@
43
43
  "reactflow": "^11.5.3"
44
44
  },
45
45
  "devDependencies": {
46
- "@emotion/babel-plugin": "11.10.6",
46
+ "@emotion/babel-plugin": "11.11.0",
47
47
  "@faker-js/faker": "7.6.0",
48
48
  "@mantine/core": "5.9.5",
49
49
  "@mantine/dates": "5.9.5",
@@ -105,7 +105,7 @@
105
105
  "prosemirror-schema-list": "^1.2.2",
106
106
  "react-grid-layout": "^1.3.4",
107
107
  "react-hook-form": "^7.31.2",
108
- "rollup-plugin-visualizer": "5.6.0",
108
+ "rollup-plugin-visualizer": "5.9.0",
109
109
  "tabler-icons-react": "^1.48.0",
110
110
  "typescript": "^4.6.3",
111
111
  "vite-plugin-static-copy": "0.13.1"