bi-sdk-react 0.0.64 → 0.0.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/es/js/bi-sdk.es.js
CHANGED
|
@@ -51,7 +51,7 @@ import*as e from"react";import t,{css as n}from"styled-components";import{AlignC
|
|
|
51
51
|
&:before {
|
|
52
52
|
content: "组件已隐藏";
|
|
53
53
|
}
|
|
54
|
-
`,ng=e=>{let{item:t,ancestors:n,onAddAt:r,onDelete:i,onCopy:a,onUpdate:o,onSelect:s}=e,[l,d]=(0,tk.useState)(JSON.stringify(t||{},null,2)),[h,p]=(0,tk.useState)(!1),f=(0,tk.useRef)(null),g=(0,tj.jsx)(em.Text,{children:t.name||t.type+`(${t.id})`});return(0,tj.jsxs)(tj.Fragment,{children:[(0,tj.jsx)(et,{title:`源码编辑(${t.name||t.type+`(${t.id})`})`,open:h,width:700,onCancel:()=>{p(!1),f.current=null},styles:{body:{margin:"0 -24px"}},footer:(0,tj.jsxs)(eu,{children:[(0,tj.jsx)(F,{onClick:()=>{p(!1),f.current=null},children:"取消"}),(0,tj.jsx)(F,{onClick:()=>{d(JSON.stringify(t||{},null,2))},children:"重置"}),(0,tj.jsx)(F,{onClick:()=>{var e,t;let n=null==(e=f.current)?void 0:e.editor;null==n||null==(t=n.getAction("editor.action.formatDocument"))||t.run()},children:"格式化"}),(0,tj.jsx)(F,{type:"primary",onClick:()=>{p(!1),Object.assign(t,JSON.parse(l)),o&&o()},children:"保存"})]}),children:(0,tj.jsx)(eb,{height:"400px",defaultLanguage:"json",value:l,onChange:e=>d(e||""),options:{minimap:{enabled:!1}},onMount:e=>{f.current={editor:e}}})}),(0,tj.jsxs)(np,{children:[(null==n?void 0:n.length)?(0,tj.jsx)(X,{placement:"topLeft",menu:{style:{borderRadius:0,padding:0,background:"none",boxShadow:"none"},items:n.map(e=>({label:(null==e?void 0:e.name)||(null==e?void 0:e.type)+`(${null==e?void 0:e.id})`,key:null==e?void 0:e.id,onClick:()=>{null==s||s(e)}}))},styles:{item:{borderRadius:2,background:"rgba(24, 144, 255, 0.8)",padding:"2px 8px",color:"#fff",fontSize:12,marginTop:2}},children:g}):g,r&&(0,tj.jsx)(ef,{title:"添加到对话",children:(0,tj.jsx)("a",{onClick:r,children:(0,tj.jsx)(nh,{type:"icon-number"})})}),(0,tj.jsx)(ef,{title:"源码编辑",children:(0,tj.jsx)("a",{onClick:()
|
|
54
|
+
`,ng=e=>{let{item:t,ancestors:n,onAddAt:r,onDelete:i,onCopy:a,onUpdate:o,onSelect:s}=e,[l,d]=(0,tk.useState)(JSON.stringify(t||{},null,2)),[h,p]=(0,tk.useState)(!1),f=(0,tk.useRef)(null),g=(0,tj.jsx)(em.Text,{children:t.name||t.type+`(${t.id})`});return(0,tj.jsxs)(tj.Fragment,{children:[(0,tj.jsx)(et,{title:`源码编辑(${t.name||t.type+`(${t.id})`})`,open:h,width:700,onCancel:()=>{p(!1),f.current=null},styles:{body:{margin:"0 -24px"}},footer:(0,tj.jsxs)(eu,{children:[(0,tj.jsx)(F,{onClick:()=>{p(!1),f.current=null},children:"取消"}),(0,tj.jsx)(F,{onClick:()=>{d(JSON.stringify(t||{},null,2))},children:"重置"}),(0,tj.jsx)(F,{onClick:()=>{var e,t;let n=null==(e=f.current)?void 0:e.editor;null==n||null==(t=n.getAction("editor.action.formatDocument"))||t.run()},children:"格式化"}),(0,tj.jsx)(F,{type:"primary",onClick:()=>{p(!1),Object.assign(t,JSON.parse(l)),o&&o()},children:"保存"})]}),children:(0,tj.jsx)(eb,{height:"400px",defaultLanguage:"json",value:l,onChange:e=>d(e||""),options:{minimap:{enabled:!1}},onMount:e=>{f.current={editor:e}}})}),(0,tj.jsxs)(np,{children:[(null==n?void 0:n.length)?(0,tj.jsx)(X,{placement:"topLeft",menu:{style:{borderRadius:0,padding:0,background:"none",boxShadow:"none"},items:n.map(e=>({label:(null==e?void 0:e.name)||(null==e?void 0:e.type)+`(${null==e?void 0:e.id})`,key:null==e?void 0:e.id,onClick:()=>{null==s||s(e)}}))},styles:{item:{borderRadius:2,background:"rgba(24, 144, 255, 0.8)",padding:"2px 8px",color:"#fff",fontSize:12,marginTop:2}},children:g}):g,r&&(0,tj.jsx)(ef,{title:"添加到对话",children:(0,tj.jsx)("a",{onClick:r,children:(0,tj.jsx)(nh,{type:"icon-number"})})}),(0,tj.jsx)(ef,{title:"源码编辑",children:(0,tj.jsx)("a",{onClick:e=>{e.stopPropagation(),p(!0)},children:(0,tj.jsx)(nh,{type:"icon-json"})})}),(0,tj.jsx)(ef,{title:"复制",children:(0,tj.jsx)("a",{onClick:a,children:(0,tj.jsx)(u,{})})}),(0,tj.jsx)(ef,{title:"删除",children:(0,tj.jsx)("a",{onClick:i,children:(0,tj.jsx)(c,{})})})]})]})},nm=e=>{var t,n,r;let{item:i,onCopy:a,onDelete:o,ancestors:s,parentList:l,onListChange:u,index:c}=e,{designable:d,selectedItem:h,setSelectedItem:p,plugins:f,onAddAtItem:g,onRemoveAtItem:m,forceUpdate:v,fetch:y,globalVars:x,env:_}=(0,tk.useContext)(tI),[b,w]=(0,tk.useState)(!1),[S,C]=(0,tk.useState)(null),j=e=>{e.stopPropagation(),et.confirm({title:"确认删除吗?",okText:"确认",cancelText:"取消",okType:"danger",onOk:()=>{o&&o(),m&&m(i)}})},k=e=>{e.stopPropagation(),a&&a(i)},T=e=>{e.stopPropagation(),g&&g(i)},I=null==(t=f.find(e=>e.key===i.type))?void 0:t.component,M=(0,tk.useMemo)(()=>{let e=i.hideExpression;if(!(null==e?void 0:e.length))return!1;try{return Function("$g","$e",`
|
|
55
55
|
"use strict";
|
|
56
56
|
const window = undefined;
|
|
57
57
|
const document = undefined;
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
&:before {
|
|
52
52
|
content: "组件已隐藏";
|
|
53
53
|
}
|
|
54
|
-
`,tc=e=>{let{item:t,ancestors:n,onAddAt:i,onDelete:r,onCopy:a,onUpdate:o,onSelect:s}=e,[l,u]=(0,eh.useState)(JSON.stringify(t||{},null,2)),[c,d]=(0,eh.useState)(!1),h=(0,eh.useRef)(null),p=(0,ed.jsx)(ti.Typography.Text,{children:t.name||t.type+`(${t.id})`});return(0,ed.jsxs)(ed.Fragment,{children:[(0,ed.jsx)(ti.Modal,{title:`源码编辑(${t.name||t.type+`(${t.id})`})`,open:c,width:700,onCancel:()=>{d(!1),h.current=null},styles:{body:{margin:"0 -24px"}},footer:(0,ed.jsxs)(ti.Space,{children:[(0,ed.jsx)(ti.Button,{onClick:()=>{d(!1),h.current=null},children:"取消"}),(0,ed.jsx)(ti.Button,{onClick:()=>{u(JSON.stringify(t||{},null,2))},children:"重置"}),(0,ed.jsx)(ti.Button,{onClick:()=>{var e,t;let n=null==(e=h.current)?void 0:e.editor;null==n||null==(t=n.getAction("editor.action.formatDocument"))||t.run()},children:"格式化"}),(0,ed.jsx)(ti.Button,{type:"primary",onClick:()=>{d(!1),Object.assign(t,JSON.parse(l)),o&&o()},children:"保存"})]}),children:(0,ed.jsx)(to.Editor,{height:"400px",defaultLanguage:"json",value:l,onChange:e=>u(e||""),options:{minimap:{enabled:!1}},onMount:e=>{h.current={editor:e}}})}),(0,ed.jsxs)(tl,{children:[(null==n?void 0:n.length)?(0,ed.jsx)(ti.Dropdown,{placement:"topLeft",menu:{style:{borderRadius:0,padding:0,background:"none",boxShadow:"none"},items:n.map(e=>({label:(null==e?void 0:e.name)||(null==e?void 0:e.type)+`(${null==e?void 0:e.id})`,key:null==e?void 0:e.id,onClick:()=>{null==s||s(e)}}))},styles:{item:{borderRadius:2,background:"rgba(24, 144, 255, 0.8)",padding:"2px 8px",color:"#fff",fontSize:12,marginTop:2}},children:p}):p,i&&(0,ed.jsx)(ti.Tooltip,{title:"添加到对话",children:(0,ed.jsx)("a",{onClick:i,children:(0,ed.jsx)(tn,{type:"icon-number"})})}),(0,ed.jsx)(ti.Tooltip,{title:"源码编辑",children:(0,ed.jsx)("a",{onClick:()
|
|
54
|
+
`,tc=e=>{let{item:t,ancestors:n,onAddAt:i,onDelete:r,onCopy:a,onUpdate:o,onSelect:s}=e,[l,u]=(0,eh.useState)(JSON.stringify(t||{},null,2)),[c,d]=(0,eh.useState)(!1),h=(0,eh.useRef)(null),p=(0,ed.jsx)(ti.Typography.Text,{children:t.name||t.type+`(${t.id})`});return(0,ed.jsxs)(ed.Fragment,{children:[(0,ed.jsx)(ti.Modal,{title:`源码编辑(${t.name||t.type+`(${t.id})`})`,open:c,width:700,onCancel:()=>{d(!1),h.current=null},styles:{body:{margin:"0 -24px"}},footer:(0,ed.jsxs)(ti.Space,{children:[(0,ed.jsx)(ti.Button,{onClick:()=>{d(!1),h.current=null},children:"取消"}),(0,ed.jsx)(ti.Button,{onClick:()=>{u(JSON.stringify(t||{},null,2))},children:"重置"}),(0,ed.jsx)(ti.Button,{onClick:()=>{var e,t;let n=null==(e=h.current)?void 0:e.editor;null==n||null==(t=n.getAction("editor.action.formatDocument"))||t.run()},children:"格式化"}),(0,ed.jsx)(ti.Button,{type:"primary",onClick:()=>{d(!1),Object.assign(t,JSON.parse(l)),o&&o()},children:"保存"})]}),children:(0,ed.jsx)(to.Editor,{height:"400px",defaultLanguage:"json",value:l,onChange:e=>u(e||""),options:{minimap:{enabled:!1}},onMount:e=>{h.current={editor:e}}})}),(0,ed.jsxs)(tl,{children:[(null==n?void 0:n.length)?(0,ed.jsx)(ti.Dropdown,{placement:"topLeft",menu:{style:{borderRadius:0,padding:0,background:"none",boxShadow:"none"},items:n.map(e=>({label:(null==e?void 0:e.name)||(null==e?void 0:e.type)+`(${null==e?void 0:e.id})`,key:null==e?void 0:e.id,onClick:()=>{null==s||s(e)}}))},styles:{item:{borderRadius:2,background:"rgba(24, 144, 255, 0.8)",padding:"2px 8px",color:"#fff",fontSize:12,marginTop:2}},children:p}):p,i&&(0,ed.jsx)(ti.Tooltip,{title:"添加到对话",children:(0,ed.jsx)("a",{onClick:i,children:(0,ed.jsx)(tn,{type:"icon-number"})})}),(0,ed.jsx)(ti.Tooltip,{title:"源码编辑",children:(0,ed.jsx)("a",{onClick:e=>{e.stopPropagation(),d(!0)},children:(0,ed.jsx)(tn,{type:"icon-json"})})}),(0,ed.jsx)(ti.Tooltip,{title:"复制",children:(0,ed.jsx)("a",{onClick:a,children:(0,ed.jsx)(te.CopyOutlined,{})})}),(0,ed.jsx)(ti.Tooltip,{title:"删除",children:(0,ed.jsx)("a",{onClick:r,children:(0,ed.jsx)(te.DeleteOutlined,{})})})]})]})},td=e=>{var t,n,i;let{item:r,onCopy:a,onDelete:o,ancestors:s,parentList:l,onListChange:u,index:c}=e,{designable:d,selectedItem:h,setSelectedItem:p,plugins:f,onAddAtItem:m,onRemoveAtItem:g,forceUpdate:v,fetch:y,globalVars:x,env:_}=(0,eh.useContext)(ev),[b,w]=(0,eh.useState)(!1),[S,C]=(0,eh.useState)(null),j=e=>{e.stopPropagation(),ti.Modal.confirm({title:"确认删除吗?",okText:"确认",cancelText:"取消",okType:"danger",onOk:()=>{o&&o(),g&&g(r)}})},T=e=>{e.stopPropagation(),a&&a(r)},k=e=>{e.stopPropagation(),m&&m(r)},I=null==(t=f.find(e=>e.key===r.type))?void 0:t.component,M=(0,eh.useMemo)(()=>{let e=r.hideExpression;if(!(null==e?void 0:e.length))return!1;try{return Function("$g","$e",`
|
|
55
55
|
"use strict";
|
|
56
56
|
const window = undefined;
|
|
57
57
|
const document = undefined;
|
package/package.json
CHANGED
|
@@ -201,7 +201,12 @@ const Toolbar: React.FC<{
|
|
|
201
201
|
</Tooltip>
|
|
202
202
|
)}
|
|
203
203
|
<Tooltip title="源码编辑">
|
|
204
|
-
<a
|
|
204
|
+
<a
|
|
205
|
+
onClick={(e) => {
|
|
206
|
+
e.stopPropagation();
|
|
207
|
+
setVisible(true);
|
|
208
|
+
}}
|
|
209
|
+
>
|
|
205
210
|
<IconFont type="icon-json" />
|
|
206
211
|
</a>
|
|
207
212
|
</Tooltip>
|