bi-sdk-react 0.0.1 → 0.0.3

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.
@@ -1,5 +1,5 @@
1
1
  /*! For license information please see bi-sdk.umd.min.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@ant-design/icons"),require("echarts"),require("styled-components"),require("react"),require("antd"),require("xlsx"),require("uuid"),require("dayjs"),require("@monaco-editor/react")):"function"==typeof define&&define.amd?define(["@ant-design/icons","echarts","styled-components","react","antd","xlsx","uuid","dayjs","@monaco-editor/react"],t):"object"==typeof exports?exports.BiSdk=t(require("@ant-design/icons"),require("echarts"),require("styled-components"),require("react"),require("antd"),require("xlsx"),require("uuid"),require("dayjs"),require("@monaco-editor/react")):e.BiSdk=t(e["@ant-design/icons"],e.echarts,e["styled-components"],e.react,e.antd,e.xlsx,e.uuid,e.dayjs,e["@monaco-editor/react"])}(this,(e,t,l,n,r,a,i,o,s)=>(()=>{var d={290(e,t,l){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,l=1,n=arguments.length;l<n;l++)for(var r in t=arguments[l])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.bindAll=void 0;var r=l(352);function a(e){if(void 0!==e)return"boolean"==typeof e?{capture:e}:e}t.bindAll=function(e,t,l){var i=t.map(function(t){var i=null==l?t:n(n({},t),{options:n(n({},a(l)),a(t.options))});return(0,r.bind)(e,i)});return function(){i.forEach(function(e){return e()})}}},352(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bind=void 0,t.bind=function(e,t){var l=t.type,n=t.listener,r=t.options;return e.addEventListener(l,n,r),function(){e.removeEventListener(l,n,r)}}},951(e,t,l){"use strict";t.bindAll=t.bind=void 0;var n=l(352);Object.defineProperty(t,"bind",{enumerable:!0,get:function(){return n.bind}});var r=l(290);Object.defineProperty(t,"bindAll",{enumerable:!0,get:function(){return r.bindAll}})},965(e,t,l){"use strict";var n=l(426),r={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var l,a,i,o,s,d,c,u,p=!1;t||(t={}),i=t.debug||!1;try{if(s=n(),d=document.createRange(),c=document.getSelection(),(u=document.createElement("span")).textContent=e,u.ariaHidden="true",u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",function(l){if(l.stopPropagation(),t.format)if(l.preventDefault(),void 0===l.clipboardData){i&&console.warn("unable to use e.clipboardData"),i&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var n=r[t.format]||r.default;window.clipboardData.setData(n,e)}else l.clipboardData.clearData(),l.clipboardData.setData(t.format,e);t.onCopy&&(l.preventDefault(),t.onCopy(l.clipboardData))}),document.body.appendChild(u),d.selectNodeContents(u),c.addRange(d),!document.execCommand("copy"))throw Error("copy command was unsuccessful");p=!0}catch(n){i&&console.error("unable to copy using execCommand: ",n),i&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),p=!0}catch(n){i&&console.error("unable to copy using clipboardData: ",n),i&&console.error("falling back to prompt"),l="message"in t?t.message:"Copy to clipboard: #{key}, Enter",a=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C",o=l.replace(/#{\s*key\s*}/g,a),window.prompt(o,e)}}finally{c&&("function"==typeof c.removeRange?c.removeRange(d):c.removeAllRanges()),u&&document.body.removeChild(u),s()}return p}},20(e,t,l){"use strict";var n=l(155),r=Symbol.for("react.element"),a=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,o=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function d(e,t,l){var n,a={},d=null,c=null;for(n in void 0!==l&&(d=""+l),void 0!==t.key&&(d=""+t.key),void 0!==t.ref&&(c=t.ref),t)i.call(t,n)&&!s.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===a[n]&&(a[n]=t[n]);return{$$typeof:r,type:e,key:d,ref:c,props:a,_owner:o.current}}t.Fragment=a,t.jsx=d,t.jsxs=d},848(e,t,l){"use strict";e.exports=l(20)},426(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,l=[],n=0;n<e.rangeCount;n++)l.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||l.forEach(function(t){e.addRange(t)}),t&&t.focus()}}},375(t){"use strict";t.exports=e},247(e){"use strict";e.exports=s},59(e){"use strict";e.exports=r},185(e){"use strict";e.exports=o},190(e){"use strict";e.exports=t},155(e){"use strict";e.exports=n},694(e){"use strict";e.exports=l},315(e){"use strict";e.exports=i},347(e){"use strict";e.exports=a}},c={};function u(e){var t=c[e];if(void 0!==t)return t.exports;var l=c[e]={exports:{}};return d[e].call(l.exports,l,l.exports,u),l.exports}u.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return u.d(t,{a:t}),t},u.d=(e,t)=>{for(var l in t)u.o(t,l)&&!u.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var p={};return(()=>{"use strict";u.r(p),u.d(p,{EnvContext:()=>em,DesignerContext:()=>ei,PageCanvas:()=>eg,PageSchema:()=>i.PageSchema,PageDesigner:()=>e5,PluginType:()=>i.PluginType,plugins:()=>tu,PropEditorProps:()=>o.PropEditorProps,handleCallback:()=>eq,DropContainer:()=>ep});var e,t,l,n,r,a,i={};u.r(i);var o={};u.r(o);var s=u(848),d=u(155),c=u.n(d),m=u(694),x=u.n(m);function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var l=0,n=Array(t);l<t;l++)n[l]=e[l];return n}function f(e,t){if(e){if("string"==typeof e)return h(e,t);var l=({}).toString.call(e).slice(8,-1);return"Object"===l&&e.constructor&&(l=e.constructor.name),"Map"===l||"Set"===l?Array.from(e):"Arguments"===l||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?h(e,t):void 0}}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var l=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=l){var n,r,a,i,o=[],s=!0,d=!1;try{if(a=(l=l.call(e)).next,0===t){if(Object(l)!==l)return;s=!1}else for(;!(s=(n=a.call(l)).done)&&(o.push(n.value),o.length!==t);s=!0);}catch(e){d=!0,r=e}finally{try{if(!s&&null!=l.return&&(i=l.return(),Object(i)!==i))return}finally{if(d)throw r}}return o}}(e,t)||f(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var v=u(951),b="data-pdnd-honey-pot";function y(e){return e instanceof Element&&e.hasAttribute(b)}function j(e){var t=g(document.elementsFromPoint(e.x,e.y),2),l=t[0],n=t[1];return l?y(l)?null!=n?n:null:l:null}function C(e){return(C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function w(e,t,l){var n;return(n=function(e,t){if("object"!=C(e)||!e)return e;var l=e[Symbol.toPrimitive];if(void 0!==l){var n=l.call(e,t||"default");if("object"!=C(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==C(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}function S(e,t){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),l.push.apply(l,n)}return l}function I(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{};t%2?S(Object(l),!0).forEach(function(t){w(e,t,l[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(l)):S(Object(l)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(l,t))})}return e}function z(e){var t,l,n,r,a={x:Math.min((r={x:Math.max((n={x:(l={x:Math.floor((t=e.client).x),y:Math.floor(t.y)}).x-1,y:l.y-1}).x,0),y:Math.max(n.y,0)}).x,window.innerWidth-2),y:Math.min(r.y,window.innerHeight-2)};return DOMRect.fromRect({x:a.x,y:a.y,width:2,height:2})}function k(e){var t=e.clientRect;return{left:"".concat(t.left,"px"),top:"".concat(t.top,"px"),width:"".concat(t.width,"px"),height:"".concat(t.height,"px")}}function O(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(e){var t=null;return function(){if(!t){for(var l=arguments.length,n=Array(l),r=0;r<l;r++)n[r]=arguments[r];t={result:e.apply(this,n)}}return t.result}}var R=T(function(){return navigator.userAgent.includes("Firefox")}),F=T(function(){var e=navigator.userAgent;return e.includes("AppleWebKit")&&!e.includes("Chrome")}),D={isLeavingWindow:Symbol("leaving"),isEnteringWindow:Symbol("entering")};if("undefined"!=typeof window&&F()){var N=E();(0,v.bindAll)(window,[{type:"dragstart",listener:function(){N.enterCount=0,N.isOverWindow=!0}},{type:"drop",listener:A},{type:"dragend",listener:A},{type:"dragenter",listener:function(e){N.isOverWindow||0!==N.enterCount||(e[D.isEnteringWindow]=!0),N.isOverWindow=!0,N.enterCount++}},{type:"dragleave",listener:function(e){N.enterCount--,N.isOverWindow&&0===N.enterCount&&(e[D.isLeavingWindow]=!0,N.isOverWindow=!1)}}],{capture:!0})}function E(){return{enterCount:0,isOverWindow:!1}}function A(){N=E()}function B(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var L=(e=function(e){return e()},t=[],l=null,(n=function(){for(var n=arguments.length,r=Array(n),a=0;a<n;a++)r[a]=arguments[a];t=r,l||(l=requestAnimationFrame(function(){l=null,e.apply(void 0,t)}))}).cancel=function(){l&&(cancelAnimationFrame(l),l=null)},n),P=(r=null,{schedule:function(e){r={frameId:requestAnimationFrame(function(){r=null,e()}),fn:e}},flush:function(){r&&(cancelAnimationFrame(r.frameId),r.fn(),r=null)}}),M={isActive:!1};function $(){return!M.isActive}function q(e){var t,l=e.event,n=null==(t=e.current[0])?void 0:t.dropEffect;null!=n&&l.dataTransfer&&(l.dataTransfer.dropEffect=n)}var G=function(e){var t=e.event,l=e.dragType,n=e.getDropTargetsOver,r=e.dispatchEvent;if($()){var a,i,o=function(e){var t=e.event,l=e.dragType,n=e.getDropTargetsOver,r=B(t);if("external"===l.startedFrom)return{input:r,dropTargets:[]};var a=n({input:r,source:l.payload,target:t.target,current:[]});return{input:r,dropTargets:a}}({event:t,dragType:l,getDropTargetsOver:n});M.isActive=!0;var s={current:o};q({event:t,current:o.dropTargets});var d=function(e){var t=e.source,l=e.initial,n=e.dispatchEvent,r={dropTargets:[]};function a(e){n(e),r={dropTargets:e.payload.location.current.dropTargets}}return{start:function(e){var n=e.nativeSetDragImage,i={current:l,previous:r,initial:l};a({eventName:"onGenerateDragPreview",payload:{source:t,location:i,nativeSetDragImage:n}}),P.schedule(function(){a({eventName:"onDragStart",payload:{source:t,location:i}})})},dragUpdate:function(e){var n=e.current;P.flush(),L.cancel(),a({eventName:"onDropTargetChange",payload:{source:t,location:{initial:l,previous:r,current:n}}})},drag:function(e){var n=e.current;L(function(){P.flush(),a({eventName:"onDrag",payload:{source:t,location:{initial:l,previous:r,current:n}}})})},drop:function(e){var n=e.current,i=e.updatedSourcePayload;P.flush(),L.cancel(),a({eventName:"onDrop",payload:{source:null!=i?i:t,location:{current:n,previous:r,initial:l}}})}}}({source:l.payload,dispatchEvent:r,initial:o}),c=(0,v.bindAll)(window,[{type:"dragover",listener:function(e){p(e),d.drag({current:s.current})}},{type:"dragenter",listener:p},{type:"dragleave",listener:function(e){(function(e){var t=e.dragLeave,l=t.type,n=t.relatedTarget;return"dragleave"===l&&(F()?!!F()&&t.hasOwnProperty(D.isLeavingWindow):null==n||(R()?"nodeName"in n&&n.ownerDocument!==document:n instanceof HTMLIFrameElement))})({dragLeave:e})&&(u({input:s.current.input,dropTargets:[]}),"external"===l.startedFrom&&m())}},{type:"drop",listener:function(e){(s.current={dropTargets:s.current.dropTargets,input:B(e)},s.current.dropTargets.length)?(e.preventDefault(),q({event:e,current:s.current.dropTargets}),d.drop({current:s.current,updatedSourcePayload:"external"===l.type?l.getDropPayload(e):null}),x()):m()}},{type:"dragend",listener:function(e){s.current={dropTargets:s.current.dropTargets,input:B(e)},m()}}].concat(O([{type:"pointermove",listener:(i=0,function(){i<20?i++:a()})},{type:"pointerdown",listener:a=m}])),{capture:!0});d.start({nativeSetDragImage:t.dataTransfer?t.dataTransfer.setDragImage.bind(t.dataTransfer):null})}function u(e){var t=function(e){var t=e.current,l=e.next;if(t.length!==l.length)return!0;for(var n=0;n<t.length;n++)if(t[n].element!==l[n].element)return!0;return!1}({current:s.current.dropTargets,next:e.dropTargets});s.current=e,t&&d.dragUpdate({current:s.current})}function p(e){var t=B(e),r=n({target:y(e.target)?j({x:t.clientX,y:t.clientY}):e.target,input:t,source:l.payload,current:s.current.dropTargets});r.length&&(e.preventDefault(),q({event:e,current:r})),u({dropTargets:r,input:t})}function m(){s.current.dropTargets.length&&u({dropTargets:[],input:s.current.input}),d.drop({current:s.current,updatedSourcePayload:null}),x()}function x(){M.isActive=!1,c()}},H=new Map;function Y(){for(var e=arguments.length,t=Array(e),l=0;l<e;l++)t[l]=arguments[l];return function(){t.forEach(function(e){return e()})}}function _(e,t){var l=t.attribute,n=t.value;return e.setAttribute(l,n),function(){return e.removeAttribute(l)}}function U(e,t){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),l.push.apply(l,n)}return l}function K(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{};t%2?U(Object(l),!0).forEach(function(t){w(e,t,l[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(l)):U(Object(l)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(l,t))})}return e}function W(e,t){var l="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!l){if(Array.isArray(e)||(l=function(e,t){if(e){if("string"==typeof e)return J(e,void 0);var l=({}).toString.call(e).slice(8,-1);return"Object"===l&&e.constructor&&(l=e.constructor.name),"Map"===l||"Set"===l?Array.from(e):"Arguments"===l||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?J(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){l&&(e=l);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,o=!1;return{s:function(){l=l.call(e)},n:function(){var e=l.next();return i=e.done,e},e:function(e){o=!0,a=e},f:function(){try{i||null==l.return||l.return()}finally{if(o)throw a}}}}function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var l=0,n=Array(t);l<t;l++)n[l]=e[l];return n}function X(e){return e.slice(0).reverse()}function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var l=0,n=Array(t);l<t;l++)n[l]=e[l];return n}function Q(e,t){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),l.push.apply(l,n)}return l}var Z=T(function(){return navigator.userAgent.toLocaleLowerCase().includes("android")}),ee="text/plain",et=new WeakMap,el=(a=null,{bindEvents:function(){return a=null,(0,v.bind)(window,{type:"pointermove",listener:function(e){a={x:e.clientX,y:e.clientY}},options:{capture:!0}})},getOnPostDispatch:function(){var e=null;return function(t){var l=t.eventName,n=t.payload;if("onDragStart"===l){var r,i,o,s=n.location.initial.input,d=null!=a?a:{x:s.clientX,y:s.clientY};(r=document.createElement("div")).setAttribute(b,"true"),i=z({client:d}),Object.assign(r.style,I(I({backgroundColor:"transparent",position:"fixed",padding:0,margin:0,boxSizing:"border-box"},k({clientRect:i})),{},{pointerEvents:"auto",zIndex:0x7fffffff})),document.body.appendChild(r),o=(0,v.bind)(window,{type:"pointermove",listener:function(e){i=z({client:{x:e.clientX,y:e.clientY}}),Object.assign(r.style,k({clientRect:i}))},options:{capture:!0}}),e=function(e){var t,l,n,a=e.current;if(o(),l=(t={client:a,clientRect:i}).client,n=t.clientRect,l.x>=n.x&&l.x<=n.x+n.width&&l.y>=n.y&&l.y<=n.y+n.height)return void r.remove();function s(){d(),r.remove()}var d=(0,v.bindAll)(window,[{type:"pointerdown",listener:s},{type:"pointermove",listener:s},{type:"focusin",listener:s},{type:"focusout",listener:s},{type:"dragstart",listener:s},{type:"dragenter",listener:s},{type:"dragover",listener:s}],{capture:!0})}}if("onDrop"===l){var c,u=n.location.current.input;null==(c=e)||c({current:{x:u.clientX,y:u.clientY}}),e=null,a=null}}}}),en=function(e){var t=e.typeKey,l=e.mount,n=e.dispatchEventToSource,r=e.onPostDispatch,a=e.defaultDropEffect,i=function(){var e=new Set,t=null;function l(e){t&&(!e.canMonitor||e.canMonitor(t.canMonitorArgs))&&t.active.add(e)}return{dispatchEvent:function(n){var r=n.eventName,a=n.payload;if("onGenerateDragPreview"===r){t={canMonitorArgs:{initial:a.location.initial,source:a.source},active:new Set};var i,o=function(e,t){var l="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!l){if(Array.isArray(e)||(l=function(e,t){if(e){if("string"==typeof e)return V(e,void 0);var l=({}).toString.call(e).slice(8,-1);return"Object"===l&&e.constructor&&(l=e.constructor.name),"Map"===l||"Set"===l?Array.from(e):"Arguments"===l||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?V(e,void 0):void 0}}(e))){l&&(e=l);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,o=!1;return{s:function(){l=l.call(e)},n:function(){var e=l.next();return i=e.done,e},e:function(e){o=!0,a=e},f:function(){try{i||null==l.return||l.return()}finally{if(o)throw a}}}}(e);try{for(o.s();!(i=o.n()).done;){var s=i.value;l(s)}}catch(e){o.e(e)}finally{o.f()}}if(t){for(var d=Array.from(t.active),c=0;c<d.length;c++){var u,p=d[c];t.active.has(p)&&(null==(u=p[r])||u.call(p,a))}"onDrop"===r&&(t.active.clear(),t=null)}},monitorForConsumers:function(n){var r=function(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(l),!0).forEach(function(t){w(e,t,l[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(l)):Q(Object(l)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(l,t))})}return e}({},n);return e.add(r),l(r),T(function(){e.delete(r),t&&t.active.delete(r)})}}}(),o=function(e){var t=e.typeKey,l=e.defaultDropEffect,n=new WeakMap,r="data-drop-target-for-".concat(t),a="[".concat(r,"]");function i(e){var t,l=e.eventName,r=e.payload,a=W(r.location.current.dropTargets);try{for(a.s();!(t=a.n()).done;){var i,o=t.value,s=n.get(o.element),d=K(K({},r),{},{self:o});null==s||null==(i=s[l])||i.call(s,d)}}catch(e){a.e(e)}finally{a.f()}}var o={onGenerateDragPreview:i,onDrag:i,onDragStart:i,onDrop:i,onDropTargetChange:function(e){var t,l=e.payload,r=new Set(l.location.current.dropTargets.map(function(e){return e.element})),a=new Set,i=W(l.location.previous.dropTargets);try{for(i.s();!(t=i.n()).done;){var o,s,d=t.value;a.add(d.element);var c=n.get(d.element),u=r.has(d.element),p=K(K({},l),{},{self:d});null==c||null==(o=c.onDropTargetChange)||o.call(c,p),u||null==c||null==(s=c.onDragLeave)||s.call(c,p)}}catch(e){i.e(e)}finally{i.f()}var m,x=W(l.location.current.dropTargets);try{for(x.s();!(m=x.n()).done;){var h,f,g=m.value;if(!a.has(g.element)){var v=K(K({},l),{},{self:g}),b=n.get(g.element);null==b||null==(h=b.onDropTargetChange)||h.call(b,v),null==b||null==(f=b.onDragEnter)||f.call(b,v)}}}catch(e){x.e(e)}finally{x.f()}}};return{dropTargetForConsumers:function(e){return T(Y(_(e.element,{attribute:r,value:"true"}),(n.set(e.element,e),function(){return n.delete(e.element)})))},getIsOver:function(e){var t=e.source,r=e.target,i=e.input,o=e.current,s=function e(t){var r,i,o,s,d=t.source,c=t.target,u=t.input,p=t.result,m=void 0===p?[]:p;if(null==c)return m;if(!(c instanceof Element))return c instanceof Node?e({source:d,target:c.parentElement,input:u,result:m}):m;var x=c.closest(a);if(null==x)return m;var h=n.get(x);if(null==h)return m;var f={input:u,source:d,element:h.element};if(h.canDrop&&!h.canDrop(f))return e({source:d,target:h.element.parentElement,input:u,result:m});var g=null!=(r=null==(i=h.getData)?void 0:i.call(h,f))?r:{},v=null!=(o=null==(s=h.getDropEffect)?void 0:s.call(h,f))?o:l,b={data:g,element:h.element,dropEffect:v,isActiveDueToStickiness:!1};return e({source:d,target:h.element.parentElement,input:u,result:[].concat(O(m),[b])})}({source:t,target:r,input:i});if(s.length>=o.length)return s;for(var d=X(o),c=X(s),u=[],p=0;p<d.length;p++){var m,x=d[p],h=c[p];if(null!=h){u.push(h);continue}var f=u[p-1],g=d[p-1];if((null==f?void 0:f.element)!==(null==g?void 0:g.element))break;var v=n.get(x.element);if(!v)break;var b={input:i,source:t,element:v.element};if(v.canDrop&&!v.canDrop(b)||!(null!=(m=v.getIsSticky)&&m.call(v,b)))break;u.push(K(K({},x),{},{isActiveDueToStickiness:!0}))}return X(u)},dispatchEvent:function(e){o[e.eventName](e)}}}({typeKey:t,defaultDropEffect:a});function s(e){null==n||n(e),o.dispatchEvent(e),i.dispatchEvent(e),null==r||r(e)}function d(e){G({event:e.event,dragType:e.dragType,getDropTargetsOver:o.getIsOver,dispatchEvent:s})}return{registerUsage:function(){var e,n;return n=function(e){var t=e.typeKey,l=e.mount,n=H.get(t);if(n)return n.usageCount++,n;var r={typeKey:t,unmount:l(),usageCount:1};return H.set(t,r),r}(e={typeKey:t,mount:function(){return l({canStart:$,start:d})}}),function(){n.usageCount--,n.usageCount>0||(n.unmount(),H.delete(e.typeKey))}},dropTarget:o.dropTargetForConsumers,monitor:i.monitorForConsumers}}({typeKey:"element",defaultDropEffect:"move",mount:function(e){return Y(el.bindEvents(),(0,v.bind)(document,{type:"dragstart",listener:function(t){if(e.canStart(t)&&!t.defaultPrevented&&t.dataTransfer){var l,n,r,a,i,o,s=t.target;if(s instanceof HTMLElement){var d=et.get(s);if(d){var c=B(t),u={element:d.element,dragHandle:null!=(l=d.dragHandle)?l:null,input:c};if(d.canDrag&&!d.canDrag(u))return void t.preventDefault();if(d.dragHandle){var p=j({x:c.clientX,y:c.clientY});if(!d.dragHandle.contains(p))return void t.preventDefault()}var m=null!=(n=null==(r=d.getInitialDataForExternal)?void 0:r.call(d,u))?n:null;if(m)for(var x=0,h=Object.entries(m);x<h.length;x++){var f=g(h[x],2),v=f[0],b=f[1];t.dataTransfer.setData(v,null!=b?b:"")}!Z()||t.dataTransfer.types.includes(ee)||t.dataTransfer.types.includes("text/uri-list")||t.dataTransfer.setData(ee,"pdnd:android-fallback"),t.dataTransfer.setData("application/vnd.pdnd","");var y={element:d.element,dragHandle:null!=(a=d.dragHandle)?a:null,data:null!=(i=null==(o=d.getInitialData)?void 0:o.call(d,u))?i:{}};e.start({event:t,dragType:{type:"element",payload:y,startedFrom:"internal"}})}}}}}))},dispatchEventToSource:function(e){var t,l,n=e.eventName,r=e.payload;null==(t=et.get(r.source.element))||null==(l=t[n])||l.call(t,r)},onPostDispatch:el.getOnPostDispatch()}),er=en.dropTarget;function ea(e){return T(Y(en.registerUsage(),(et.set(e.element,e),function(){et.delete(e.element)}),_(e.element,{attribute:"draggable",value:"true"})))}en.monitor;let ei=(0,d.createContext)({designable:!1,plugins:[],schema:{info:{},datasources:[],scripts:[],variables:[],items:[]},selectedItem:null,setSchema:()=>{},setSelectedItem:()=>{},updateSelectedItem:()=>{},forceUpdate:()=>{}}),eo=e=>{let{designable:t,plugins:l,schema:n,selectedItem:r,setSchema:a,setSelectedItem:i,children:o}=e;return(0,s.jsx)(ei.Provider,{value:{designable:!!t,plugins:l||[],schema:n,selectedItem:r,setSchema:a||(()=>{}),setSelectedItem:i||(()=>{}),updateSelectedItem:e=>{null==i||i(Object.assign(r,e||{})),null==a||a({...n})},forceUpdate:()=>{null==a||a({...n})}},children:o})},es=e=>{var t;let{item:l,onDelete:n,parentList:r,onListChange:a,index:i}=e,{designable:o,selectedItem:c,setSelectedItem:u,plugins:p}=(0,d.useContext)(ei),[m,x]=(0,d.useState)(!1),h=null==(t=p.find(e=>e.key===l.type))?void 0:t.component;return((0,d.useEffect)(()=>{let e=()=>{if(!t.current)return;let e=document.getElementById(`page-item-${l.id}`);if(!e)return void r();let n=e.getBoundingClientRect();if(0===n.width&&0===n.height){t.current.style.display="none";return}t.current.style.display="flex";let a=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,i=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;t.current.style.top=`${n.top+a-22}px`,t.current.style.left=`${n.left+i-1}px`},t={current:null},r=()=>{if(t.current){let l=t.current.querySelector("a");l&&l.removeEventListener("click",a),document.body.contains(t.current)&&document.body.removeChild(t.current),t.current=null,window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},a=e=>{e.stopPropagation(),n&&n()};if(c&&c===l&&o){let n=document.createElement("div");n.style.position="absolute",n.style.zIndex="9999",n.style.display="flex",n.style.gap="4px";let i=document.createElement("span");i.innerText=l.name||l.type+`(${l.id})`,i.style.background="#1890ff",i.style.color="#fff",i.style.fontSize="12px",i.style.borderTopLeftRadius="4px",i.style.borderTopRightRadius="4px",i.style.padding="2px 8px",i.style.cursor="pointer",i.style.userSelect="none",n.appendChild(i);let o=document.createElement("a");return o.innerText="X",o.style.background="#1890ff",o.style.color="#fff",o.style.fontSize="12px",o.style.borderTopLeftRadius="4px",o.style.borderTopRightRadius="4px",o.style.padding="2px 8px",o.style.cursor="pointer",o.style.userSelect="none",n.appendChild(o),o.addEventListener("click",a),document.body.appendChild(n),t.current=n,e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>r()}},[c,o,l,n]),(0,d.useEffect)(()=>{let e=document.getElementById(`page-item-${l.id}`);if(!e||!o)return;let t=ea({element:e,getInitialData:()=>({id:l.id,index:i,list:r,onListChange:a,data:l}),canDrag:()=>!!o,onDragStart:()=>{x(!0)},onDrop:()=>{x(!1)}}),n=e=>{e.stopPropagation(),u&&u(l)};return o&&e.addEventListener("click",n),()=>{t(),o&&e.removeEventListener("click",n)}},[o,l,i,r]),h)?(0,s.jsx)(h,{id:`page-item-${l.id}`,"data-item-id":l.id,...l.props||{},item:l,className:`page-item-component ${o?"designable":""} ${c===l?"selected":""}`,style:{...l.style||{},opacity:m?.5:1}}):null},ed=x().div`
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@ant-design/icons"),require("echarts"),require("styled-components"),require("react"),require("antd"),require("xlsx"),require("uuid"),require("dayjs"),require("@monaco-editor/react")):"function"==typeof define&&define.amd?define(["@ant-design/icons","echarts","styled-components","react","antd","xlsx","uuid","dayjs","@monaco-editor/react"],t):"object"==typeof exports?exports.BiSdk=t(require("@ant-design/icons"),require("echarts"),require("styled-components"),require("react"),require("antd"),require("xlsx"),require("uuid"),require("dayjs"),require("@monaco-editor/react")):e.BiSdk=t(e["@ant-design/icons"],e.echarts,e["styled-components"],e.react,e.antd,e.xlsx,e.uuid,e.dayjs,e["@monaco-editor/react"])}(this,(e,t,l,n,r,a,i,o,s)=>(()=>{var d={290(e,t,l){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,l=1,n=arguments.length;l<n;l++)for(var r in t=arguments[l])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.bindAll=void 0;var r=l(352);function a(e){if(void 0!==e)return"boolean"==typeof e?{capture:e}:e}t.bindAll=function(e,t,l){var i=t.map(function(t){var i=null==l?t:n(n({},t),{options:n(n({},a(l)),a(t.options))});return(0,r.bind)(e,i)});return function(){i.forEach(function(e){return e()})}}},352(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bind=void 0,t.bind=function(e,t){var l=t.type,n=t.listener,r=t.options;return e.addEventListener(l,n,r),function(){e.removeEventListener(l,n,r)}}},951(e,t,l){"use strict";t.bindAll=t.bind=void 0;var n=l(352);Object.defineProperty(t,"bind",{enumerable:!0,get:function(){return n.bind}});var r=l(290);Object.defineProperty(t,"bindAll",{enumerable:!0,get:function(){return r.bindAll}})},965(e,t,l){"use strict";var n=l(426),r={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var l,a,i,o,s,d,c,u,p=!1;t||(t={}),i=t.debug||!1;try{if(s=n(),d=document.createRange(),c=document.getSelection(),(u=document.createElement("span")).textContent=e,u.ariaHidden="true",u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",function(l){if(l.stopPropagation(),t.format)if(l.preventDefault(),void 0===l.clipboardData){i&&console.warn("unable to use e.clipboardData"),i&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var n=r[t.format]||r.default;window.clipboardData.setData(n,e)}else l.clipboardData.clearData(),l.clipboardData.setData(t.format,e);t.onCopy&&(l.preventDefault(),t.onCopy(l.clipboardData))}),document.body.appendChild(u),d.selectNodeContents(u),c.addRange(d),!document.execCommand("copy"))throw Error("copy command was unsuccessful");p=!0}catch(n){i&&console.error("unable to copy using execCommand: ",n),i&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),p=!0}catch(n){i&&console.error("unable to copy using clipboardData: ",n),i&&console.error("falling back to prompt"),l="message"in t?t.message:"Copy to clipboard: #{key}, Enter",a=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C",o=l.replace(/#{\s*key\s*}/g,a),window.prompt(o,e)}}finally{c&&("function"==typeof c.removeRange?c.removeRange(d):c.removeAllRanges()),u&&document.body.removeChild(u),s()}return p}},20(e,t,l){"use strict";var n=l(155),r=Symbol.for("react.element"),a=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,o=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function d(e,t,l){var n,a={},d=null,c=null;for(n in void 0!==l&&(d=""+l),void 0!==t.key&&(d=""+t.key),void 0!==t.ref&&(c=t.ref),t)i.call(t,n)&&!s.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===a[n]&&(a[n]=t[n]);return{$$typeof:r,type:e,key:d,ref:c,props:a,_owner:o.current}}t.Fragment=a,t.jsx=d,t.jsxs=d},848(e,t,l){"use strict";e.exports=l(20)},426(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,l=[],n=0;n<e.rangeCount;n++)l.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||l.forEach(function(t){e.addRange(t)}),t&&t.focus()}}},375(t){"use strict";t.exports=e},247(e){"use strict";e.exports=s},59(e){"use strict";e.exports=r},185(e){"use strict";e.exports=o},190(e){"use strict";e.exports=t},155(e){"use strict";e.exports=n},694(e){"use strict";e.exports=l},315(e){"use strict";e.exports=i},347(e){"use strict";e.exports=a}},c={};function u(e){var t=c[e];if(void 0!==t)return t.exports;var l=c[e]={exports:{}};return d[e].call(l.exports,l,l.exports,u),l.exports}u.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return u.d(t,{a:t}),t},u.d=(e,t)=>{for(var l in t)u.o(t,l)&&!u.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var p={};return(()=>{"use strict";u.r(p),u.d(p,{EnvContext:()=>em,DesignerContext:()=>ei,PageCanvas:()=>eg,PageSchema:()=>i.PageSchema,PageDesigner:()=>e5,PluginType:()=>i.PluginType,plugins:()=>tu,PropEditorProps:()=>o.PropEditorProps,handleCallback:()=>eq,DropContainer:()=>ep});var e,t,l,n,r,a,i={};u.r(i);var o={};u.r(o);var s=u(848),d=u(155),c=u.n(d),m=u(694),x=u.n(m);function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var l=0,n=Array(t);l<t;l++)n[l]=e[l];return n}function f(e,t){if(e){if("string"==typeof e)return h(e,t);var l=({}).toString.call(e).slice(8,-1);return"Object"===l&&e.constructor&&(l=e.constructor.name),"Map"===l||"Set"===l?Array.from(e):"Arguments"===l||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?h(e,t):void 0}}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var l=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=l){var n,r,a,i,o=[],s=!0,d=!1;try{if(a=(l=l.call(e)).next,0===t){if(Object(l)!==l)return;s=!1}else for(;!(s=(n=a.call(l)).done)&&(o.push(n.value),o.length!==t);s=!0);}catch(e){d=!0,r=e}finally{try{if(!s&&null!=l.return&&(i=l.return(),Object(i)!==i))return}finally{if(d)throw r}}return o}}(e,t)||f(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var v=u(951),y="data-pdnd-honey-pot";function b(e){return e instanceof Element&&e.hasAttribute(y)}function j(e){var t=g(document.elementsFromPoint(e.x,e.y),2),l=t[0],n=t[1];return l?b(l)?null!=n?n:null:l:null}function C(e){return(C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function w(e,t,l){var n;return(n=function(e,t){if("object"!=C(e)||!e)return e;var l=e[Symbol.toPrimitive];if(void 0!==l){var n=l.call(e,t||"default");if("object"!=C(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==C(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}function S(e,t){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),l.push.apply(l,n)}return l}function I(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{};t%2?S(Object(l),!0).forEach(function(t){w(e,t,l[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(l)):S(Object(l)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(l,t))})}return e}function z(e){var t,l,n,r,a={x:Math.min((r={x:Math.max((n={x:(l={x:Math.floor((t=e.client).x),y:Math.floor(t.y)}).x-1,y:l.y-1}).x,0),y:Math.max(n.y,0)}).x,window.innerWidth-2),y:Math.min(r.y,window.innerHeight-2)};return DOMRect.fromRect({x:a.x,y:a.y,width:2,height:2})}function k(e){var t=e.clientRect;return{left:"".concat(t.left,"px"),top:"".concat(t.top,"px"),width:"".concat(t.width,"px"),height:"".concat(t.height,"px")}}function O(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(e){var t=null;return function(){if(!t){for(var l=arguments.length,n=Array(l),r=0;r<l;r++)n[r]=arguments[r];t={result:e.apply(this,n)}}return t.result}}var R=T(function(){return navigator.userAgent.includes("Firefox")}),F=T(function(){var e=navigator.userAgent;return e.includes("AppleWebKit")&&!e.includes("Chrome")}),D={isLeavingWindow:Symbol("leaving"),isEnteringWindow:Symbol("entering")};if("undefined"!=typeof window&&F()){var N=E();(0,v.bindAll)(window,[{type:"dragstart",listener:function(){N.enterCount=0,N.isOverWindow=!0}},{type:"drop",listener:A},{type:"dragend",listener:A},{type:"dragenter",listener:function(e){N.isOverWindow||0!==N.enterCount||(e[D.isEnteringWindow]=!0),N.isOverWindow=!0,N.enterCount++}},{type:"dragleave",listener:function(e){N.enterCount--,N.isOverWindow&&0===N.enterCount&&(e[D.isLeavingWindow]=!0,N.isOverWindow=!1)}}],{capture:!0})}function E(){return{enterCount:0,isOverWindow:!1}}function A(){N=E()}function B(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var P=(e=function(e){return e()},t=[],l=null,(n=function(){for(var n=arguments.length,r=Array(n),a=0;a<n;a++)r[a]=arguments[a];t=r,l||(l=requestAnimationFrame(function(){l=null,e.apply(void 0,t)}))}).cancel=function(){l&&(cancelAnimationFrame(l),l=null)},n),L=(r=null,{schedule:function(e){r={frameId:requestAnimationFrame(function(){r=null,e()}),fn:e}},flush:function(){r&&(cancelAnimationFrame(r.frameId),r.fn(),r=null)}}),M={isActive:!1};function $(){return!M.isActive}function q(e){var t,l=e.event,n=null==(t=e.current[0])?void 0:t.dropEffect;null!=n&&l.dataTransfer&&(l.dataTransfer.dropEffect=n)}var H=function(e){var t=e.event,l=e.dragType,n=e.getDropTargetsOver,r=e.dispatchEvent;if($()){var a,i,o=function(e){var t=e.event,l=e.dragType,n=e.getDropTargetsOver,r=B(t);if("external"===l.startedFrom)return{input:r,dropTargets:[]};var a=n({input:r,source:l.payload,target:t.target,current:[]});return{input:r,dropTargets:a}}({event:t,dragType:l,getDropTargetsOver:n});M.isActive=!0;var s={current:o};q({event:t,current:o.dropTargets});var d=function(e){var t=e.source,l=e.initial,n=e.dispatchEvent,r={dropTargets:[]};function a(e){n(e),r={dropTargets:e.payload.location.current.dropTargets}}return{start:function(e){var n=e.nativeSetDragImage,i={current:l,previous:r,initial:l};a({eventName:"onGenerateDragPreview",payload:{source:t,location:i,nativeSetDragImage:n}}),L.schedule(function(){a({eventName:"onDragStart",payload:{source:t,location:i}})})},dragUpdate:function(e){var n=e.current;L.flush(),P.cancel(),a({eventName:"onDropTargetChange",payload:{source:t,location:{initial:l,previous:r,current:n}}})},drag:function(e){var n=e.current;P(function(){L.flush(),a({eventName:"onDrag",payload:{source:t,location:{initial:l,previous:r,current:n}}})})},drop:function(e){var n=e.current,i=e.updatedSourcePayload;L.flush(),P.cancel(),a({eventName:"onDrop",payload:{source:null!=i?i:t,location:{current:n,previous:r,initial:l}}})}}}({source:l.payload,dispatchEvent:r,initial:o}),c=(0,v.bindAll)(window,[{type:"dragover",listener:function(e){p(e),d.drag({current:s.current})}},{type:"dragenter",listener:p},{type:"dragleave",listener:function(e){(function(e){var t=e.dragLeave,l=t.type,n=t.relatedTarget;return"dragleave"===l&&(F()?!!F()&&t.hasOwnProperty(D.isLeavingWindow):null==n||(R()?"nodeName"in n&&n.ownerDocument!==document:n instanceof HTMLIFrameElement))})({dragLeave:e})&&(u({input:s.current.input,dropTargets:[]}),"external"===l.startedFrom&&m())}},{type:"drop",listener:function(e){(s.current={dropTargets:s.current.dropTargets,input:B(e)},s.current.dropTargets.length)?(e.preventDefault(),q({event:e,current:s.current.dropTargets}),d.drop({current:s.current,updatedSourcePayload:"external"===l.type?l.getDropPayload(e):null}),x()):m()}},{type:"dragend",listener:function(e){s.current={dropTargets:s.current.dropTargets,input:B(e)},m()}}].concat(O([{type:"pointermove",listener:(i=0,function(){i<20?i++:a()})},{type:"pointerdown",listener:a=m}])),{capture:!0});d.start({nativeSetDragImage:t.dataTransfer?t.dataTransfer.setDragImage.bind(t.dataTransfer):null})}function u(e){var t=function(e){var t=e.current,l=e.next;if(t.length!==l.length)return!0;for(var n=0;n<t.length;n++)if(t[n].element!==l[n].element)return!0;return!1}({current:s.current.dropTargets,next:e.dropTargets});s.current=e,t&&d.dragUpdate({current:s.current})}function p(e){var t=B(e),r=n({target:b(e.target)?j({x:t.clientX,y:t.clientY}):e.target,input:t,source:l.payload,current:s.current.dropTargets});r.length&&(e.preventDefault(),q({event:e,current:r})),u({dropTargets:r,input:t})}function m(){s.current.dropTargets.length&&u({dropTargets:[],input:s.current.input}),d.drop({current:s.current,updatedSourcePayload:null}),x()}function x(){M.isActive=!1,c()}},G=new Map;function Y(){for(var e=arguments.length,t=Array(e),l=0;l<e;l++)t[l]=arguments[l];return function(){t.forEach(function(e){return e()})}}function _(e,t){var l=t.attribute,n=t.value;return e.setAttribute(l,n),function(){return e.removeAttribute(l)}}function U(e,t){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),l.push.apply(l,n)}return l}function K(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{};t%2?U(Object(l),!0).forEach(function(t){w(e,t,l[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(l)):U(Object(l)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(l,t))})}return e}function W(e,t){var l="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!l){if(Array.isArray(e)||(l=function(e,t){if(e){if("string"==typeof e)return J(e,void 0);var l=({}).toString.call(e).slice(8,-1);return"Object"===l&&e.constructor&&(l=e.constructor.name),"Map"===l||"Set"===l?Array.from(e):"Arguments"===l||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?J(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){l&&(e=l);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,o=!1;return{s:function(){l=l.call(e)},n:function(){var e=l.next();return i=e.done,e},e:function(e){o=!0,a=e},f:function(){try{i||null==l.return||l.return()}finally{if(o)throw a}}}}function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var l=0,n=Array(t);l<t;l++)n[l]=e[l];return n}function X(e){return e.slice(0).reverse()}function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var l=0,n=Array(t);l<t;l++)n[l]=e[l];return n}function Q(e,t){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),l.push.apply(l,n)}return l}var Z=T(function(){return navigator.userAgent.toLocaleLowerCase().includes("android")}),ee="text/plain",et=new WeakMap,el=(a=null,{bindEvents:function(){return a=null,(0,v.bind)(window,{type:"pointermove",listener:function(e){a={x:e.clientX,y:e.clientY}},options:{capture:!0}})},getOnPostDispatch:function(){var e=null;return function(t){var l=t.eventName,n=t.payload;if("onDragStart"===l){var r,i,o,s=n.location.initial.input,d=null!=a?a:{x:s.clientX,y:s.clientY};(r=document.createElement("div")).setAttribute(y,"true"),i=z({client:d}),Object.assign(r.style,I(I({backgroundColor:"transparent",position:"fixed",padding:0,margin:0,boxSizing:"border-box"},k({clientRect:i})),{},{pointerEvents:"auto",zIndex:0x7fffffff})),document.body.appendChild(r),o=(0,v.bind)(window,{type:"pointermove",listener:function(e){i=z({client:{x:e.clientX,y:e.clientY}}),Object.assign(r.style,k({clientRect:i}))},options:{capture:!0}}),e=function(e){var t,l,n,a=e.current;if(o(),l=(t={client:a,clientRect:i}).client,n=t.clientRect,l.x>=n.x&&l.x<=n.x+n.width&&l.y>=n.y&&l.y<=n.y+n.height)return void r.remove();function s(){d(),r.remove()}var d=(0,v.bindAll)(window,[{type:"pointerdown",listener:s},{type:"pointermove",listener:s},{type:"focusin",listener:s},{type:"focusout",listener:s},{type:"dragstart",listener:s},{type:"dragenter",listener:s},{type:"dragover",listener:s}],{capture:!0})}}if("onDrop"===l){var c,u=n.location.current.input;null==(c=e)||c({current:{x:u.clientX,y:u.clientY}}),e=null,a=null}}}}),en=function(e){var t=e.typeKey,l=e.mount,n=e.dispatchEventToSource,r=e.onPostDispatch,a=e.defaultDropEffect,i=function(){var e=new Set,t=null;function l(e){t&&(!e.canMonitor||e.canMonitor(t.canMonitorArgs))&&t.active.add(e)}return{dispatchEvent:function(n){var r=n.eventName,a=n.payload;if("onGenerateDragPreview"===r){t={canMonitorArgs:{initial:a.location.initial,source:a.source},active:new Set};var i,o=function(e,t){var l="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!l){if(Array.isArray(e)||(l=function(e,t){if(e){if("string"==typeof e)return V(e,void 0);var l=({}).toString.call(e).slice(8,-1);return"Object"===l&&e.constructor&&(l=e.constructor.name),"Map"===l||"Set"===l?Array.from(e):"Arguments"===l||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?V(e,void 0):void 0}}(e))){l&&(e=l);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,o=!1;return{s:function(){l=l.call(e)},n:function(){var e=l.next();return i=e.done,e},e:function(e){o=!0,a=e},f:function(){try{i||null==l.return||l.return()}finally{if(o)throw a}}}}(e);try{for(o.s();!(i=o.n()).done;){var s=i.value;l(s)}}catch(e){o.e(e)}finally{o.f()}}if(t){for(var d=Array.from(t.active),c=0;c<d.length;c++){var u,p=d[c];t.active.has(p)&&(null==(u=p[r])||u.call(p,a))}"onDrop"===r&&(t.active.clear(),t=null)}},monitorForConsumers:function(n){var r=function(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(l),!0).forEach(function(t){w(e,t,l[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(l)):Q(Object(l)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(l,t))})}return e}({},n);return e.add(r),l(r),T(function(){e.delete(r),t&&t.active.delete(r)})}}}(),o=function(e){var t=e.typeKey,l=e.defaultDropEffect,n=new WeakMap,r="data-drop-target-for-".concat(t),a="[".concat(r,"]");function i(e){var t,l=e.eventName,r=e.payload,a=W(r.location.current.dropTargets);try{for(a.s();!(t=a.n()).done;){var i,o=t.value,s=n.get(o.element),d=K(K({},r),{},{self:o});null==s||null==(i=s[l])||i.call(s,d)}}catch(e){a.e(e)}finally{a.f()}}var o={onGenerateDragPreview:i,onDrag:i,onDragStart:i,onDrop:i,onDropTargetChange:function(e){var t,l=e.payload,r=new Set(l.location.current.dropTargets.map(function(e){return e.element})),a=new Set,i=W(l.location.previous.dropTargets);try{for(i.s();!(t=i.n()).done;){var o,s,d=t.value;a.add(d.element);var c=n.get(d.element),u=r.has(d.element),p=K(K({},l),{},{self:d});null==c||null==(o=c.onDropTargetChange)||o.call(c,p),u||null==c||null==(s=c.onDragLeave)||s.call(c,p)}}catch(e){i.e(e)}finally{i.f()}var m,x=W(l.location.current.dropTargets);try{for(x.s();!(m=x.n()).done;){var h,f,g=m.value;if(!a.has(g.element)){var v=K(K({},l),{},{self:g}),y=n.get(g.element);null==y||null==(h=y.onDropTargetChange)||h.call(y,v),null==y||null==(f=y.onDragEnter)||f.call(y,v)}}}catch(e){x.e(e)}finally{x.f()}}};return{dropTargetForConsumers:function(e){return T(Y(_(e.element,{attribute:r,value:"true"}),(n.set(e.element,e),function(){return n.delete(e.element)})))},getIsOver:function(e){var t=e.source,r=e.target,i=e.input,o=e.current,s=function e(t){var r,i,o,s,d=t.source,c=t.target,u=t.input,p=t.result,m=void 0===p?[]:p;if(null==c)return m;if(!(c instanceof Element))return c instanceof Node?e({source:d,target:c.parentElement,input:u,result:m}):m;var x=c.closest(a);if(null==x)return m;var h=n.get(x);if(null==h)return m;var f={input:u,source:d,element:h.element};if(h.canDrop&&!h.canDrop(f))return e({source:d,target:h.element.parentElement,input:u,result:m});var g=null!=(r=null==(i=h.getData)?void 0:i.call(h,f))?r:{},v=null!=(o=null==(s=h.getDropEffect)?void 0:s.call(h,f))?o:l,y={data:g,element:h.element,dropEffect:v,isActiveDueToStickiness:!1};return e({source:d,target:h.element.parentElement,input:u,result:[].concat(O(m),[y])})}({source:t,target:r,input:i});if(s.length>=o.length)return s;for(var d=X(o),c=X(s),u=[],p=0;p<d.length;p++){var m,x=d[p],h=c[p];if(null!=h){u.push(h);continue}var f=u[p-1],g=d[p-1];if((null==f?void 0:f.element)!==(null==g?void 0:g.element))break;var v=n.get(x.element);if(!v)break;var y={input:i,source:t,element:v.element};if(v.canDrop&&!v.canDrop(y)||!(null!=(m=v.getIsSticky)&&m.call(v,y)))break;u.push(K(K({},x),{},{isActiveDueToStickiness:!0}))}return X(u)},dispatchEvent:function(e){o[e.eventName](e)}}}({typeKey:t,defaultDropEffect:a});function s(e){null==n||n(e),o.dispatchEvent(e),i.dispatchEvent(e),null==r||r(e)}function d(e){H({event:e.event,dragType:e.dragType,getDropTargetsOver:o.getIsOver,dispatchEvent:s})}return{registerUsage:function(){var e,n;return n=function(e){var t=e.typeKey,l=e.mount,n=G.get(t);if(n)return n.usageCount++,n;var r={typeKey:t,unmount:l(),usageCount:1};return G.set(t,r),r}(e={typeKey:t,mount:function(){return l({canStart:$,start:d})}}),function(){n.usageCount--,n.usageCount>0||(n.unmount(),G.delete(e.typeKey))}},dropTarget:o.dropTargetForConsumers,monitor:i.monitorForConsumers}}({typeKey:"element",defaultDropEffect:"move",mount:function(e){return Y(el.bindEvents(),(0,v.bind)(document,{type:"dragstart",listener:function(t){if(e.canStart(t)&&!t.defaultPrevented&&t.dataTransfer){var l,n,r,a,i,o,s=t.target;if(s instanceof HTMLElement){var d=et.get(s);if(d){var c=B(t),u={element:d.element,dragHandle:null!=(l=d.dragHandle)?l:null,input:c};if(d.canDrag&&!d.canDrag(u))return void t.preventDefault();if(d.dragHandle){var p=j({x:c.clientX,y:c.clientY});if(!d.dragHandle.contains(p))return void t.preventDefault()}var m=null!=(n=null==(r=d.getInitialDataForExternal)?void 0:r.call(d,u))?n:null;if(m)for(var x=0,h=Object.entries(m);x<h.length;x++){var f=g(h[x],2),v=f[0],y=f[1];t.dataTransfer.setData(v,null!=y?y:"")}!Z()||t.dataTransfer.types.includes(ee)||t.dataTransfer.types.includes("text/uri-list")||t.dataTransfer.setData(ee,"pdnd:android-fallback"),t.dataTransfer.setData("application/vnd.pdnd","");var b={element:d.element,dragHandle:null!=(a=d.dragHandle)?a:null,data:null!=(i=null==(o=d.getInitialData)?void 0:o.call(d,u))?i:{}};e.start({event:t,dragType:{type:"element",payload:b,startedFrom:"internal"}})}}}}}))},dispatchEventToSource:function(e){var t,l,n=e.eventName,r=e.payload;null==(t=et.get(r.source.element))||null==(l=t[n])||l.call(t,r)},onPostDispatch:el.getOnPostDispatch()}),er=en.dropTarget;function ea(e){return T(Y(en.registerUsage(),(et.set(e.element,e),function(){et.delete(e.element)}),_(e.element,{attribute:"draggable",value:"true"})))}en.monitor;let ei=(0,d.createContext)({designable:!1,plugins:[],schema:{info:{},datasources:[],scripts:[],variables:[],items:[]},selectedItem:null,setSchema:()=>{},setSelectedItem:()=>{},updateSelectedItem:()=>{},forceUpdate:()=>{}}),eo=e=>{let{designable:t,plugins:l,schema:n,selectedItem:r,setSchema:a,setSelectedItem:i,children:o}=e;return(0,s.jsx)(ei.Provider,{value:{designable:!!t,plugins:l||[],schema:n,selectedItem:r,setSchema:a||(()=>{}),setSelectedItem:i||(()=>{}),updateSelectedItem:e=>{null==i||i(Object.assign(r,e||{})),null==a||a({...n})},forceUpdate:()=>{null==a||a({...n})}},children:o})},es=e=>{var t;let{item:l,onDelete:n,parentList:r,onListChange:a,index:i}=e,{designable:o,selectedItem:c,setSelectedItem:u,plugins:p}=(0,d.useContext)(ei),[m,x]=(0,d.useState)(!1),h=null==(t=p.find(e=>e.key===l.type))?void 0:t.component;return((0,d.useEffect)(()=>{let e=()=>{if(!t.current)return;let e=document.getElementById(`page-item-${l.id}`);if(!e)return void r();let n=e.getBoundingClientRect();if(0===n.width&&0===n.height){t.current.style.display="none";return}t.current.style.display="flex";let a=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,i=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;t.current.style.top=`${n.top+a-22}px`,t.current.style.left=`${n.left+i-1}px`},t={current:null},r=()=>{if(t.current){let l=t.current.querySelector("a");l&&l.removeEventListener("click",a),document.body.contains(t.current)&&document.body.removeChild(t.current),t.current=null,window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},a=e=>{e.stopPropagation(),n&&n()};if(c&&c===l&&o){let n=document.createElement("div");n.style.position="absolute",n.style.zIndex="9999",n.style.display="flex",n.style.gap="4px";let i=document.createElement("span");i.innerText=l.name||l.type+`(${l.id})`,i.style.background="#1890ff",i.style.color="#fff",i.style.fontSize="12px",i.style.borderTopLeftRadius="4px",i.style.borderTopRightRadius="4px",i.style.padding="2px 8px",i.style.cursor="pointer",i.style.userSelect="none",n.appendChild(i);let o=document.createElement("a");return o.innerText="X",o.style.background="#1890ff",o.style.color="#fff",o.style.fontSize="12px",o.style.borderTopLeftRadius="4px",o.style.borderTopRightRadius="4px",o.style.padding="2px 8px",o.style.cursor="pointer",o.style.userSelect="none",n.appendChild(o),o.addEventListener("click",a),document.body.appendChild(n),t.current=n,e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>r()}},[c,o,l,n]),(0,d.useEffect)(()=>{let e=document.getElementById(`page-item-${l.id}`);if(!e||!o)return;let t=ea({element:e,getInitialData:()=>({id:l.id,index:i,list:r,onListChange:a,data:l}),canDrag:()=>!!o,onDragStart:()=>{x(!0)},onDrop:()=>{x(!1)}}),n=e=>{e.stopPropagation(),u&&u(l)};return o&&e.addEventListener("click",n),()=>{t(),o&&e.removeEventListener("click",n)}},[o,l,i,r]),h)?(0,s.jsx)(h,{id:`page-item-${l.id}`,"data-item-id":l.id,...l.props||{},item:l,className:`page-item-component ${o?"designable":""} ${c===l?"selected":""}`,style:{...l.style||{},opacity:m?.5:1}}):null},ed=x().div`
3
3
  position: absolute;
4
4
  background: #1890ff;
5
5
  pointer-events: none;
@@ -41,7 +41,7 @@
41
41
  &::before { left: -3px; top: -4px; }
42
42
  &::after { left: -3px; bottom: -4px; }
43
43
  `}
44
- `,ec=(e,t,l,n)=>{let r=e.getBoundingClientRect(),a=Array.from(e.children).filter(e=>!e.classList.contains("drop-indicator")&&e.getBoundingClientRect().width>0),i=(e=>{let t=Array.from(e.children).filter(e=>!e.classList.contains("drop-indicator")&&e.getBoundingClientRect().width>0);if(0===t.length){let t=window.getComputedStyle(e),{display:l,flexDirection:n}=t;return"flex"===l||"inline-flex"===l?!n.includes("column"):"grid"===l&&!t.gridAutoFlow.includes("column")}if(1===t.length){let l=window.getComputedStyle(t[0]),n=window.getComputedStyle(e);return"flex"===n.display||"inline-flex"===n.display?!n.flexDirection.includes("column"):!!["inline","inline-block","inline-flex"].includes(l.display)||"none"!==l.float}let l=0,n=0,r=t.map(e=>{let t=e.getBoundingClientRect(),r=t.left+t.width/2,a=t.top+t.height/2;return l+=r,n+=a,{cx:r,cy:a}}),a=l/t.length,i=n/t.length,o=0,s=0;return r.forEach(e=>{o+=(e.cx-a)**2,s+=(e.cy-i)**2}),o>=s})(e),o=e.scrollLeft,s=e.scrollTop;if(0===a.length)return{index:0,indicatorOffset:15,isHorizontal:i};let d=(e,t)=>i?(t?e.left:e.right)-r.left+o+(t?-4:4):(t?e.top:e.bottom)-r.top+s+(t?-4:4),c=e=>{let t=e.getAttribute("data-item-id");if(t){let e=n.findIndex(e=>e.id===t);if(-1!==e)return e}return a.indexOf(e)};for(let e=0;e<a.length;e++){let n=a[e].getBoundingClientRect();if(t>=n.left-5&&t<=n.right+5&&l>=n.top-5&&l<=n.bottom+5){let r=i?t<n.left+n.width/2:l<n.top+n.height/2,o=c(a[e]);return{index:r?o:o+1,indicatorOffset:d(n,r),isHorizontal:i}}}let u=1/0,p=!1,m=null,x=null;for(let e=0;e<a.length;e++){let n=a[e].getBoundingClientRect(),r=n.left+n.width/2,o=n.top+n.height/2,s=(t-r)**2+(l-o)**2;s<u&&(u=s,m=n,x=a[e],p=i?t<r:l<o)}if(x&&m){let e=c(x);return{index:p?e:e+1,indicatorOffset:d(m,p),isHorizontal:i}}let h=a[a.length-1].getBoundingClientRect();return{index:n.length,indicatorOffset:d(h,!1),isHorizontal:i}},eu=e=>{let{rootComponent:t="div",rootData:l={},list:n=[],item:r,onListChange:a,className:i}=e,{designable:o,selectedItem:c,setSelectedItem:u,forceUpdate:p}=(0,d.useContext)(ei),m=(0,d.useRef)(null),[x,h]=(0,d.useState)(!1),[f,g]=(0,d.useState)(0),[v,b]=(0,d.useState)(!1),[y,j]=(0,d.useState)(!1),C=(0,d.useRef)(n),w=(0,d.useRef)(a);(0,d.useEffect)(()=>{C.current=n,w.current=a},[n,a]);let S=(0,d.useMemo)(()=>n||[],[n]);(0,d.useEffect)(()=>{let e=m.current;if(!e)return;let t=er({element:e,canDrop:e=>{let{source:t,element:l}=e;if(!o)return!1;let{data:n}=t.data||{};return(!l.classList.contains("ant-row")||(null==n?void 0:n.type)==="b-col")&&(!!l.classList.contains("ant-row")||(null==n?void 0:n.type)!=="b-col")},getData:()=>({localList:C.current}),onDragEnter:t=>{if(!o)return!1;let[l]=t.location.current.dropTargets;if((null==l?void 0:l.element)!==e)return;h(!0),j(!0);let n=t.location.current.input.clientY,{indicatorOffset:r,isHorizontal:a}=ec(e,t.location.current.input.clientX,n,C.current||[]);g(r),b(a)},onDrag:t=>{if(!o)return!1;let[l]=t.location.current.dropTargets;if((null==l?void 0:l.element)!==e){h(!1),j(!1);return}h(!0),j(!0);let n=t.location.current.input.clientY,{indicatorOffset:r,isHorizontal:a}=ec(e,t.location.current.input.clientX,n,C.current||[]);g(r),b(a)},onDragLeave:()=>{if(!o)return!1;h(!1),j(!1)},onDrop(t){if(!o)return!1;let[l]=t.location.current.dropTargets;if((null==l?void 0:l.element)!==e)return;h(!1),j(!1);let{data:n,list:r,onListChange:a,index:i}=t.source.data;null==u||u(n);let s=C.current||[],d=w.current,c=r===s||s.some(e=>e.id===n.id),p=t.location.current.input.clientY,{index:m}=ec(e,t.location.current.input.clientX,p,s);if(r)if(c){let e=[...s],t=e.findIndex(e=>e.id===n.id);if(-1!==t){let[l]=e.splice(t,1);e.splice(m>t?m-1:m,0,l),null==d||d(e)}else e.splice(m,0,n),null==d||d(e)}else{a&&r&&a(r.filter(e=>e.id!==n.id));let e=[...s];e.some(e=>e.id===n.id)||(e.splice(m,0,n),null==d||d(e))}else{let e=[...s];e.splice(m,0,n),null==d||d(e)}}});return()=>t()},[]);let I=[i,"drag-container","page-item-component",!n.length?"empty-container":"",c===r?"selected":"",o?"designable":""].filter(Boolean).join(" ");return(0,s.jsxs)(t,{...l||{},ref:m,className:I,style:{...null==l?void 0:l.style,position:"relative",minHeight:o?24:void 0,outline:x?"1px dashed #1890ff":void 0},children:[(0,s.jsx)(ed,{className:"drop-indicator",$offset:f,$vertical:v,$visible:y}),(Array.isArray(S)?S:[]).filter(Boolean).map((e,t)=>(0,s.jsx)(es,{item:e,parentList:S,onListChange:a,index:t,onDelete:()=>null==a?void 0:a(S.filter(t=>t.id!==e.id))},e.id||t))]})},ep=eu,em=(0,d.createContext)({deviceWidth:0,env:{global:{},local:{}},callbacks:{},initCallback:e=>{let{id:t,callback:l}=e}}),ex=e=>{let{deviceWidth:t,env:l,callbacks:n,initCallback:r,children:a}=e;return(0,s.jsx)(em.Provider,{value:{deviceWidth:t,env:l,callbacks:n,initCallback:r},children:a})},eh=x().div`
44
+ `,ec=(e,t,l,n)=>{let r=e.getBoundingClientRect(),a=Array.from(e.children).filter(e=>!e.classList.contains("drop-indicator")&&e.getBoundingClientRect().width>0),i=(e=>{let t=Array.from(e.children).filter(e=>!e.classList.contains("drop-indicator")&&e.getBoundingClientRect().width>0);if(0===t.length){let t=window.getComputedStyle(e),{display:l,flexDirection:n}=t;return"flex"===l||"inline-flex"===l?!n.includes("column"):"grid"===l&&!t.gridAutoFlow.includes("column")}if(1===t.length){let l=window.getComputedStyle(t[0]),n=window.getComputedStyle(e);return"flex"===n.display||"inline-flex"===n.display?!n.flexDirection.includes("column"):!!["inline","inline-block","inline-flex"].includes(l.display)||"none"!==l.float}let l=0,n=0,r=t.map(e=>{let t=e.getBoundingClientRect(),r=t.left+t.width/2,a=t.top+t.height/2;return l+=r,n+=a,{cx:r,cy:a}}),a=l/t.length,i=n/t.length,o=0,s=0;return r.forEach(e=>{o+=(e.cx-a)**2,s+=(e.cy-i)**2}),o>=s})(e),o=e.scrollLeft,s=e.scrollTop;if(0===a.length)return{index:0,indicatorOffset:15,isHorizontal:i};let d=(e,t)=>i?(t?e.left:e.right)-r.left+o+(t?-4:4):(t?e.top:e.bottom)-r.top+s+(t?-4:4),c=e=>{let t=e.getAttribute("data-item-id");if(t){let e=n.findIndex(e=>e.id===t);if(-1!==e)return e}return a.indexOf(e)};for(let e=0;e<a.length;e++){let n=a[e].getBoundingClientRect();if(t>=n.left-5&&t<=n.right+5&&l>=n.top-5&&l<=n.bottom+5){let r=i?t<n.left+n.width/2:l<n.top+n.height/2,o=c(a[e]);return{index:r?o:o+1,indicatorOffset:d(n,r),isHorizontal:i}}}let u=1/0,p=!1,m=null,x=null;for(let e=0;e<a.length;e++){let n=a[e].getBoundingClientRect(),r=n.left+n.width/2,o=n.top+n.height/2,s=(t-r)**2+(l-o)**2;s<u&&(u=s,m=n,x=a[e],p=i?t<r:l<o)}if(x&&m){let e=c(x);return{index:p?e:e+1,indicatorOffset:d(m,p),isHorizontal:i}}let h=a[a.length-1].getBoundingClientRect();return{index:n.length,indicatorOffset:d(h,!1),isHorizontal:i}},eu=e=>{let{rootComponent:t="div",rootData:l={},list:n=[],item:r,onListChange:a,className:i}=e,{designable:o,selectedItem:c,setSelectedItem:u,forceUpdate:p}=(0,d.useContext)(ei),m=(0,d.useRef)(null),[x,h]=(0,d.useState)(!1),[f,g]=(0,d.useState)(0),[v,y]=(0,d.useState)(!1),[b,j]=(0,d.useState)(!1),C=(0,d.useRef)(n),w=(0,d.useRef)(a);(0,d.useEffect)(()=>{C.current=n,w.current=a},[n,a]);let S=(0,d.useMemo)(()=>n||[],[n]);(0,d.useEffect)(()=>{let e=m.current;if(!e)return;let t=er({element:e,canDrop:e=>{let{source:t,element:l}=e;if(!o)return!1;let{data:n}=t.data||{};return(!l.classList.contains("ant-row")||(null==n?void 0:n.type)==="b-col")&&(!!l.classList.contains("ant-row")||(null==n?void 0:n.type)!=="b-col")},getData:()=>({localList:C.current}),onDragEnter:t=>{if(!o)return!1;let[l]=t.location.current.dropTargets;if((null==l?void 0:l.element)!==e)return;h(!0),j(!0);let n=t.location.current.input.clientY,{indicatorOffset:r,isHorizontal:a}=ec(e,t.location.current.input.clientX,n,C.current||[]);g(r),y(a)},onDrag:t=>{if(!o)return!1;let[l]=t.location.current.dropTargets;if((null==l?void 0:l.element)!==e){h(!1),j(!1);return}h(!0),j(!0);let n=t.location.current.input.clientY,{indicatorOffset:r,isHorizontal:a}=ec(e,t.location.current.input.clientX,n,C.current||[]);g(r),y(a)},onDragLeave:()=>{if(!o)return!1;h(!1),j(!1)},onDrop(t){if(!o)return!1;let[l]=t.location.current.dropTargets;if((null==l?void 0:l.element)!==e)return;h(!1),j(!1);let{data:n,list:r,onListChange:a,index:i}=t.source.data;null==u||u(n);let s=C.current||[],d=w.current,c=r===s||s.some(e=>e.id===n.id),p=t.location.current.input.clientY,{index:m}=ec(e,t.location.current.input.clientX,p,s);if(r)if(c){let e=[...s],t=e.findIndex(e=>e.id===n.id);if(-1!==t){let[l]=e.splice(t,1);e.splice(m>t?m-1:m,0,l),null==d||d(e)}else e.splice(m,0,n),null==d||d(e)}else{a&&r&&a(r.filter(e=>e.id!==n.id));let e=[...s];e.some(e=>e.id===n.id)||(e.splice(m,0,n),null==d||d(e))}else{let e=[...s];e.splice(m,0,n),null==d||d(e)}}});return()=>t()},[]);let I=[i,"drag-container","page-item-component",!n.length?"empty-container":"",c===r?"selected":"",o?"designable":""].filter(Boolean).join(" ");return(0,s.jsxs)(t,{...l||{},ref:m,className:I,style:{...null==l?void 0:l.style,position:"relative",minHeight:o?24:void 0,outline:x?"1px dashed #1890ff":void 0},children:[(0,s.jsx)(ed,{className:"drop-indicator",$offset:f,$vertical:v,$visible:b}),(Array.isArray(S)?S:[]).filter(Boolean).map((e,t)=>(0,s.jsx)(es,{item:e,parentList:S,onListChange:a,index:t,onDelete:()=>null==a?void 0:a(S.filter(t=>t.id!==e.id))},e.id||t))]})},ep=eu,em=(0,d.createContext)({deviceWidth:0,env:{global:{},local:{}},callbacks:{},initCallback:e=>{let{id:t,callback:l}=e}}),ex=e=>{let{deviceWidth:t,env:l,callbacks:n,initCallback:r,children:a}=e;return(0,s.jsx)(em.Provider,{value:{deviceWidth:t,env:l,callbacks:n,initCallback:r},children:a})},eh=x().div`
45
45
  .empty-container.designable {
46
46
  min-width: 10px;
47
47
  min-height: 30px;
@@ -75,7 +75,7 @@
75
75
  outline: 1px solid #1890ff;
76
76
  }
77
77
  }
78
- `,ef=c().forwardRef(function(e,t){let{device:l="desktop"}=e,{schema:n,forceUpdate:r}=(0,d.useContext)(ei),a=(0,d.useRef)(null),[i,o]=(0,d.useState)(0),[c,u]=(0,d.useState)({}),[p,m]=(0,d.useState)({global:{},local:{}}),x=(0,d.useMemo)(()=>n.items||[],[n.items]),[h,f]=(0,d.useState)(x);(0,d.useEffect)(()=>{f(n.items||[])},[n.items]),(0,d.useEffect)(()=>{let e={};(n.variables||[]).forEach(t=>{e[t.name]=t.value}),m(t=>({...t,global:e}))},[n.variables]);let g=()=>{var e;let t=null==(e=a.current)?void 0:e.parentElement,l=null==t?void 0:t.getBoundingClientRect(),n=(null==l?void 0:l.width)||0;n<=100?setTimeout(g,10):o(n?n-36:0)};return(0,d.useEffect)(()=>{g()},[l]),(0,d.useEffect)(()=>{let e=()=>g();return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,d.useImperativeHandle)(t,()=>({handleResize(){g()},get dom(){return a.current}})),(0,s.jsx)(ex,{deviceWidth:i,env:p,callbacks:c,initCallback:e=>{let{id:t,callback:l}=e;u(e=>({...e,[t]:l}))},children:(0,s.jsx)(eh,{ref:a,children:(0,s.jsx)(eu,{list:h,onListChange:e=>{let t=[...e];n.items=t,f(t),null==r||r()},className:"page-canvas"})})})}),eg=ef;var ev=u(375),eb=u(59);let ey=(0,ev.createFromIconfontCN)({scriptUrl:"https://at.alicdn.com/t/c/font_5072483_pswdqptbsip.js"}),ej=e=>{let{type:t,className:l=""}=e;return(0,s.jsx)(ey,{type:t,className:l})},eC=x().div`
78
+ `,ef=c().forwardRef(function(e,t){let{device:l="desktop"}=e,{schema:n,forceUpdate:r}=(0,d.useContext)(ei),a=(0,d.useRef)(null),[i,o]=(0,d.useState)(0),[c,u]=(0,d.useState)({}),[p,m]=(0,d.useState)({global:{},local:{}}),x=(0,d.useMemo)(()=>n.items||[],[n.items]),[h,f]=(0,d.useState)(x);(0,d.useEffect)(()=>{f(n.items||[])},[n.items]),(0,d.useEffect)(()=>{let e={};(n.variables||[]).forEach(t=>{e[t.name]=t.value}),m(t=>({...t,global:e}))},[n.variables]);let g=()=>{var e;let t=null==(e=a.current)?void 0:e.parentElement,l=null==t?void 0:t.getBoundingClientRect(),n=(null==l?void 0:l.width)||0;n<=100?setTimeout(g,10):o(n?n-36:0)};return(0,d.useEffect)(()=>{g()},[l]),(0,d.useEffect)(()=>{let e=()=>g();return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,d.useImperativeHandle)(t,()=>({handleResize(){g()},get dom(){return a.current}})),(0,s.jsx)(ex,{deviceWidth:i,env:p,callbacks:c,initCallback:e=>{let{id:t,callback:l}=e;u(e=>({...e,[t]:l}))},children:(0,s.jsx)(eh,{ref:a,children:(0,s.jsx)(eu,{list:h,onListChange:e=>{let t=[...e];n.items=t,f(t),null==r||r()},className:"page-canvas"})})})}),eg=ef;var ev=u(375),ey=u(59);let eb=(0,ev.createFromIconfontCN)({scriptUrl:"https://at.alicdn.com/t/c/font_5072483_pswdqptbsip.js"}),ej=e=>{let{type:t,className:l=""}=e;return(0,s.jsx)(eb,{type:t,className:l})},eC=x().div`
79
79
  width: 100%;
80
80
  padding: 0 12px;
81
81
  border-bottom: solid 1px #e8e8e8;
@@ -318,7 +318,7 @@
318
318
  .send-btn.send-btn-active {
319
319
  background-color: var(--chat-blue);
320
320
  }
321
- `,ez=[],ek=[],eO=c().forwardRef((e,t)=>{let{value:l="",placeholder:n="请输入需求,例如:分析 2025 年人口结构并生成可视化报告",disabled:r=!1,sending:a=!1,rows:i=6,agentList:o=ez,title:c="",agentId:u=null,attachments:p=ek,onInput:m,onSubmit:x,onUpdateTitle:h,onUpdateAgentId:f,onUpdateAttachments:g}=e,v=(0,d.useRef)(null),[b,y]=(0,d.useState)(c||""),[j,C]=(0,d.useState)(u||null),[w,S]=(0,d.useState)(null),[I,z]=(0,d.useState)(l||""),[k,O]=(0,d.useState)(0),[T,R]=(0,d.useState)(!1),[F,D]=(0,d.useState)(Array.isArray(p)?p:[]),N=(0,d.useMemo)(()=>!1,[]);(0,d.useImperativeHandle)(t,()=>({focus(){var e;null==(e=v.current)||e.focus()}})),(0,d.useEffect)(()=>z(l||""),[l]),(0,d.useEffect)(()=>{m&&m(I)},[I]),(0,d.useEffect)(()=>y(c||""),[c]),(0,d.useEffect)(()=>{C(u||null),S(u&&o.find(e=>e.id===u)||null)},[u,o]),(0,d.useEffect)(()=>D(Array.isArray(p)?p:[]),[p]);let E=!!(I&&I.trim());(0,d.useMemo)(()=>j&&o.find(e=>e.id===j)||null,[j,o]);let A=async e=>{let t=eS.read(e,{type:"array",cellDates:!0,dateNF:"yyyy-mm-dd hh:mm:ss"}),l={};return t.SheetNames.forEach(e=>{let n=t.Sheets[e],r=eS.utils.sheet_to_csv(n);l[e]=r}),l},B=()=>{if(!E||a)return;let e=Date.now();if(e-k<400)return;O(e);let t=(I||"").trim();if(!t)return;let l={demand:t,title:T?b:"",agentId:j||void 0,csvData:F.reduce((e,t)=>({...e,[t.name]:t.csvBySheet}),{})};x&&x(l),z("")},L=(0,s.jsx)("div",{style:{maxHeight:400,overflow:"auto",background:"#fff"},children:(0,s.jsx)("ul",{className:"agent-list",children:o.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)("a",{onClick:()=>{let t;C(t=e.id||null),f&&f(t),S(e)},children:e.name})},String(e.id)))})});return(0,s.jsx)(eI,{children:(0,s.jsxs)("div",{className:"chat-input",children:[(0,s.jsxs)("div",{className:"input-stack",children:[F.length>0&&(0,s.jsx)("div",{className:"attachment-bar",children:F.map(e=>(0,s.jsxs)(eb.Tooltip,{title:e.name,className:"attachment-card",children:[(0,s.jsx)("svg",{style:{width:25,height:25},viewBox:"0 0 24 24",children:(0,s.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",fill:"#1f6f43"})}),(0,s.jsx)("span",{className:"name",children:e.name}),(0,s.jsx)("a",{className:"remove",onClick:()=>{var t;let l;return t=e.uid,void(D(l=F.filter(e=>e.uid!==t)),g&&g(l))},children:"\xd7"})]},e.uid))}),w&&(0,s.jsxs)("div",{className:"agent-info",children:[(0,s.jsxs)("span",{className:"name",children:["@ ",w.name]}),(0,s.jsx)("a",{className:"remove",onClick:()=>{C(null),f&&f(null),S(null)},children:"\xd7"})]}),T&&(0,s.jsx)(eb.Input,{className:"title-input",placeholder:"请输入报告标题(可选)",disabled:r||a,value:b,onChange:e=>{let t=e.target.value;y(t),h&&h(t)}}),(0,s.jsx)(eb.Input.TextArea,{ref:v,className:"input textarea-stacked",placeholder:n,disabled:r||a,autoSize:{minRows:i,maxRows:i},value:I,onPressEnter:e=>{"Enter"===e.key&&(e.shiftKey||(e.preventDefault(),B()))},onChange:e=>z(e.target.value)})]}),(0,s.jsxs)("div",{className:"footer",children:[(0,s.jsxs)("div",{className:"left",children:[(0,s.jsx)(eb.Dropdown,{trigger:["click"],popupRender:()=>L,placement:"topLeft",children:(0,s.jsx)(eb.Tooltip,{title:"选择助理",children:(0,s.jsx)(eb.Button,{className:"agent-trigger",onClick:e=>e.preventDefault(),children:"@"})})}),(0,s.jsxs)("div",{className:"title-toggle",children:[(0,s.jsx)("span",{className:"label",children:"标题"}),(0,s.jsx)(eb.Switch,{size:"small",checked:T,disabled:r||a,onChange:e=>R(e)})]}),(0,s.jsx)(eb.Upload,{multiple:!0,accept:".xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",beforeUpload:e=>{let t="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"===e.type||!e.type,l=(e.name||"").toLowerCase().endsWith(".xlsx");if(!t||!l)return eb.Upload.LIST_IGNORE;let n=new FileReader;return n.onload=async t=>{try{var l;let n=null==(l=t.target)?void 0:l.result,r=await A(n),a=[...F,{uid:`${Date.now()}_${Math.random()}`,name:e.name,size:e.size,csvBySheet:r}];D(a),g&&g(a)}catch{}},n.readAsArrayBuffer(e),!1},showUploadList:!1,disabled:r||a,children:(0,s.jsx)(eb.Tooltip,{title:"上传 Excel 数据",children:(0,s.jsx)(eb.Button,{className:"attach-upload",icon:(0,s.jsx)(ev.PaperClipOutlined,{})})})})]}),(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[!N&&(0,s.jsx)("div",{className:"tips",children:"按 Enter 发送,Shift+Enter 换行"}),(0,s.jsx)("a",{className:`send-btn ${!a&&(null==I?void 0:I.length)>0?"send-btn-active":""}`,onClick:B,children:(0,s.jsx)(ev.SendOutlined,{})})]})]})]})})}),eT=x().div`
321
+ `,ez=[],ek=[],eO=c().forwardRef((e,t)=>{let{value:l="",placeholder:n="请输入需求,例如:分析 2025 年人口结构并生成可视化报告",disabled:r=!1,sending:a=!1,rows:i=6,agentList:o=ez,title:c="",agentId:u=null,attachments:p=ek,onInput:m,onSubmit:x,onUpdateTitle:h,onUpdateAgentId:f,onUpdateAttachments:g}=e,v=(0,d.useRef)(null),[y,b]=(0,d.useState)(c||""),[j,C]=(0,d.useState)(u||null),[w,S]=(0,d.useState)(null),[I,z]=(0,d.useState)(l||""),[k,O]=(0,d.useState)(0),[T,R]=(0,d.useState)(!1),[F,D]=(0,d.useState)(Array.isArray(p)?p:[]),N=(0,d.useMemo)(()=>!1,[]);(0,d.useImperativeHandle)(t,()=>({focus(){var e;null==(e=v.current)||e.focus()}})),(0,d.useEffect)(()=>z(l||""),[l]),(0,d.useEffect)(()=>{m&&m(I)},[I]),(0,d.useEffect)(()=>b(c||""),[c]),(0,d.useEffect)(()=>{C(u||null),S(u&&o.find(e=>e.id===u)||null)},[u,o]),(0,d.useEffect)(()=>D(Array.isArray(p)?p:[]),[p]);let E=!!(I&&I.trim());(0,d.useMemo)(()=>j&&o.find(e=>e.id===j)||null,[j,o]);let A=async e=>{let t=eS.read(e,{type:"array",cellDates:!0,dateNF:"yyyy-mm-dd hh:mm:ss"}),l={};return t.SheetNames.forEach(e=>{let n=t.Sheets[e],r=eS.utils.sheet_to_csv(n);l[e]=r}),l},B=()=>{if(!E||a)return;let e=Date.now();if(e-k<400)return;O(e);let t=(I||"").trim();if(!t)return;let l={demand:t,title:T?y:"",agentId:j||void 0,csvData:F.reduce((e,t)=>({...e,[t.name]:t.csvBySheet}),{})};x&&x(l),z("")},P=(0,s.jsx)("div",{style:{maxHeight:400,overflow:"auto",background:"#fff"},children:(0,s.jsx)("ul",{className:"agent-list",children:o.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)("a",{onClick:()=>{let t;C(t=e.id||null),f&&f(t),S(e)},children:e.name})},String(e.id)))})});return(0,s.jsx)(eI,{children:(0,s.jsxs)("div",{className:"chat-input",children:[(0,s.jsxs)("div",{className:"input-stack",children:[F.length>0&&(0,s.jsx)("div",{className:"attachment-bar",children:F.map(e=>(0,s.jsxs)(ey.Tooltip,{title:e.name,className:"attachment-card",children:[(0,s.jsx)("svg",{style:{width:25,height:25},viewBox:"0 0 24 24",children:(0,s.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",fill:"#1f6f43"})}),(0,s.jsx)("span",{className:"name",children:e.name}),(0,s.jsx)("a",{className:"remove",onClick:()=>{var t;let l;return t=e.uid,void(D(l=F.filter(e=>e.uid!==t)),g&&g(l))},children:"\xd7"})]},e.uid))}),w&&(0,s.jsxs)("div",{className:"agent-info",children:[(0,s.jsxs)("span",{className:"name",children:["@ ",w.name]}),(0,s.jsx)("a",{className:"remove",onClick:()=>{C(null),f&&f(null),S(null)},children:"\xd7"})]}),T&&(0,s.jsx)(ey.Input,{className:"title-input",placeholder:"请输入报告标题(可选)",disabled:r||a,value:y,onChange:e=>{let t=e.target.value;b(t),h&&h(t)}}),(0,s.jsx)(ey.Input.TextArea,{ref:v,className:"input textarea-stacked",placeholder:n,disabled:r||a,autoSize:{minRows:i,maxRows:i},value:I,onPressEnter:e=>{"Enter"===e.key&&(e.shiftKey||(e.preventDefault(),B()))},onChange:e=>z(e.target.value)})]}),(0,s.jsxs)("div",{className:"footer",children:[(0,s.jsxs)("div",{className:"left",children:[(0,s.jsx)(ey.Dropdown,{trigger:["click"],popupRender:()=>P,placement:"topLeft",children:(0,s.jsx)(ey.Tooltip,{title:"选择助理",children:(0,s.jsx)(ey.Button,{className:"agent-trigger",onClick:e=>e.preventDefault(),children:"@"})})}),(0,s.jsxs)("div",{className:"title-toggle",children:[(0,s.jsx)("span",{className:"label",children:"标题"}),(0,s.jsx)(ey.Switch,{size:"small",checked:T,disabled:r||a,onChange:e=>R(e)})]}),(0,s.jsx)(ey.Upload,{multiple:!0,accept:".xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",beforeUpload:e=>{let t="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"===e.type||!e.type,l=(e.name||"").toLowerCase().endsWith(".xlsx");if(!t||!l)return ey.Upload.LIST_IGNORE;let n=new FileReader;return n.onload=async t=>{try{var l;let n=null==(l=t.target)?void 0:l.result,r=await A(n),a=[...F,{uid:`${Date.now()}_${Math.random()}`,name:e.name,size:e.size,csvBySheet:r}];D(a),g&&g(a)}catch{}},n.readAsArrayBuffer(e),!1},showUploadList:!1,disabled:r||a,children:(0,s.jsx)(ey.Tooltip,{title:"上传 Excel 数据",children:(0,s.jsx)(ey.Button,{className:"attach-upload",icon:(0,s.jsx)(ev.PaperClipOutlined,{})})})})]}),(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[!N&&(0,s.jsx)("div",{className:"tips",children:"按 Enter 发送,Shift+Enter 换行"}),(0,s.jsx)("a",{className:`send-btn ${!a&&(null==I?void 0:I.length)>0?"send-btn-active":""}`,onClick:B,children:(0,s.jsx)(ev.SendOutlined,{})})]})]})]})})}),eT=x().div`
322
322
  display: flex;
323
323
  flex-direction: column;
324
324
  height: 100%;
@@ -359,7 +359,7 @@
359
359
  .conversation-list li small {
360
360
  white-space: nowrap;
361
361
  }
362
- `,eR=[],eF=e=>{let{agentList:t=eR}=e;return(0,s.jsxs)(eT,{children:[(0,s.jsx)(ew,{title:"智能助理",extra:(0,s.jsxs)(eb.Space,{children:[(0,s.jsx)(eb.Tooltip,{title:"新对话",placement:"topRight",children:(0,s.jsx)("a",{children:(0,s.jsx)(ev.MessageOutlined,{})})}),(0,s.jsx)(eb.Tooltip,{title:"历史记录",placement:"topRight",children:(0,s.jsx)("a",{children:(0,s.jsx)(ev.HistoryOutlined,{})})})]})}),(0,s.jsxs)("div",{className:"body",children:[(0,s.jsx)("div",{style:{flex:"1 1 auto"}}),(0,s.jsx)(eb.Card,{title:"历史记录",size:"small",variant:"borderless",styles:{header:{padding:0,border:"none"},body:{padding:0}},children:(0,s.jsxs)("ul",{className:"conversation-list",children:[(0,s.jsxs)("li",{children:[(0,s.jsxs)("a",{children:[(0,s.jsx)(ev.MessageOutlined,{}),"你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好"]}),(0,s.jsx)("small",{children:"刚刚"})]}),(0,s.jsxs)("li",{children:[(0,s.jsxs)("a",{children:[(0,s.jsx)(ev.MessageOutlined,{}),"你好"]}),(0,s.jsx)("small",{children:"刚刚"})]})]})}),(0,s.jsx)(eO,{agentList:t})]})]})},eD=x().div`
362
+ `,eR=[],eF=e=>{let{agentList:t=eR}=e;return(0,s.jsxs)(eT,{children:[(0,s.jsx)(ew,{title:"智能助理",extra:(0,s.jsxs)(ey.Space,{children:[(0,s.jsx)(ey.Tooltip,{title:"新对话",placement:"topRight",children:(0,s.jsx)("a",{children:(0,s.jsx)(ev.MessageOutlined,{})})}),(0,s.jsx)(ey.Tooltip,{title:"历史记录",placement:"topRight",children:(0,s.jsx)("a",{children:(0,s.jsx)(ev.HistoryOutlined,{})})})]})}),(0,s.jsxs)("div",{className:"body",children:[(0,s.jsx)("div",{style:{flex:"1 1 auto"}}),(0,s.jsx)(ey.Card,{title:"历史记录",size:"small",variant:"borderless",styles:{header:{padding:0,border:"none"},body:{padding:0}},children:(0,s.jsxs)("ul",{className:"conversation-list",children:[(0,s.jsxs)("li",{children:[(0,s.jsxs)("a",{children:[(0,s.jsx)(ev.MessageOutlined,{}),"你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好"]}),(0,s.jsx)("small",{children:"刚刚"})]}),(0,s.jsxs)("li",{children:[(0,s.jsxs)("a",{children:[(0,s.jsx)(ev.MessageOutlined,{}),"你好"]}),(0,s.jsx)("small",{children:"刚刚"})]})]})}),(0,s.jsx)(eO,{agentList:t})]})]})},eD=x().div`
363
363
  display: flex;
364
364
  flex-direction: column;
365
365
  height: 100%;
@@ -398,7 +398,7 @@
398
398
  font-size: 16px;
399
399
  color: var(--ant-color-text-secondary);
400
400
  }
401
- `,eN=e=>{let{}=e,{schema:t,selectedItem:l,setSelectedItem:n,plugins:r,forceUpdate:a}=(0,d.useContext)(ei),i=(0,d.useMemo)(()=>(r||[]).reduce((e,t)=>(e[t.key]=t,e),{}),[r]),o=(0,d.useMemo)(()=>{let e=[],l=t=>{Array.isArray(t)&&t.forEach(t=>{e.push(t),Array.isArray(t.children)?l(t.children):"object"==typeof t.children&&t.children&&Object.keys(t.children).forEach(e=>l(t.children[e]))})};return l((null==t?void 0:t.items)||[]),e},[t]),c=(0,d.useMemo)(()=>o.reduce((e,t)=>(t.id&&(e[t.id]=t),e),{}),[o]),u=e=>{l&&(n(Object.assign(l,{cascadeIds:e})),a())};return(0,s.jsxs)(eD,{className:"cascade-panel",children:[(0,s.jsx)(ew,{title:"联动",extra:(null==l?void 0:l.cascadeIds)?(0,s.jsx)(eb.Space,{children:(0,s.jsx)(eb.Dropdown,{menu:{onClick:e=>{let{key:t}=e,n=[...(null==l?void 0:l.cascadeIds)||[]];n.push(String(t)),u&&u(n)},items:o.map(e=>{var t,l;return{key:e.id,label:(0,s.jsxs)("a",{children:[(0,s.jsx)(ej,{type:null==(t=i[e.type])?void 0:t.icon})," ",e.name||(null==(l=i[e.type])?void 0:l.label)," (",e.id,")"]})}})},placement:"bottomLeft",trigger:["click"],children:(0,s.jsxs)("a",{className:"toolbar",children:[(0,s.jsx)(ev.PlusOutlined,{}),(0,s.jsx)(ev.CaretDownOutlined,{style:{fontSize:8,verticalAlign:"sub"}})]})})}):null}),(0,s.jsx)("div",{className:"body",children:(null==l?void 0:l.cascadeIds)&&(0,s.jsx)("ul",{children:(l.cascadeIds||[]).map((e,t)=>{var n,r,a,o,d;return(0,s.jsxs)("li",{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(ej,{type:null==(n=i[null==(r=c[e])?void 0:r.type])?void 0:n.icon})," ",(null==(a=c[e])?void 0:a.name)||(null==(o=i[null==(d=c[e])?void 0:d.type])?void 0:o.label)," (",e,")"]}),(0,s.jsx)(eb.Popconfirm,{title:"确认删除吗?",okText:"确认",cancelText:"取消",onConfirm:()=>{let e=[...l.cascadeIds||[]];e.splice(t,1),u&&u(e)},children:(0,s.jsx)("a",{children:(0,s.jsx)(ev.DeleteOutlined,{})})})]},e)})})})]})};var eE=u(247),eA=u.n(eE),eB=u(965),eL=u.n(eB);let eP=()=>{let{schema:e}=(0,d.useContext)(ei),t=(0,d.useMemo)(()=>JSON.stringify(e||{},null,2),[e]);return(0,s.jsxs)("div",{className:"code-panel",style:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,s.jsx)(ew,{title:"代码",extra:(0,s.jsx)(eb.Space,{children:(0,s.jsx)(eb.Tooltip,{title:"复制到剪切板",children:(0,s.jsx)("a",{className:"toolbar",onClick:()=>{eL()(t||"")&&eb.message.success("复制成功")},children:(0,s.jsx)(ev.CopyOutlined,{})})})})}),(0,s.jsx)("div",{className:"body",style:{flex:"1 1 auto",display:"flex"},children:(0,s.jsx)(eA(),{height:"100%",defaultLanguage:"json",value:t,options:{lineNumbers:"off",readOnly:!0,minimap:{enabled:!1}}})})]})};var eM=u(315);let e$=(e,t,l,n)=>{(t.cascadeIds||[]).forEach(t=>{e.local[t]=e.local[t]||{},e.local[t][l]=n})},eq=(e,t,l)=>{let n={...e.global,...e.local[t.id||""]||{}};(t.cascadeIds||[]).forEach(e=>{let t=l[e];"function"==typeof t&&t(n)})},eG=()=>(0,eM.v4)(),eH=x().div`
401
+ `,eN=e=>{let{}=e,{schema:t,selectedItem:l,setSelectedItem:n,plugins:r,forceUpdate:a}=(0,d.useContext)(ei),i=(0,d.useMemo)(()=>(r||[]).reduce((e,t)=>(e[t.key]=t,e),{}),[r]),o=(0,d.useMemo)(()=>{let e=[],l=t=>{Array.isArray(t)&&t.forEach(t=>{e.push(t),Array.isArray(t.children)?l(t.children):"object"==typeof t.children&&t.children&&Object.keys(t.children).forEach(e=>l(t.children[e]))})};return l((null==t?void 0:t.items)||[]),e},[t]),c=(0,d.useMemo)(()=>o.reduce((e,t)=>(t.id&&(e[t.id]=t),e),{}),[o]),u=e=>{l&&(n(Object.assign(l,{cascadeIds:e})),a())};return(0,s.jsxs)(eD,{className:"cascade-panel",children:[(0,s.jsx)(ew,{title:"联动",extra:(null==l?void 0:l.cascadeIds)?(0,s.jsx)(ey.Space,{children:(0,s.jsx)(ey.Dropdown,{menu:{onClick:e=>{let{key:t}=e,n=[...(null==l?void 0:l.cascadeIds)||[]];n.push(String(t)),u&&u(n)},items:o.map(e=>{var t,l;return{key:e.id,label:(0,s.jsxs)("a",{children:[(0,s.jsx)(ej,{type:null==(t=i[e.type])?void 0:t.icon})," ",e.name||(null==(l=i[e.type])?void 0:l.label)," (",e.id,")"]})}})},placement:"bottomLeft",trigger:["click"],children:(0,s.jsxs)("a",{className:"toolbar",children:[(0,s.jsx)(ev.PlusOutlined,{}),(0,s.jsx)(ev.CaretDownOutlined,{style:{fontSize:8,verticalAlign:"sub"}})]})})}):null}),(0,s.jsx)("div",{className:"body",children:(null==l?void 0:l.cascadeIds)&&(0,s.jsx)("ul",{children:(l.cascadeIds||[]).map((e,t)=>{var n,r,a,o,d;return(0,s.jsxs)("li",{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(ej,{type:null==(n=i[null==(r=c[e])?void 0:r.type])?void 0:n.icon})," ",(null==(a=c[e])?void 0:a.name)||(null==(o=i[null==(d=c[e])?void 0:d.type])?void 0:o.label)," (",e,")"]}),(0,s.jsx)(ey.Popconfirm,{title:"确认删除吗?",okText:"确认",cancelText:"取消",onConfirm:()=>{let e=[...l.cascadeIds||[]];e.splice(t,1),u&&u(e)},children:(0,s.jsx)("a",{children:(0,s.jsx)(ev.DeleteOutlined,{})})})]},e)})})})]})};var eE=u(247),eA=u.n(eE),eB=u(965),eP=u.n(eB);let eL=()=>{let{schema:e}=(0,d.useContext)(ei),t=(0,d.useMemo)(()=>JSON.stringify(e||{},null,2),[e]);return(0,s.jsxs)("div",{className:"code-panel",style:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,s.jsx)(ew,{title:"代码",extra:(0,s.jsx)(ey.Space,{children:(0,s.jsx)(ey.Tooltip,{title:"复制到剪切板",children:(0,s.jsx)("a",{className:"toolbar",onClick:()=>{eP()(t||"")&&ey.message.success("复制成功")},children:(0,s.jsx)(ev.CopyOutlined,{})})})})}),(0,s.jsx)("div",{className:"body",style:{flex:"1 1 auto",display:"flex"},children:(0,s.jsx)(eA(),{height:"100%",defaultLanguage:"json",value:t,options:{lineNumbers:"off",readOnly:!0,minimap:{enabled:!1}}})})]})};var eM=u(315);let e$=(e,t,l,n)=>{(t.cascadeIds||[]).forEach(t=>{e.local[t]=e.local[t]||{},e.local[t][l]=n})},eq=(e,t,l)=>{let n={...e.global,...e.local[t.id||""]||{}};(t.cascadeIds||[]).forEach(e=>{let t=l[e];"function"==typeof t&&t(n)})},eH=()=>(0,eM.v4)(),eG=x().div`
402
402
  display: flex;
403
403
  flex-direction: column;
404
404
  height: 100%;
@@ -440,7 +440,7 @@
440
440
  overflow: hidden;
441
441
  font-size: 12px;
442
442
  }
443
- `,eY=e=>{let{plugin:t}=e,l=(0,d.useRef)(null);return(0,d.useEffect)(()=>{let e=l.current;if(!e)return;let n=ea({element:e,getInitialData:()=>{let e={id:eG(),type:t.key,name:t.label,...JSON.parse(JSON.stringify(t.defaultOptions||{}))};return{id:e.id,data:e}},canDrag:()=>!0,onDragStart:()=>{},onDrop:()=>{}});return()=>n()},[]),(0,s.jsxs)("div",{className:"plugin drag-move",ref:l,children:[(0,s.jsx)(ej,{className:"icon",type:t.icon}),(0,s.jsx)("div",{className:"label",children:t.label})]})},e_=()=>{let{plugins:e}=(0,d.useContext)(ei),t=(0,d.useMemo)(()=>{let t=[];return e.forEach(e=>{let l=t.find(t=>t.group===e.group);l?l.items.push(e):t.push({group:e.group,items:[e]})}),t},[e]);return(0,s.jsxs)(eH,{className:"component-panel",children:[(0,s.jsx)(ew,{title:"组件库"}),(0,s.jsx)("div",{className:"body",children:t.map(e=>(0,s.jsxs)("div",{className:"plugin-group",children:[(0,s.jsx)("div",{className:"group-title",children:e.group}),(0,s.jsx)("div",{className:"plugin-list",children:e.items.map(e=>(0,s.jsx)(eY,{plugin:e},e.key))})]},e.group))})]})},eU=x().div`
443
+ `,eY=e=>{let{plugin:t}=e,l=(0,d.useRef)(null);return(0,d.useEffect)(()=>{let e=l.current;if(!e)return;let n=ea({element:e,getInitialData:()=>{let e={id:eH(),type:t.key,name:t.label,...JSON.parse(JSON.stringify(t.defaultOptions||{}))};return{id:e.id,data:e}},canDrag:()=>!0,onDragStart:()=>{},onDrop:()=>{}});return()=>n()},[]),(0,s.jsxs)("div",{className:"plugin drag-move",ref:l,children:[(0,s.jsx)(ej,{className:"icon",type:t.icon}),(0,s.jsx)("div",{className:"label",children:t.label})]})},e_=()=>{let{plugins:e}=(0,d.useContext)(ei),t=(0,d.useMemo)(()=>{let t=[];return e.forEach(e=>{let l=t.find(t=>t.group===e.group);l?l.items.push(e):t.push({group:e.group,items:[e]})}),t},[e]);return(0,s.jsxs)(eG,{className:"component-panel",children:[(0,s.jsx)(ew,{title:"组件库"}),(0,s.jsx)("div",{className:"body",children:t.map(e=>(0,s.jsxs)("div",{className:"plugin-group",children:[(0,s.jsx)("div",{className:"group-title",children:e.group}),(0,s.jsx)("div",{className:"plugin-list",children:e.items.map(e=>(0,s.jsx)(eY,{plugin:e},e.key))})]},e.group))})]})},eU=x().div`
444
444
  display: flex;
445
445
  flex-direction: column;
446
446
  height: 100%;
@@ -477,7 +477,7 @@
477
477
  .margin-bottom-0 {
478
478
  margin-bottom: 0;
479
479
  }
480
- `,eK=()=>{let{schema:e,setSchema:t}=(0,d.useContext)(ei),[l,n]=(0,d.useState)(!1),[r,a]=(0,d.useState)(!1),[i,o]=(0,d.useState)(-1),[c,u]=(0,d.useState)({id:eG(),type:"api",name:"",url:"",method:"GET",headers:[],formData:[],body:""}),[p,m]=(0,d.useState)({id:eG(),type:"sql",name:"",query:""}),x=(0,d.useMemo)(()=>e.datasources,[e.datasources]),h=l=>{t({...e,datasources:l})},f=[{title:"键",dataIndex:"name",render:(e,t,l)=>(0,s.jsx)(eb.Input,{size:"small",value:t.name,onChange:e=>{let t=[...c.headers];t[l]={...t[l],name:e.target.value},u({...c,headers:t})}})},{title:"值",dataIndex:"value",render:(e,t,l)=>(0,s.jsx)(eb.Input,{size:"small",value:t.value,onChange:e=>{let t=[...c.headers];t[l]={...t[l],value:e.target.value},u({...c,headers:t})}})},{title:"操作",width:50,align:"center",render:(e,t,l)=>(0,s.jsx)(eb.Space,{children:(0,s.jsx)("a",{onClick:()=>{let e=[...c.headers];e.splice(l,1),u({...c,headers:e})},children:(0,s.jsx)(ev.DeleteOutlined,{})})})}];return(0,s.jsxs)(eU,{className:"datasource-panel",children:[(0,s.jsx)(ew,{title:"数据源",extra:(0,s.jsx)(eb.Space,{children:(0,s.jsx)(eb.Dropdown,{menu:{onClick:e=>{let{key:t}=e;"api"===t?(o(-1),u({id:eG(),type:"api",name:"",url:"",method:"GET",headers:[],formData:[],body:""}),n(!0)):(o(-1),m({id:eG(),type:"sql",name:"",query:""}),a(!0))},items:[{key:"api",label:(0,s.jsx)("a",{children:"API接口"})},{key:"sql",label:(0,s.jsx)("a",{children:"SQL查询"})}]},placement:"bottom",children:(0,s.jsxs)("a",{className:"toolbar",children:[(0,s.jsx)(ev.PlusOutlined,{}),(0,s.jsx)(ev.CaretDownOutlined,{style:{fontSize:8,verticalAlign:"sub"}})]})})})}),(0,s.jsx)("div",{className:"body",children:(0,s.jsx)("ul",{children:x.map((e,t)=>(0,s.jsxs)("li",{children:[(0,s.jsxs)("div",{title:e.name,children:[(0,s.jsx)(ej,{type:"icon-drag"})," ",e.name]}),(0,s.jsxs)(eb.Space,{children:[(0,s.jsx)("a",{onClick:()=>{o(t),"api"===e.type?(u({...e}),n(!0)):(m({...e}),a(!0))},children:(0,s.jsx)(ev.EditOutlined,{})}),(0,s.jsx)(eb.Popconfirm,{title:"确认删除吗?",okText:"确认",cancelText:"取消",onConfirm:()=>{let e;(e=[...x]).splice(t,1),h&&h(e)},children:(0,s.jsx)("a",{children:(0,s.jsx)(ev.DeleteOutlined,{})})})]})]},e.id))})}),(0,s.jsx)(eb.Modal,{title:"添加API接口",open:l,width:600,styles:{body:{maxHeight:"calc(100vh - 250px)",overflow:"auto"}},onCancel:()=>n(!1),footer:(0,s.jsxs)(eb.Space,{children:[(0,s.jsx)(eb.Button,{type:"primary",onClick:()=>{if(!c.name||!c.url)return;let e=[...x];-1===i?e.push(c):e[i]=c,h&&h(e),n(!1)},children:"确定"}),(0,s.jsx)(eb.Button,{onClick:()=>n(!1),children:"取消"})]}),children:(0,s.jsxs)(eb.Form,{labelCol:{span:24},wrapperCol:{span:24},children:[(0,s.jsx)(eb.Form.Item,{label:"接口名称",required:!0,children:(0,s.jsx)(eb.Input,{value:c.name,onChange:e=>u({...c,name:e.target.value})})}),(0,s.jsx)(eb.Form.Item,{label:"接口URL",required:!0,children:(0,s.jsx)(eb.Input,{value:c.url,onChange:e=>u({...c,url:e.target.value})})}),(0,s.jsx)(eb.Form.Item,{label:"请求方法",children:(0,s.jsxs)(eb.Radio.Group,{value:c.method,onChange:e=>u({...c,method:e.target.value}),children:[(0,s.jsx)(eb.Radio.Button,{value:"GET",children:"GET"}),(0,s.jsx)(eb.Radio.Button,{value:"POST",children:"POST"}),(0,s.jsx)(eb.Radio.Button,{value:"PUT",children:"PUT"}),(0,s.jsx)(eb.Radio.Button,{value:"DELETE",children:"DELETE"})]})}),(0,s.jsx)("label",{style:{display:"block",color:"#000000d9",padding:"8px 0"},children:"请求头"}),(0,s.jsx)(eb.Table,{columns:f,dataSource:c.headers,pagination:!1,locale:{emptyText:"暂无数据"},size:"small",bordered:!0,rowKey:(e,t)=>String(t)}),(0,s.jsx)(eb.Button,{size:"small",block:!0,onClick:()=>u({...c,headers:[...c.headers,{name:"",value:""}]}),children:"添加"}),(0,s.jsx)("label",{style:{display:"block",color:"#000000d9",padding:"8px 0"},children:"表单数据"}),(0,s.jsx)(eb.Table,{columns:f,dataSource:c.formData,pagination:!1,locale:{emptyText:"暂无数据"},size:"small",bordered:!0,rowKey:(e,t)=>`f-${t}`}),(0,s.jsx)(eb.Button,{size:"small",block:!0,onClick:()=>u({...c,formData:[...c.formData,{name:"",value:""}]}),children:"添加"}),(0,s.jsx)(eb.Form.Item,{label:"请求体",children:(0,s.jsx)("div",{style:{border:"1px solid var(--ant-color-border)",borderRadius:"var(--ant-border-radius)",padding:1},children:(0,s.jsx)(eA(),{height:"300px",defaultLanguage:"json",value:c.body,onChange:e=>u({...c,body:e||""}),options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,tabSize:2}})})})]})}),(0,s.jsx)(eb.Modal,{title:"添加SQL查询",open:r,width:600,styles:{body:{maxHeight:"calc(100vh - 250px)",overflow:"auto"}},onCancel:()=>a(!1),footer:(0,s.jsxs)(eb.Space,{children:[(0,s.jsx)(eb.Button,{type:"primary",onClick:()=>{if(!p.name||!p.query)return;let e=[...x];-1===i?e.push(p):e[i]=p,h&&h(e),a(!1)},children:"确定"}),(0,s.jsx)(eb.Button,{onClick:()=>a(!1),children:"取消"})]}),children:(0,s.jsxs)(eb.Form,{layout:"vertical",children:[(0,s.jsx)(eb.Form.Item,{label:"查询名称",required:!0,children:(0,s.jsx)(eb.Input,{value:p.name,onChange:e=>m({...p,name:e.target.value})})}),(0,s.jsx)(eb.Form.Item,{label:"查询语句",required:!0,children:(0,s.jsx)("div",{style:{border:"1px solid var(--ant-color-border)",borderRadius:"var(--ant-border-radius)",padding:1},children:(0,s.jsx)(eA(),{height:"300px",defaultLanguage:"sql",value:p.query,onChange:e=>m({...p,query:e||""}),options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,tabSize:2}})})})]})})]})},eW=x().div`
480
+ `,eK=()=>{let{schema:e,setSchema:t}=(0,d.useContext)(ei),[l,n]=(0,d.useState)(!1),[r,a]=(0,d.useState)(!1),[i,o]=(0,d.useState)(-1),[c,u]=(0,d.useState)({id:eH(),type:"api",name:"",url:"",method:"GET",headers:[],formData:[],body:""}),[p,m]=(0,d.useState)({id:eH(),type:"sql",name:"",query:""}),x=(0,d.useMemo)(()=>e.datasources,[e.datasources]),h=l=>{t({...e,datasources:l})},f=[{title:"键",dataIndex:"name",render:(e,t,l)=>(0,s.jsx)(ey.Input,{size:"small",value:t.name,onChange:e=>{let t=[...c.headers];t[l]={...t[l],name:e.target.value},u({...c,headers:t})}})},{title:"值",dataIndex:"value",render:(e,t,l)=>(0,s.jsx)(ey.Input,{size:"small",value:t.value,onChange:e=>{let t=[...c.headers];t[l]={...t[l],value:e.target.value},u({...c,headers:t})}})},{title:"操作",width:50,align:"center",render:(e,t,l)=>(0,s.jsx)(ey.Space,{children:(0,s.jsx)("a",{onClick:()=>{let e=[...c.headers];e.splice(l,1),u({...c,headers:e})},children:(0,s.jsx)(ev.DeleteOutlined,{})})})}];return(0,s.jsxs)(eU,{className:"datasource-panel",children:[(0,s.jsx)(ew,{title:"数据源",extra:(0,s.jsx)(ey.Space,{children:(0,s.jsx)(ey.Dropdown,{menu:{onClick:e=>{let{key:t}=e;"api"===t?(o(-1),u({id:eH(),type:"api",name:"",url:"",method:"GET",headers:[],formData:[],body:""}),n(!0)):(o(-1),m({id:eH(),type:"sql",name:"",query:""}),a(!0))},items:[{key:"api",label:(0,s.jsx)("a",{children:"API接口"})},{key:"sql",label:(0,s.jsx)("a",{children:"SQL查询"})}]},placement:"bottom",children:(0,s.jsxs)("a",{className:"toolbar",children:[(0,s.jsx)(ev.PlusOutlined,{}),(0,s.jsx)(ev.CaretDownOutlined,{style:{fontSize:8,verticalAlign:"sub"}})]})})})}),(0,s.jsx)("div",{className:"body",children:(0,s.jsx)("ul",{children:x.map((e,t)=>(0,s.jsxs)("li",{children:[(0,s.jsxs)("div",{title:e.name,children:[(0,s.jsx)(ej,{type:"icon-drag"})," ",e.name]}),(0,s.jsxs)(ey.Space,{children:[(0,s.jsx)("a",{onClick:()=>{o(t),"api"===e.type?(u({...e}),n(!0)):(m({...e}),a(!0))},children:(0,s.jsx)(ev.EditOutlined,{})}),(0,s.jsx)(ey.Popconfirm,{title:"确认删除吗?",okText:"确认",cancelText:"取消",onConfirm:()=>{let e;(e=[...x]).splice(t,1),h&&h(e)},children:(0,s.jsx)("a",{children:(0,s.jsx)(ev.DeleteOutlined,{})})})]})]},e.id))})}),(0,s.jsx)(ey.Modal,{title:"添加API接口",open:l,width:600,styles:{body:{maxHeight:"calc(100vh - 250px)",overflow:"auto"}},onCancel:()=>n(!1),footer:(0,s.jsxs)(ey.Space,{children:[(0,s.jsx)(ey.Button,{type:"primary",onClick:()=>{if(!c.name||!c.url)return;let e=[...x];-1===i?e.push(c):e[i]=c,h&&h(e),n(!1)},children:"确定"}),(0,s.jsx)(ey.Button,{onClick:()=>n(!1),children:"取消"})]}),children:(0,s.jsxs)(ey.Form,{labelCol:{span:24},wrapperCol:{span:24},children:[(0,s.jsx)(ey.Form.Item,{label:"接口名称",required:!0,children:(0,s.jsx)(ey.Input,{value:c.name,onChange:e=>u({...c,name:e.target.value})})}),(0,s.jsx)(ey.Form.Item,{label:"接口URL",required:!0,children:(0,s.jsx)(ey.Input,{value:c.url,onChange:e=>u({...c,url:e.target.value})})}),(0,s.jsx)(ey.Form.Item,{label:"请求方法",children:(0,s.jsxs)(ey.Radio.Group,{value:c.method,onChange:e=>u({...c,method:e.target.value}),children:[(0,s.jsx)(ey.Radio.Button,{value:"GET",children:"GET"}),(0,s.jsx)(ey.Radio.Button,{value:"POST",children:"POST"}),(0,s.jsx)(ey.Radio.Button,{value:"PUT",children:"PUT"}),(0,s.jsx)(ey.Radio.Button,{value:"DELETE",children:"DELETE"})]})}),(0,s.jsx)("label",{style:{display:"block",color:"#000000d9",padding:"8px 0"},children:"请求头"}),(0,s.jsx)(ey.Table,{columns:f,dataSource:c.headers,pagination:!1,locale:{emptyText:"暂无数据"},size:"small",bordered:!0,rowKey:(e,t)=>String(t)}),(0,s.jsx)(ey.Button,{size:"small",block:!0,onClick:()=>u({...c,headers:[...c.headers,{name:"",value:""}]}),children:"添加"}),(0,s.jsx)("label",{style:{display:"block",color:"#000000d9",padding:"8px 0"},children:"表单数据"}),(0,s.jsx)(ey.Table,{columns:f,dataSource:c.formData,pagination:!1,locale:{emptyText:"暂无数据"},size:"small",bordered:!0,rowKey:(e,t)=>`f-${t}`}),(0,s.jsx)(ey.Button,{size:"small",block:!0,onClick:()=>u({...c,formData:[...c.formData,{name:"",value:""}]}),children:"添加"}),(0,s.jsx)(ey.Form.Item,{label:"请求体",children:(0,s.jsx)("div",{style:{border:"1px solid var(--ant-color-border)",borderRadius:"var(--ant-border-radius)",padding:1},children:(0,s.jsx)(eA(),{height:"300px",defaultLanguage:"json",value:c.body,onChange:e=>u({...c,body:e||""}),options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,tabSize:2}})})})]})}),(0,s.jsx)(ey.Modal,{title:"添加SQL查询",open:r,width:600,styles:{body:{maxHeight:"calc(100vh - 250px)",overflow:"auto"}},onCancel:()=>a(!1),footer:(0,s.jsxs)(ey.Space,{children:[(0,s.jsx)(ey.Button,{type:"primary",onClick:()=>{if(!p.name||!p.query)return;let e=[...x];-1===i?e.push(p):e[i]=p,h&&h(e),a(!1)},children:"确定"}),(0,s.jsx)(ey.Button,{onClick:()=>a(!1),children:"取消"})]}),children:(0,s.jsxs)(ey.Form,{layout:"vertical",children:[(0,s.jsx)(ey.Form.Item,{label:"查询名称",required:!0,children:(0,s.jsx)(ey.Input,{value:p.name,onChange:e=>m({...p,name:e.target.value})})}),(0,s.jsx)(ey.Form.Item,{label:"查询语句",required:!0,children:(0,s.jsx)("div",{style:{border:"1px solid var(--ant-color-border)",borderRadius:"var(--ant-border-radius)",padding:1},children:(0,s.jsx)(eA(),{height:"300px",defaultLanguage:"sql",value:p.query,onChange:e=>m({...p,query:e||""}),options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,tabSize:2}})})})]})})]})},eW=x().div`
481
481
  display: flex;
482
482
  flex-direction: column;
483
483
  height: 100%;
@@ -489,7 +489,7 @@
489
489
  padding: 12px;
490
490
  overflow: auto;
491
491
  }
492
- `,eJ=x()(eb.Tree)`
492
+ `,eJ=x()(ey.Tree)`
493
493
  .ant-tree-draggable-icon {
494
494
  display: none;
495
495
  }
@@ -499,7 +499,7 @@
499
499
  overflow: hidden;
500
500
  text-overflow: ellipsis;
501
501
  }
502
- `,eX=()=>{let{schema:e,setSchema:t,selectedItem:l,setSelectedItem:n,plugins:r}=(0,d.useContext)(ei),[a,i]=(0,d.useState)([]),o=(0,d.useMemo)(()=>l?[l.id]:[],[l]),c=(0,d.useMemo)(()=>{let t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map(e=>{let l,{id:n,type:r,children:a}=e;return Array.isArray(a)?l=t(a):"object"==typeof a&&a&&(l=[],Object.keys(a).forEach(e=>{Array.isArray(a[e])&&l.push({key:eG(),type:"slot",slot:e,origin:a,children:t(a[e])})})),{key:n,title:r,item:e,type:r,children:l}})};return t(e.items)},[e]),u=(0,d.useMemo)(()=>{let e=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t.map(t=>{var l,n,a;return{key:t.key,title:(0,s.jsx)("span",{children:(l=t.type,n=t.slot,"slot"===l?"插槽-"+n:(null==(a=r.find(e=>e.key===l))?void 0:a.label)||l)}),children:t.children?e(t.children):void 0,dataRef:t}})};return e(c)},[c]);return(0,s.jsxs)(eW,{className:"layer-panel",children:[(0,s.jsx)(ew,{title:"图层",extra:(0,s.jsxs)(eb.Space,{children:[(0,s.jsx)(eb.Tooltip,{title:"全部展开",children:(0,s.jsx)("a",{className:"toolbar",onClick:()=>{let t=[],l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach(e=>{var n;t.push(e.id),(null==(n=e.children)?void 0:n.length)&&l(e.children)})};l(e.items),i(t)},children:(0,s.jsx)(ev.PlusSquareOutlined,{})})}),(0,s.jsx)(eb.Tooltip,{title:"全部收起",children:(0,s.jsx)("a",{className:"toolbar",onClick:()=>i([]),children:(0,s.jsx)(ev.MinusSquareOutlined,{})})})]})}),(0,s.jsx)("div",{className:"body",children:(0,s.jsx)(eJ,{draggable:{icon:!1,nodeDraggable:e=>!1},showIcon:!1,showLine:{showLeafIcon:!1},treeData:u,selectedKeys:o,expandedKeys:a,onSelect:(e,t)=>{"slot"!==t.node.dataRef.type&&n&&n(t.node.dataRef.item)},onDrop:l=>{let n;if(!(e=>{let t=e.node,l=e.dragNode;if("slot"===l.dataRef.type||!e.dropToGap&&!["b-row","b-col","b-card","slot"].includes(t.dataRef.type))return!1;if("b-col"===l.dataRef.type)if(!e.dropToGap)return"b-row"===t.dataRef.type;else return"b-col"===t.dataRef.type;return("b-col"!==t.dataRef.type||!e.dropToGap)&&("b-row"!==t.dataRef.type||!!e.dropToGap)||"b-col"===l.dataRef.type})(l))return;let r=l.node.key,a=l.dragNode.key,i=l.node.pos.split("-"),o=l.dropPosition-Number(i[i.length-1]),s=(e,t,l)=>{e.forEach((e,n,r)=>{if(e.id===t)return(e.children=e.children||[],"slot"===e.type)?l(e,n,r,e.children[e.slot]):l(e,n,r,e.children);if(Array.isArray(e.children))return s(e.children,t,l);if("object"==typeof e.children)for(let n in e.children)Array.isArray(e.children[n])&&s(e.children[n],t,l)})},d=e.items;if(s(d,a,(e,t,l)=>{l.splice(t,1),n=e}),l.dropToGap)if((l.node.children||[]).length>0&&l.node.expanded&&1===o)s(d,r,(e,t,l)=>{e.children=e.children||[],e.children.unshift(n)});else{let e=[],t=0;s(d,r,(l,n,r)=>{e=r,t=n}),-1===o?e.splice(t,0,n):e.splice(t+1,0,n)}else{if("slot"===l.node.dataRef.type){let{slot:e,origin:t}=l.node.dataRef;console.log(e,JSON.stringify(t)),t[e]=t[e]||[],t[e].push(n)}s(d,r,e=>{e.children=e.children||[],e.children.push(n)})}t&&t({...e,items:d})},onExpand:e=>i(e)})})]})},eV=x().div`
502
+ `,eX=()=>{let{schema:e,setSchema:t,selectedItem:l,setSelectedItem:n,plugins:r}=(0,d.useContext)(ei),[a,i]=(0,d.useState)([]),o=(0,d.useMemo)(()=>l?[l.id]:[],[l]),c=(0,d.useMemo)(()=>{let t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map(e=>{let l,{id:n,type:r,children:a}=e;return Array.isArray(a)?l=t(a):"object"==typeof a&&a&&(l=[],Object.keys(a).forEach(e=>{Array.isArray(a[e])&&l.push({key:eH(),type:"slot",slot:e,origin:a,children:t(a[e])})})),{key:n,title:r,item:e,type:r,children:l}})};return t(e.items)},[e]),u=(0,d.useMemo)(()=>{let e=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t.map(t=>{var l,n,a;return{key:t.key,title:(0,s.jsx)("span",{children:(l=t.type,n=t.slot,"slot"===l?"插槽-"+n:(null==(a=r.find(e=>e.key===l))?void 0:a.label)||l)}),children:t.children?e(t.children):void 0,dataRef:t}})};return e(c)},[c]);return(0,s.jsxs)(eW,{className:"layer-panel",children:[(0,s.jsx)(ew,{title:"图层",extra:(0,s.jsxs)(ey.Space,{children:[(0,s.jsx)(ey.Tooltip,{title:"全部展开",children:(0,s.jsx)("a",{className:"toolbar",onClick:()=>{let t=[],l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach(e=>{var n;t.push(e.id),(null==(n=e.children)?void 0:n.length)&&l(e.children)})};l(e.items),i(t)},children:(0,s.jsx)(ev.PlusSquareOutlined,{})})}),(0,s.jsx)(ey.Tooltip,{title:"全部收起",children:(0,s.jsx)("a",{className:"toolbar",onClick:()=>i([]),children:(0,s.jsx)(ev.MinusSquareOutlined,{})})})]})}),(0,s.jsx)("div",{className:"body",children:(0,s.jsx)(eJ,{draggable:{icon:!1,nodeDraggable:e=>!1},showIcon:!1,showLine:{showLeafIcon:!1},treeData:u,selectedKeys:o,expandedKeys:a,onSelect:(e,t)=>{"slot"!==t.node.dataRef.type&&n&&n(t.node.dataRef.item)},onDrop:l=>{let n;if(!(e=>{let t=e.node,l=e.dragNode;if("slot"===l.dataRef.type||!e.dropToGap&&!["b-row","b-col","b-card","slot"].includes(t.dataRef.type))return!1;if("b-col"===l.dataRef.type)if(!e.dropToGap)return"b-row"===t.dataRef.type;else return"b-col"===t.dataRef.type;return("b-col"!==t.dataRef.type||!e.dropToGap)&&("b-row"!==t.dataRef.type||!!e.dropToGap)||"b-col"===l.dataRef.type})(l))return;let r=l.node.key,a=l.dragNode.key,i=l.node.pos.split("-"),o=l.dropPosition-Number(i[i.length-1]),s=(e,t,l)=>{e.forEach((e,n,r)=>{if(e.id===t)return(e.children=e.children||[],"slot"===e.type)?l(e,n,r,e.children[e.slot]):l(e,n,r,e.children);if(Array.isArray(e.children))return s(e.children,t,l);if("object"==typeof e.children)for(let n in e.children)Array.isArray(e.children[n])&&s(e.children[n],t,l)})},d=e.items;if(s(d,a,(e,t,l)=>{l.splice(t,1),n=e}),l.dropToGap)if((l.node.children||[]).length>0&&l.node.expanded&&1===o)s(d,r,(e,t,l)=>{e.children=e.children||[],e.children.unshift(n)});else{let e=[],t=0;s(d,r,(l,n,r)=>{e=r,t=n}),-1===o?e.splice(t,0,n):e.splice(t+1,0,n)}else{if("slot"===l.node.dataRef.type){let{slot:e,origin:t}=l.node.dataRef;console.log(e,JSON.stringify(t)),t[e]=t[e]||[],t[e].push(n)}s(d,r,e=>{e.children=e.children||[],e.children.push(n)})}t&&t({...e,items:d})},onExpand:e=>i(e)})})]})},eV=x().div`
503
503
  display: flex;
504
504
  flex-direction: column;
505
505
  height: 100%;
@@ -525,7 +525,7 @@
525
525
  justify-content: flex-end;
526
526
  }
527
527
  }
528
- `,eQ=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],l=e=>{Array.isArray(e)&&e.forEach(e=>{t.push(e),Array.isArray(e.children)?l(e.children):"object"==typeof e.children&&e.children&&Object.keys(e.children).forEach(t=>l(e.children[t]))})};return l(e||[]),t},eZ=()=>{var e;let{plugins:t,selectedItem:l,updateSelectedItem:n,schema:r,setSchema:a}=(0,d.useContext)(ei),i=(0,d.useRef)(null),[o,u]=(0,d.useState)("1"),p=(0,d.useMemo)(()=>eQ((null==r?void 0:r.items)||[]),[r]),m=(0,d.useMemo)(()=>l&&p.find(e=>e.id===l.id),[p,l]),x=m?o:"1",h=(0,d.useMemo)(()=>t.find(e=>e.key===(null==l?void 0:l.type)),[t,l]),f=null==h?void 0:h.formComponent,g=(null==l?void 0:l.props)||{},v=(null==l?void 0:l.style)||{},[b,y]=(0,d.useState)((null==r?void 0:r.info)||{}),[j,C]=(0,d.useState)((null==l?void 0:l.datasource)||{}),w=e=>{a({...r,info:e})},S={Authorization:`Bearer ${localStorage.getItem("ASKDATA_TOKEN")||""}`};return c().useEffect(()=>{u(l?"2":"1"),C((null==l?void 0:l.datasource)||{})},[l]),(0,s.jsxs)(eV,{className:"properties-panel",children:[(0,s.jsx)(ew,{title:"属性",extra:(0,s.jsxs)(eb.Radio.Group,{value:x,size:"small",buttonStyle:"outline",onChange:e=>u(e.target.value),children:[(0,s.jsx)(eb.Radio.Button,{value:"1",children:"页面"}),m&&(0,s.jsx)(eb.Radio.Button,{value:"2",children:"组件"})]})}),(0,s.jsxs)("div",{className:"body",children:["1"===x&&(0,s.jsxs)(eb.Form,{labelCol:{span:24},wrapperCol:{span:24},children:[(0,s.jsx)(eb.Form.Item,{label:"页面名称",children:(0,s.jsx)(eb.Input,{size:"small",value:null==b?void 0:b.name,placeholder:"请输入页面名称",onChange:e=>{let t={...b,name:e.target.value};y(t),w&&w(t)}})}),(0,s.jsx)(eb.Form.Item,{label:"页面描述",children:(0,s.jsx)(eb.Input.TextArea,{size:"small",value:null==b?void 0:b.description,placeholder:"请输入页面描述",onChange:e=>{let t={...b,description:e.target.value};y(t),w&&w(t)}})}),(0,s.jsxs)(eb.Form.Item,{label:"封面",children:[(0,s.jsxs)(eb.Upload.Dragger,{name:"file",multiple:!1,accept:".png,.jpg,.jpeg",headers:S,action:"/api/datareport/upload",showUploadList:!1,beforeUpload:e=>e.type.startsWith("image/"),onChange:e=>{if("done"===e.file.status){var t;let l={url:null==(t=e.file.response)?void 0:t.data,name:e.file.name},n={...b,cover:l};y(n),w&&w(n)}},children:[(0,s.jsx)("p",{className:"ant-upload-drag-icon",children:(0,s.jsx)(ev.InboxOutlined,{})}),(0,s.jsx)("p",{className:"ant-upload-text",children:"点击或将文件拖拽到此区域进行上传"}),(0,s.jsx)("p",{className:"ant-upload-hint",children:"严禁上传公司数据或其他被禁止的文件。"})]}),(null==b||null==(e=b.cover)?void 0:e.url)&&(0,s.jsxs)("div",{style:{marginTop:10,textAlign:"left"},children:[(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,s.jsx)("label",{children:"封面预览"}),(0,s.jsx)("a",{onClick:()=>{let e={...b,cover:null};y(e),w&&w(e)},children:(0,s.jsx)(ev.DeleteOutlined,{})})]}),(0,s.jsx)("img",{src:b.cover.url,style:{width:"100%",maxHeight:200}})]})]})]}),"2"===x&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eb.Divider,{children:"基础属性"}),(0,s.jsxs)(eb.Form,{labelCol:{span:24},wrapperCol:{span:24},children:[(0,s.jsx)(eb.Form.Item,{label:"组件标识",labelCol:{span:12},wrapperCol:{span:12},children:(null==l?void 0:l.id)||""}),(0,s.jsx)(eb.Form.Item,{label:"组件名称",children:(0,s.jsx)(eb.Input,{size:"small",value:null==l?void 0:l.name,onChange:e=>n&&n({...l,name:e.target.value})})}),(0,s.jsx)(eb.Form.Item,{label:"组件描述",children:(0,s.jsx)(eb.Input.TextArea,{size:"small",value:null==l?void 0:l.description,onChange:e=>n&&n({...l,description:e.target.value})})})]}),(null==l?void 0:l.datasource)&&(0,s.jsx)(eb.Divider,{children:"数据源"}),(null==l?void 0:l.datasource)&&(0,s.jsx)(eb.Form,{labelCol:{span:24},wrapperCol:{span:24},children:(0,s.jsxs)(eb.Form.Item,{label:(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:["数据来源",(0,s.jsxs)(eb.Radio.Group,{size:"small",value:null==j?void 0:j.source,onChange:e=>{let t={...j||{},source:e.target.value};C(t),n&&n({...l,datasource:t})},children:[(0,s.jsx)(eb.Radio.Button,{value:"define",children:"已定义数据源"}),(0,s.jsx)(eb.Radio.Button,{value:"custom",children:"自定义"})]})]}),children:[(null==j?void 0:j.source)==="define"&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eb.Form.Item,{label:"数据源",labelCol:{span:24},wrapperCol:{span:24},children:(0,s.jsx)(eb.Select,{size:"small",value:null==j?void 0:j.datasourceId,onChange:e=>{let t={...j||{},datasourceId:e};C(t),n&&n({...l,datasource:t})},children:((null==r?void 0:r.datasources)||[]).map(e=>(0,s.jsx)(eb.Select.Option,{value:e.id,children:e.name},e.id))})}),(0,s.jsx)(eb.Form.Item,{label:"数据处理脚本",labelCol:{span:24},wrapperCol:{span:24},children:(0,s.jsx)(eb.Select,{size:"small",value:null==j?void 0:j.scriptId,onChange:e=>{let t={...j||{},scriptId:e};C(t),n&&n({...l,datasource:t})},children:((null==r?void 0:r.scripts)||[]).map(e=>(0,s.jsx)(eb.Select.Option,{value:e.id,children:e.name},e.id))})})]}),(null==j?void 0:j.source)==="custom"&&(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(eb.Form.Item,{label:(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:["自定义",(0,s.jsxs)("a",{onClick:()=>{var e,t;let l=null==(e=i.current)?void 0:e.editor;null==l||null==(t=l.getAction("editor.action.formatDocument"))||t.run()},children:[(0,s.jsx)(ej,{type:"icon-formate"})," 格式化"]})]}),labelCol:{span:24},wrapperCol:{span:24},children:(0,s.jsx)("div",{style:{border:"1px solid var(--ant-color-border)",borderRadius:"var(--ant-border-radius)",padding:1},children:(0,s.jsx)(eA(),{height:"200px",onMount:e=>{i.current={editor:e}},defaultLanguage:"json",value:null==j?void 0:j.custom,onChange:e=>{let t={...j||{},custom:e||""};C(t),n&&n({...l,datasource:t})},options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,tabSize:2}})})})})]})}),f&&(0,s.jsx)(eb.Divider,{children:"特有属性"}),f&&(0,s.jsx)(f,{model:g,customStyle:v,onChange:e=>{l&&n&&n({...l,props:e})}})]})]})]})},e0=x().div`
528
+ `,eQ=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],l=e=>{Array.isArray(e)&&e.forEach(e=>{t.push(e),Array.isArray(e.children)?l(e.children):"object"==typeof e.children&&e.children&&Object.keys(e.children).forEach(t=>l(e.children[t]))})};return l(e||[]),t},eZ=()=>{var e;let{plugins:t,selectedItem:l,updateSelectedItem:n,schema:r,setSchema:a}=(0,d.useContext)(ei),i=(0,d.useRef)(null),[o,u]=(0,d.useState)("1"),p=(0,d.useMemo)(()=>eQ((null==r?void 0:r.items)||[]),[r]),m=(0,d.useMemo)(()=>l&&p.find(e=>e.id===l.id),[p,l]),x=m?o:"1",h=(0,d.useMemo)(()=>t.find(e=>e.key===(null==l?void 0:l.type)),[t,l]),f=null==h?void 0:h.formComponent,g=(null==l?void 0:l.props)||{},v=(null==l?void 0:l.style)||{},[y,b]=(0,d.useState)((null==r?void 0:r.info)||{}),[j,C]=(0,d.useState)((null==l?void 0:l.datasource)||{}),w=e=>{a({...r,info:e})},S={Authorization:`Bearer ${localStorage.getItem("ASKDATA_TOKEN")||""}`};return c().useEffect(()=>{u(l?"2":"1"),C((null==l?void 0:l.datasource)||{})},[l]),(0,s.jsxs)(eV,{className:"properties-panel",children:[(0,s.jsx)(ew,{title:"属性",extra:(0,s.jsxs)(ey.Radio.Group,{value:x,size:"small",buttonStyle:"outline",onChange:e=>u(e.target.value),children:[(0,s.jsx)(ey.Radio.Button,{value:"1",children:"页面"}),m&&(0,s.jsx)(ey.Radio.Button,{value:"2",children:"组件"})]})}),(0,s.jsxs)("div",{className:"body",children:["1"===x&&(0,s.jsxs)(ey.Form,{labelCol:{span:24},wrapperCol:{span:24},children:[(0,s.jsx)(ey.Form.Item,{label:"页面名称",children:(0,s.jsx)(ey.Input,{size:"small",value:null==y?void 0:y.name,placeholder:"请输入页面名称",onChange:e=>{let t={...y,name:e.target.value};b(t),w&&w(t)}})}),(0,s.jsx)(ey.Form.Item,{label:"页面描述",children:(0,s.jsx)(ey.Input.TextArea,{size:"small",value:null==y?void 0:y.description,placeholder:"请输入页面描述",onChange:e=>{let t={...y,description:e.target.value};b(t),w&&w(t)}})}),(0,s.jsxs)(ey.Form.Item,{label:"封面",children:[(0,s.jsxs)(ey.Upload.Dragger,{name:"file",multiple:!1,accept:".png,.jpg,.jpeg",headers:S,action:"/api/datareport/upload",showUploadList:!1,beforeUpload:e=>e.type.startsWith("image/"),onChange:e=>{if("done"===e.file.status){var t;let l={url:null==(t=e.file.response)?void 0:t.data,name:e.file.name},n={...y,cover:l};b(n),w&&w(n)}},children:[(0,s.jsx)("p",{className:"ant-upload-drag-icon",children:(0,s.jsx)(ev.InboxOutlined,{})}),(0,s.jsx)("p",{className:"ant-upload-text",children:"点击或将文件拖拽到此区域进行上传"}),(0,s.jsx)("p",{className:"ant-upload-hint",children:"严禁上传公司数据或其他被禁止的文件。"})]}),(null==y||null==(e=y.cover)?void 0:e.url)&&(0,s.jsxs)("div",{style:{marginTop:10,textAlign:"left"},children:[(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,s.jsx)("label",{children:"封面预览"}),(0,s.jsx)("a",{onClick:()=>{let e={...y,cover:null};b(e),w&&w(e)},children:(0,s.jsx)(ev.DeleteOutlined,{})})]}),(0,s.jsx)("img",{src:y.cover.url,style:{width:"100%",maxHeight:200}})]})]})]}),"2"===x&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ey.Divider,{children:"基础属性"}),(0,s.jsxs)(ey.Form,{labelCol:{span:24},wrapperCol:{span:24},children:[(0,s.jsx)(ey.Form.Item,{label:"组件标识",labelCol:{span:12},wrapperCol:{span:12},children:(null==l?void 0:l.id)||""}),(0,s.jsx)(ey.Form.Item,{label:"组件名称",children:(0,s.jsx)(ey.Input,{size:"small",value:null==l?void 0:l.name,onChange:e=>n&&n({...l,name:e.target.value})})}),(0,s.jsx)(ey.Form.Item,{label:"组件描述",children:(0,s.jsx)(ey.Input.TextArea,{size:"small",value:null==l?void 0:l.description,onChange:e=>n&&n({...l,description:e.target.value})})})]}),(null==l?void 0:l.datasource)&&(0,s.jsx)(ey.Divider,{children:"数据源"}),(null==l?void 0:l.datasource)&&(0,s.jsx)(ey.Form,{labelCol:{span:24},wrapperCol:{span:24},children:(0,s.jsxs)(ey.Form.Item,{label:(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:["数据来源",(0,s.jsxs)(ey.Radio.Group,{size:"small",value:null==j?void 0:j.source,onChange:e=>{let t={...j||{},source:e.target.value};C(t),n&&n({...l,datasource:t})},children:[(0,s.jsx)(ey.Radio.Button,{value:"define",children:"已定义数据源"}),(0,s.jsx)(ey.Radio.Button,{value:"custom",children:"自定义"})]})]}),children:[(null==j?void 0:j.source)==="define"&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ey.Form.Item,{label:"数据源",labelCol:{span:24},wrapperCol:{span:24},children:(0,s.jsx)(ey.Select,{size:"small",value:null==j?void 0:j.datasourceId,onChange:e=>{let t={...j||{},datasourceId:e};C(t),n&&n({...l,datasource:t})},children:((null==r?void 0:r.datasources)||[]).map(e=>(0,s.jsx)(ey.Select.Option,{value:e.id,children:e.name},e.id))})}),(0,s.jsx)(ey.Form.Item,{label:"数据处理脚本",labelCol:{span:24},wrapperCol:{span:24},children:(0,s.jsx)(ey.Select,{size:"small",value:null==j?void 0:j.scriptId,onChange:e=>{let t={...j||{},scriptId:e};C(t),n&&n({...l,datasource:t})},children:((null==r?void 0:r.scripts)||[]).map(e=>(0,s.jsx)(ey.Select.Option,{value:e.id,children:e.name},e.id))})})]}),(null==j?void 0:j.source)==="custom"&&(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(ey.Form.Item,{label:(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:["自定义",(0,s.jsxs)("a",{onClick:()=>{var e,t;let l=null==(e=i.current)?void 0:e.editor;null==l||null==(t=l.getAction("editor.action.formatDocument"))||t.run()},children:[(0,s.jsx)(ej,{type:"icon-formate"})," 格式化"]})]}),labelCol:{span:24},wrapperCol:{span:24},children:(0,s.jsx)("div",{style:{border:"1px solid var(--ant-color-border)",borderRadius:"var(--ant-border-radius)",padding:1},children:(0,s.jsx)(eA(),{height:"200px",onMount:e=>{i.current={editor:e}},defaultLanguage:"json",value:null==j?void 0:j.custom,onChange:e=>{let t={...j||{},custom:e||""};C(t),n&&n({...l,datasource:t})},options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,tabSize:2}})})})})]})}),f&&(0,s.jsx)(ey.Divider,{children:"特有属性"}),f&&(0,s.jsx)(f,{model:g,customStyle:v,onChange:e=>{l&&n&&n({...l,props:e})}})]})]})]})},e0=x().div`
529
529
  display: flex;
530
530
  flex-direction: column;
531
531
  height: 100%;
@@ -564,7 +564,7 @@
564
564
  font-size: 14px;
565
565
  padding: 0 50px;
566
566
  }
567
- `,e1=()=>{let{schema:e,setSchema:t}=(0,d.useContext)(ei),[l,n]=c().useState(!1),[r,a]=c().useState(-1),[i]=eb.Form.useForm(),o=(0,d.useMemo)(()=>e.scripts||[],[e]),u=l=>{t({...e,scripts:l})},p=async()=>{let e=await i.validateFields().catch(()=>null);if(!e)return;let t=[...o];-1===r?t.push({id:Math.random().toString(36).slice(2,10),...e}):t[r]={...t[r],...e},u&&u(t),n(!1),a(-1),i.resetFields()};return(0,s.jsxs)(e0,{className:"script-panel",children:[(0,s.jsx)(ew,{title:"脚本",extra:(0,s.jsx)(eb.Space,{children:(0,s.jsx)("a",{className:"toolbar",onClick:()=>{a(-1),i.setFieldsValue({name:"",script:"return {};"}),n(!0)},children:"+"})})}),(0,s.jsx)("div",{className:"body",children:(0,s.jsx)("ul",{children:o.map((e,t)=>(0,s.jsxs)("li",{children:[(0,s.jsxs)("div",{title:e.name,children:[(0,s.jsx)(ej,{type:"icon-drag"})," ",e.name]}),(0,s.jsxs)(eb.Space,{children:[(0,s.jsx)("a",{onClick:()=>{a(t),i.setFieldsValue({name:e.name,script:e.script}),n(!0)},children:(0,s.jsx)(ev.EditOutlined,{})}),(0,s.jsx)("a",{onClick:()=>{let e=[...o];e.splice(t,1),u&&u(e)},children:(0,s.jsx)(ev.DeleteOutlined,{})})]})]},e.id||t))})}),(0,s.jsx)(eb.Modal,{title:"添加脚本",open:l,width:600,styles:{body:{maxHeight:"calc(100vh - 250px)",overflow:"auto"}},onCancel:()=>n(!1),footer:(0,s.jsxs)(eb.Space,{children:[(0,s.jsx)(eb.Button,{type:"primary",onClick:p,children:"确定"}),(0,s.jsx)(eb.Button,{onClick:()=>n(!1),children:"取消"})]}),children:(0,s.jsxs)(eb.Form,{form:i,layout:"vertical",children:[(0,s.jsx)(eb.Form.Item,{label:"脚本名称",name:"name",rules:[{required:!0,message:"请输入脚本名称"}],children:(0,s.jsx)(eb.Input,{})}),(0,s.jsx)(eb.Form.Item,{label:"脚本语句",name:"script",rules:[{required:!0,message:"请输入脚本语句"}],children:(0,s.jsxs)("div",{style:{border:"1px solid #d9d9d9",padding:"0 10px"},children:[(0,s.jsxs)("div",{className:"function-wrapper",children:["function fixed(data) ","{"]}),(0,s.jsx)(eA(),{height:"200px",defaultLanguage:"javascript",value:i.getFieldValue("script"),onChange:e=>i.setFieldsValue({script:e||""}),options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,tabSize:2}}),(0,s.jsx)("div",{className:"function-wrapper",children:"}"})]})})]})})]})},e2=x().div`
567
+ `,e1=()=>{let{schema:e,setSchema:t}=(0,d.useContext)(ei),[l,n]=c().useState(!1),[r,a]=c().useState(-1),[i]=ey.Form.useForm(),o=(0,d.useMemo)(()=>e.scripts||[],[e]),u=l=>{t({...e,scripts:l})},p=async()=>{let e=await i.validateFields().catch(()=>null);if(!e)return;let t=[...o];-1===r?t.push({id:Math.random().toString(36).slice(2,10),...e}):t[r]={...t[r],...e},u&&u(t),n(!1),a(-1),i.resetFields()};return(0,s.jsxs)(e0,{className:"script-panel",children:[(0,s.jsx)(ew,{title:"脚本",extra:(0,s.jsx)(ey.Space,{children:(0,s.jsx)("a",{className:"toolbar",onClick:()=>{a(-1),i.setFieldsValue({name:"",script:"return {};"}),n(!0)},children:"+"})})}),(0,s.jsx)("div",{className:"body",children:(0,s.jsx)("ul",{children:o.map((e,t)=>(0,s.jsxs)("li",{children:[(0,s.jsxs)("div",{title:e.name,children:[(0,s.jsx)(ej,{type:"icon-drag"})," ",e.name]}),(0,s.jsxs)(ey.Space,{children:[(0,s.jsx)("a",{onClick:()=>{a(t),i.setFieldsValue({name:e.name,script:e.script}),n(!0)},children:(0,s.jsx)(ev.EditOutlined,{})}),(0,s.jsx)("a",{onClick:()=>{let e=[...o];e.splice(t,1),u&&u(e)},children:(0,s.jsx)(ev.DeleteOutlined,{})})]})]},e.id||t))})}),(0,s.jsx)(ey.Modal,{title:"添加脚本",open:l,width:600,styles:{body:{maxHeight:"calc(100vh - 250px)",overflow:"auto"}},onCancel:()=>n(!1),footer:(0,s.jsxs)(ey.Space,{children:[(0,s.jsx)(ey.Button,{type:"primary",onClick:p,children:"确定"}),(0,s.jsx)(ey.Button,{onClick:()=>n(!1),children:"取消"})]}),children:(0,s.jsxs)(ey.Form,{form:i,layout:"vertical",children:[(0,s.jsx)(ey.Form.Item,{label:"脚本名称",name:"name",rules:[{required:!0,message:"请输入脚本名称"}],children:(0,s.jsx)(ey.Input,{})}),(0,s.jsx)(ey.Form.Item,{label:"脚本语句",name:"script",rules:[{required:!0,message:"请输入脚本语句"}],children:(0,s.jsxs)("div",{style:{border:"1px solid #d9d9d9",padding:"0 10px"},children:[(0,s.jsxs)("div",{className:"function-wrapper",children:["function fixed(data) ","{"]}),(0,s.jsx)(eA(),{height:"200px",defaultLanguage:"javascript",value:i.getFieldValue("script"),onChange:e=>i.setFieldsValue({script:e||""}),options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,tabSize:2}}),(0,s.jsx)("div",{className:"function-wrapper",children:"}"})]})})]})})]})},e2=x().div`
568
568
  display: flex;
569
569
  flex-direction: column;
570
570
  height: 100%;
@@ -575,7 +575,7 @@
575
575
  gap: 12px;
576
576
  padding: 12px;
577
577
  }
578
- `,e4=()=>{let{schema:e,setSchema:t}=(0,d.useContext)(ei),[l,n]=c().useState(!1),[r,a]=c().useState(-1),[i]=eb.Form.useForm(),o=(0,d.useMemo)(()=>e.variables||[],[e.variables]),u=l=>{t({...e,variables:l})},p=[{title:"名称",dataIndex:"name",render:(e,t)=>(0,s.jsxs)("div",{title:e,children:[(0,s.jsx)(ej,{type:"icon-drag"})," ",e]})},{title:"值",dataIndex:"value"},{title:"操作",width:60,align:"center",render:(e,t,l)=>(0,s.jsxs)(eb.Space,{children:[(0,s.jsx)("a",{onClick:()=>{a(l),i.setFieldsValue({name:t.name,value:t.value}),n(!0)},children:(0,s.jsx)(ev.EditOutlined,{})}),(0,s.jsx)(eb.Popconfirm,{title:"确认删除吗?",okText:"确认",cancelText:"取消",onConfirm:()=>{let e=[...o];e.splice(l,1),u&&u(e)},children:(0,s.jsx)("a",{children:(0,s.jsx)(ev.DeleteOutlined,{})})})]})}],m=async()=>{let e=await i.validateFields().catch(()=>null);if(!e)return;let t=[...o];-1===r?t.push({...e}):t[r]={...t[r],...e},u&&u(t),n(!1),a(-1),i.resetFields()};return(0,s.jsxs)(e2,{children:[(0,s.jsx)(ew,{title:"环境变量",extra:(0,s.jsx)(eb.Space,{children:(0,s.jsx)("a",{className:"toolbar",onClick:()=>{a(-1),i.resetFields(),n(!0)},children:"+"})})}),(0,s.jsx)("div",{className:"body",children:(0,s.jsx)(eb.Table,{rowKey:e=>e.id||e.name,dataSource:o,columns:p,pagination:!1,size:"small",locale:{emptyText:"暂无环境变量"}})}),(0,s.jsx)(eb.Modal,{title:"添加环境变量",open:l,width:600,styles:{body:{maxHeight:"calc(100vh - 250px)",overflow:"auto"}},onCancel:()=>n(!1),footer:(0,s.jsxs)(eb.Space,{children:[(0,s.jsx)(eb.Button,{type:"primary",onClick:m,children:"确定"}),(0,s.jsx)(eb.Button,{onClick:()=>n(!1),children:"取消"})]}),children:(0,s.jsxs)(eb.Form,{form:i,layout:"vertical",children:[(0,s.jsx)(eb.Form.Item,{label:"环境变量名称",name:"name",rules:[{required:!0,message:"请输入环境变量名称"}],children:(0,s.jsx)(eb.Input,{})}),(0,s.jsx)(eb.Form.Item,{label:"环境变量值",name:"value",rules:[{required:!0,message:"请输入环境变量值"}],children:(0,s.jsx)(eb.Input,{})})]})})]})},e8=x().div`
578
+ `,e4=()=>{let{schema:e,setSchema:t}=(0,d.useContext)(ei),[l,n]=c().useState(!1),[r,a]=c().useState(-1),[i]=ey.Form.useForm(),o=(0,d.useMemo)(()=>e.variables||[],[e.variables]),u=l=>{t({...e,variables:l})},p=[{title:"名称",dataIndex:"name",render:(e,t)=>(0,s.jsxs)("div",{title:e,children:[(0,s.jsx)(ej,{type:"icon-drag"})," ",e]})},{title:"值",dataIndex:"value"},{title:"操作",width:60,align:"center",render:(e,t,l)=>(0,s.jsxs)(ey.Space,{children:[(0,s.jsx)("a",{onClick:()=>{a(l),i.setFieldsValue({name:t.name,value:t.value}),n(!0)},children:(0,s.jsx)(ev.EditOutlined,{})}),(0,s.jsx)(ey.Popconfirm,{title:"确认删除吗?",okText:"确认",cancelText:"取消",onConfirm:()=>{let e=[...o];e.splice(l,1),u&&u(e)},children:(0,s.jsx)("a",{children:(0,s.jsx)(ev.DeleteOutlined,{})})})]})}],m=async()=>{let e=await i.validateFields().catch(()=>null);if(!e)return;let t=[...o];-1===r?t.push({...e}):t[r]={...t[r],...e},u&&u(t),n(!1),a(-1),i.resetFields()};return(0,s.jsxs)(e2,{children:[(0,s.jsx)(ew,{title:"环境变量",extra:(0,s.jsx)(ey.Space,{children:(0,s.jsx)("a",{className:"toolbar",onClick:()=>{a(-1),i.resetFields(),n(!0)},children:"+"})})}),(0,s.jsx)("div",{className:"body",children:(0,s.jsx)(ey.Table,{rowKey:e=>e.id||e.name,dataSource:o,columns:p,pagination:!1,size:"small",locale:{emptyText:"暂无环境变量"}})}),(0,s.jsx)(ey.Modal,{title:"添加环境变量",open:l,width:600,styles:{body:{maxHeight:"calc(100vh - 250px)",overflow:"auto"}},onCancel:()=>n(!1),footer:(0,s.jsxs)(ey.Space,{children:[(0,s.jsx)(ey.Button,{type:"primary",onClick:m,children:"确定"}),(0,s.jsx)(ey.Button,{onClick:()=>n(!1),children:"取消"})]}),children:(0,s.jsxs)(ey.Form,{form:i,layout:"vertical",children:[(0,s.jsx)(ey.Form.Item,{label:"环境变量名称",name:"name",rules:[{required:!0,message:"请输入环境变量名称"}],children:(0,s.jsx)(ey.Input,{})}),(0,s.jsx)(ey.Form.Item,{label:"环境变量值",name:"value",rules:[{required:!0,message:"请输入环境变量值"}],children:(0,s.jsx)(ey.Input,{})})]})})]})},e8=x().div`
579
579
  height: 100%;
580
580
  display: grid;
581
581
  background: #ffffff;
@@ -665,7 +665,7 @@
665
665
  border-right: solid 2px #1890ff;
666
666
  background: linear-gradient(to left, #1890ff1a, #ffffff);
667
667
  }
668
- `,e5=c().forwardRef((e,t)=>{var l;let n,{agentList:r=[],plugins:a=[],headerExtra:i}=e,o=(0,d.useRef)(null),[c,u]=(0,d.useState)(1),[p,m]=(0,d.useState)([]),[x,h]=(0,d.useState)([]),[f,g]=(0,d.useState)(!1),[v,b]=(0,d.useState)("desktop"),[y,j]=(0,d.useState)("component"),[C,w]=(0,d.useState)("ai"),[S,I]=(0,d.useState)(!0),[z,k]=(0,d.useState)(!0),[O,T]=(0,d.useState)(null),[R,F]=(0,d.useState)({info:{},datasources:[],scripts:[],variables:[],items:[]}),[D,N]=(0,d.useState)(!0),E=(0,d.useMemo)(()=>{let e=S?"250px":"",t=z?"400px":"";return{gridTemplateColumns:`${e} 1fr ${t}`}},[S,z]),A=(0,d.useMemo)(()=>({display:S?"flex":"none"}),[S]),B=(0,d.useMemo)(()=>({display:z?"flex":"none"}),[z]);l=[R],(n=(0,d.useRef)()).current===JSON.stringify(l)&&n.current||(n.current=JSON.stringify(l),(()=>{f||(m(e=>e.length?[...e,JSON.parse(JSON.stringify(R))].slice(-50):[JSON.parse(JSON.stringify(R))]),h([]))})()),(0,d.useImperativeHandle)(t,()=>({handleOpen(e){g(!0),L(e.items),F(e),m([JSON.parse(JSON.stringify(e))]),h([]),setTimeout(()=>g(!1),0)}}));let L=(e,t)=>{e&&e.forEach(e=>{e.id||(e.id=t||Math.random().toString(36).slice(2,10)),Array.isArray(e.children)?L(e.children):"object"==typeof e.children&&e.children&&Object.keys(e.children).forEach(t=>{Array.isArray(e.children[t])&&L(e.children[t],Math.random().toString(36).slice(2,10))})})};return(0,s.jsx)(eo,{designable:D,plugins:a,schema:R,selectedItem:O,setSchema:F,setSelectedItem:T,children:(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 24px",borderBottom:"solid 1px #e8e8e8"},children:[(0,s.jsxs)(eb.Space,{children:[(0,s.jsx)("span",{style:{fontSize:16,fontWeight:500},children:"创建数据报表"}),(0,s.jsx)(eb.Divider,{orientation:"vertical"}),(0,s.jsx)(eb.Tooltip,{title:"保存",children:(0,s.jsx)("a",{className:"toolbar",children:(0,s.jsx)(ev.SaveOutlined,{})})}),(0,s.jsx)(eb.Divider,{orientation:"vertical"}),(0,s.jsx)(eb.Tooltip,{title:"撤销",children:(0,s.jsx)("a",{className:`toolbar ${p.length>1?"active":""}`,onClick:()=>{m(e=>{if(e.length<=1)return e;g(!0);let t=e[e.length-2];return h(e=>[...e,JSON.parse(JSON.stringify(R))]),F(t),T(null),setTimeout(()=>g(!1),0),e.slice(0,-1)})},children:(0,s.jsx)(ev.UndoOutlined,{})})}),(0,s.jsx)(eb.Tooltip,{title:"重做",children:(0,s.jsx)("a",{className:`toolbar ${x.length>0?"active":""}`,onClick:()=>{h(e=>e.length?(g(!0),m(e=>[...e,JSON.parse(JSON.stringify(R))]),F(e[e.length-1]),T(null),setTimeout(()=>g(!1),0),e.slice(0,-1)):e)},children:(0,s.jsx)(ev.RedoOutlined,{})})})]}),(0,s.jsxs)(eb.Space,{children:[(0,s.jsx)(eb.Tooltip,{title:"缩小",children:(0,s.jsx)("a",{className:"toolbar",onClick:()=>u(parseFloat(Math.max(c-.1,.5).toFixed(1))),children:(0,s.jsx)(ev.ZoomOutOutlined,{})})}),(0,s.jsxs)("div",{style:{fontSize:12,color:"#999",userSelect:"none"},children:[(100*c).toFixed(0),"%"]}),(0,s.jsx)(eb.Tooltip,{title:"放大",children:(0,s.jsx)("a",{className:"toolbar",onClick:()=>u(parseFloat(Math.min(c+.1,2).toFixed(1))),children:(0,s.jsx)(ev.ZoomInOutlined,{})})}),(0,s.jsx)(eb.Tooltip,{title:"重置缩放",children:(0,s.jsx)("a",{className:"toolbar",onClick:()=>u(1),children:(0,s.jsx)(ej,{type:"icon-zoom-reset"})})}),(0,s.jsx)(eb.Divider,{orientation:"vertical"}),(0,s.jsx)(eb.Tooltip,{title:"切换左侧栏",children:(0,s.jsx)("a",{className:`toolbar ${S?"active":""}`,onClick:()=>{I(e=>!e),setTimeout(()=>{var e,t;return null==(t=o.current)||null==(e=t.handleResize)?void 0:e.call(t)},0)},children:(0,s.jsx)(ej,{type:"icon-sider-l"})})}),(0,s.jsx)(eb.Tooltip,{title:"切换右侧栏",children:(0,s.jsx)("a",{className:`toolbar ${z?"active":""}`,onClick:()=>{k(e=>!e),setTimeout(()=>{var e,t;return null==(t=o.current)||null==(e=t.handleResize)?void 0:e.call(t)},0)},children:(0,s.jsx)(ej,{type:"icon-sider-r"})})}),i]})]}),(0,s.jsxs)(e8,{style:E,children:[(0,s.jsxs)("div",{className:"left",style:A,children:[(0,s.jsx)("div",{style:{padding:"22px 1px 22px 0",borderRight:"solid 1px #e8e8e8"},children:(0,s.jsxs)(eb.Radio.Group,{value:y,onChange:e=>j(e.target.value),buttonStyle:"outline",style:{fontWeight:"normal",display:"inline-flex",flexDirection:"column",gap:14},className:"left-pane-tabs",children:[(0,s.jsx)(eb.Radio.Button,{value:"component",children:(0,s.jsx)(eb.Tooltip,{title:"组件",placement:"right",children:(0,s.jsx)(ej,{type:"icon-puzzle"})})}),(0,s.jsx)(eb.Radio.Button,{value:"layer",children:(0,s.jsx)(eb.Tooltip,{title:"图层",placement:"right",children:(0,s.jsx)(ej,{type:"icon-outline"})})}),(0,s.jsx)(eb.Radio.Button,{value:"datasource",children:(0,s.jsx)(eb.Tooltip,{title:"数据集",placement:"right",children:(0,s.jsx)(ej,{type:"icon-datasource"})})}),(0,s.jsx)(eb.Radio.Button,{value:"script",children:(0,s.jsx)(eb.Tooltip,{title:"脚本",placement:"right",children:(0,s.jsx)(ej,{type:"icon-js"})})}),(0,s.jsx)(eb.Radio.Button,{value:"env",children:(0,s.jsx)(eb.Tooltip,{title:"环境变量",placement:"right",children:(0,s.jsx)(ej,{type:"icon-variable"})})}),(0,s.jsx)(eb.Radio.Button,{value:"code",children:(0,s.jsx)(eb.Tooltip,{title:"源码",placement:"right",children:(0,s.jsx)(ej,{type:"icon-json"})})})]})}),(0,s.jsxs)("div",{style:{flex:"1 1 auto",display:"flex",flexDirection:"column",width:"calc(100% - 47px)"},children:["component"===y&&(0,s.jsx)(e_,{}),"layer"===y&&(0,s.jsx)(eX,{}),"datasource"===y&&(0,s.jsx)(eK,{}),"script"===y&&(0,s.jsx)(e1,{}),"env"===y&&(0,s.jsx)(e4,{}),"code"===y&&(0,s.jsx)(eP,{})]})]}),(0,s.jsxs)("div",{className:"center",style:{flex:"1 1 auto"},children:[(0,s.jsx)(ew,{title:"页面",extra:(0,s.jsxs)(eb.Space,{children:[(0,s.jsx)(eb.Button,{size:"small",type:D?"default":"primary",icon:D?(0,s.jsx)(ev.EyeInvisibleOutlined,{}):(0,s.jsx)(ev.EyeOutlined,{}),onClick:()=>N(!D)}),(0,s.jsxs)(eb.Radio.Group,{value:v,onChange:e=>b(e.target.value),size:"small",buttonStyle:"outline",children:[(0,s.jsx)(eb.Radio.Button,{value:"desktop",title:"桌面",children:(0,s.jsx)(ev.DesktopOutlined,{})}),(0,s.jsx)(eb.Radio.Button,{value:"mobile",title:"移动设备",children:(0,s.jsx)(ev.MobileOutlined,{})}),(0,s.jsx)(eb.Radio.Button,{value:"tablet",title:"平板设备",children:(0,s.jsx)(ev.TabletOutlined,{})})]})]})}),(0,s.jsx)("div",{className:["body",v].join(" "),children:(0,s.jsx)("div",{style:{transform:`scale(${c})`,transformOrigin:"top center"},children:(0,s.jsx)(ef,{ref:o,device:v})})})]}),(0,s.jsxs)("div",{className:"right",style:B,children:[(0,s.jsxs)("div",{style:{flex:"1 1 auto",display:"flex",flexDirection:"column",width:"calc(100% - 47px)"},children:["ai"===C&&(0,s.jsx)(eF,{agentList:r}),"props"===C&&(0,s.jsx)(eZ,{}),"cascade"===C&&(0,s.jsx)(eN,{})]}),(0,s.jsx)("div",{style:{padding:"22px 0",borderLeft:"solid 1px #e8e8e8"},children:(0,s.jsxs)(eb.Radio.Group,{value:C,onChange:e=>w(e.target.value),buttonStyle:"outline",style:{fontWeight:"normal",display:"inline-flex",flexDirection:"column",gap:14},className:"right-pane-tabs",children:[(0,s.jsx)(eb.Radio.Button,{value:"ai",children:(0,s.jsx)(eb.Tooltip,{title:"智能体",placement:"right",children:(0,s.jsx)(ej,{type:"icon-assistant"})})}),(0,s.jsx)(eb.Radio.Button,{value:"props",children:(0,s.jsx)(eb.Tooltip,{title:"属性",placement:"right",children:(0,s.jsx)(ej,{type:"icon-info"})})}),(0,s.jsx)(eb.Radio.Button,{value:"cascade",children:(0,s.jsx)(eb.Tooltip,{title:"联动",placement:"right",children:(0,s.jsx)(ej,{type:"icon-cascade"})})})]})})]})]})]})})}),e9=x()(ev.InfoCircleOutlined)`
668
+ `,e5=c().forwardRef((e,t)=>{var l;let n,{agentList:r=[],plugins:a=[],headerExtra:i}=e,o=(0,d.useRef)(null),[c,u]=(0,d.useState)(1),[p,m]=(0,d.useState)([]),[x,h]=(0,d.useState)([]),[f,g]=(0,d.useState)(!1),[v,y]=(0,d.useState)("desktop"),[b,j]=(0,d.useState)("component"),[C,w]=(0,d.useState)("ai"),[S,I]=(0,d.useState)(!0),[z,k]=(0,d.useState)(!0),[O,T]=(0,d.useState)(null),[R,F]=(0,d.useState)({info:{},datasources:[],scripts:[],variables:[],items:[]}),[D,N]=(0,d.useState)(!0),E=(0,d.useMemo)(()=>{let e=S?"250px":"",t=z?"400px":"";return{gridTemplateColumns:`${e} 1fr ${t}`}},[S,z]),A=(0,d.useMemo)(()=>({display:S?"flex":"none"}),[S]),B=(0,d.useMemo)(()=>({display:z?"flex":"none"}),[z]);l=[R],(n=(0,d.useRef)()).current===JSON.stringify(l)&&n.current||(n.current=JSON.stringify(l),(()=>{f||(m(e=>e.length?[...e,JSON.parse(JSON.stringify(R))].slice(-50):[JSON.parse(JSON.stringify(R))]),h([]))})()),(0,d.useImperativeHandle)(t,()=>({handleOpen(e){g(!0),P(e.items),F(e),m([JSON.parse(JSON.stringify(e))]),h([]),setTimeout(()=>g(!1),0)}}));let P=(e,t)=>{e&&e.forEach(e=>{e.id||(e.id=t||Math.random().toString(36).slice(2,10)),Array.isArray(e.children)?P(e.children):"object"==typeof e.children&&e.children&&Object.keys(e.children).forEach(t=>{Array.isArray(e.children[t])&&P(e.children[t],Math.random().toString(36).slice(2,10))})})};return(0,s.jsx)(eo,{designable:D,plugins:a,schema:R,selectedItem:O,setSchema:F,setSelectedItem:T,children:(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 24px",borderBottom:"solid 1px #e8e8e8"},children:[(0,s.jsxs)(ey.Space,{children:[(0,s.jsx)("span",{style:{fontSize:16,fontWeight:500},children:"创建数据报表"}),(0,s.jsx)(ey.Divider,{orientation:"vertical"}),(0,s.jsx)(ey.Tooltip,{title:"保存",children:(0,s.jsx)("a",{className:"toolbar",children:(0,s.jsx)(ev.SaveOutlined,{})})}),(0,s.jsx)(ey.Divider,{orientation:"vertical"}),(0,s.jsx)(ey.Tooltip,{title:"撤销",children:(0,s.jsx)("a",{className:`toolbar ${p.length>1?"active":""}`,onClick:()=>{m(e=>{if(e.length<=1)return e;g(!0);let t=e[e.length-2];return h(e=>[...e,JSON.parse(JSON.stringify(R))]),F(t),T(null),setTimeout(()=>g(!1),0),e.slice(0,-1)})},children:(0,s.jsx)(ev.UndoOutlined,{})})}),(0,s.jsx)(ey.Tooltip,{title:"重做",children:(0,s.jsx)("a",{className:`toolbar ${x.length>0?"active":""}`,onClick:()=>{h(e=>e.length?(g(!0),m(e=>[...e,JSON.parse(JSON.stringify(R))]),F(e[e.length-1]),T(null),setTimeout(()=>g(!1),0),e.slice(0,-1)):e)},children:(0,s.jsx)(ev.RedoOutlined,{})})})]}),(0,s.jsxs)(ey.Space,{children:[(0,s.jsx)(ey.Tooltip,{title:"缩小",children:(0,s.jsx)("a",{className:"toolbar",onClick:()=>u(parseFloat(Math.max(c-.1,.5).toFixed(1))),children:(0,s.jsx)(ev.ZoomOutOutlined,{})})}),(0,s.jsxs)("div",{style:{fontSize:12,color:"#999",userSelect:"none"},children:[(100*c).toFixed(0),"%"]}),(0,s.jsx)(ey.Tooltip,{title:"放大",children:(0,s.jsx)("a",{className:"toolbar",onClick:()=>u(parseFloat(Math.min(c+.1,2).toFixed(1))),children:(0,s.jsx)(ev.ZoomInOutlined,{})})}),(0,s.jsx)(ey.Tooltip,{title:"重置缩放",children:(0,s.jsx)("a",{className:"toolbar",onClick:()=>u(1),children:(0,s.jsx)(ej,{type:"icon-zoom-reset"})})}),(0,s.jsx)(ey.Divider,{orientation:"vertical"}),(0,s.jsx)(ey.Tooltip,{title:"切换左侧栏",children:(0,s.jsx)("a",{className:`toolbar ${S?"active":""}`,onClick:()=>{I(e=>!e),setTimeout(()=>{var e,t;return null==(t=o.current)||null==(e=t.handleResize)?void 0:e.call(t)},0)},children:(0,s.jsx)(ej,{type:"icon-sider-l"})})}),(0,s.jsx)(ey.Tooltip,{title:"切换右侧栏",children:(0,s.jsx)("a",{className:`toolbar ${z?"active":""}`,onClick:()=>{k(e=>!e),setTimeout(()=>{var e,t;return null==(t=o.current)||null==(e=t.handleResize)?void 0:e.call(t)},0)},children:(0,s.jsx)(ej,{type:"icon-sider-r"})})}),i]})]}),(0,s.jsxs)(e8,{style:E,children:[(0,s.jsxs)("div",{className:"left",style:A,children:[(0,s.jsx)("div",{style:{padding:"22px 1px 22px 0",borderRight:"solid 1px #e8e8e8"},children:(0,s.jsxs)(ey.Radio.Group,{value:b,onChange:e=>j(e.target.value),buttonStyle:"outline",style:{fontWeight:"normal",display:"inline-flex",flexDirection:"column",gap:14},className:"left-pane-tabs",children:[(0,s.jsx)(ey.Radio.Button,{value:"component",children:(0,s.jsx)(ey.Tooltip,{title:"组件",placement:"right",children:(0,s.jsx)(ej,{type:"icon-puzzle"})})}),(0,s.jsx)(ey.Radio.Button,{value:"layer",children:(0,s.jsx)(ey.Tooltip,{title:"图层",placement:"right",children:(0,s.jsx)(ej,{type:"icon-outline"})})}),(0,s.jsx)(ey.Radio.Button,{value:"datasource",children:(0,s.jsx)(ey.Tooltip,{title:"数据集",placement:"right",children:(0,s.jsx)(ej,{type:"icon-datasource"})})}),(0,s.jsx)(ey.Radio.Button,{value:"script",children:(0,s.jsx)(ey.Tooltip,{title:"脚本",placement:"right",children:(0,s.jsx)(ej,{type:"icon-js"})})}),(0,s.jsx)(ey.Radio.Button,{value:"env",children:(0,s.jsx)(ey.Tooltip,{title:"环境变量",placement:"right",children:(0,s.jsx)(ej,{type:"icon-variable"})})}),(0,s.jsx)(ey.Radio.Button,{value:"code",children:(0,s.jsx)(ey.Tooltip,{title:"源码",placement:"right",children:(0,s.jsx)(ej,{type:"icon-json"})})})]})}),(0,s.jsxs)("div",{style:{flex:"1 1 auto",display:"flex",flexDirection:"column",width:"calc(100% - 47px)"},children:["component"===b&&(0,s.jsx)(e_,{}),"layer"===b&&(0,s.jsx)(eX,{}),"datasource"===b&&(0,s.jsx)(eK,{}),"script"===b&&(0,s.jsx)(e1,{}),"env"===b&&(0,s.jsx)(e4,{}),"code"===b&&(0,s.jsx)(eL,{})]})]}),(0,s.jsxs)("div",{className:"center",style:{flex:"1 1 auto"},children:[(0,s.jsx)(ew,{title:"页面",extra:(0,s.jsxs)(ey.Space,{children:[(0,s.jsx)(ey.Button,{size:"small",type:D?"default":"primary",icon:D?(0,s.jsx)(ev.EyeInvisibleOutlined,{}):(0,s.jsx)(ev.EyeOutlined,{}),onClick:()=>N(!D)}),(0,s.jsxs)(ey.Radio.Group,{value:v,onChange:e=>y(e.target.value),size:"small",buttonStyle:"outline",children:[(0,s.jsx)(ey.Radio.Button,{value:"desktop",title:"桌面",children:(0,s.jsx)(ev.DesktopOutlined,{})}),(0,s.jsx)(ey.Radio.Button,{value:"mobile",title:"移动设备",children:(0,s.jsx)(ev.MobileOutlined,{})}),(0,s.jsx)(ey.Radio.Button,{value:"tablet",title:"平板设备",children:(0,s.jsx)(ev.TabletOutlined,{})})]})]})}),(0,s.jsx)("div",{className:["body",v].join(" "),children:(0,s.jsx)("div",{style:{transform:`scale(${c})`,transformOrigin:"top center"},children:(0,s.jsx)(ef,{ref:o,device:v})})})]}),(0,s.jsxs)("div",{className:"right",style:B,children:[(0,s.jsxs)("div",{style:{flex:"1 1 auto",display:"flex",flexDirection:"column",width:"calc(100% - 47px)"},children:["ai"===C&&(0,s.jsx)(eF,{agentList:r}),"props"===C&&(0,s.jsx)(eZ,{}),"cascade"===C&&(0,s.jsx)(eN,{})]}),(0,s.jsx)("div",{style:{padding:"22px 0",borderLeft:"solid 1px #e8e8e8"},children:(0,s.jsxs)(ey.Radio.Group,{value:C,onChange:e=>w(e.target.value),buttonStyle:"outline",style:{fontWeight:"normal",display:"inline-flex",flexDirection:"column",gap:14},className:"right-pane-tabs",children:[(0,s.jsx)(ey.Radio.Button,{value:"ai",children:(0,s.jsx)(ey.Tooltip,{title:"智能体",placement:"right",children:(0,s.jsx)(ej,{type:"icon-assistant"})})}),(0,s.jsx)(ey.Radio.Button,{value:"props",children:(0,s.jsx)(ey.Tooltip,{title:"属性",placement:"right",children:(0,s.jsx)(ej,{type:"icon-info"})})}),(0,s.jsx)(ey.Radio.Button,{value:"cascade",children:(0,s.jsx)(ey.Tooltip,{title:"联动",placement:"right",children:(0,s.jsx)(ej,{type:"icon-cascade"})})})]})})]})]})]})})}),e9=x()(ev.InfoCircleOutlined)`
669
669
  vertical-align: middle;
670
670
  margin-left: 2px;
671
671
  color: var(--ant-color-text-description);
@@ -756,7 +756,7 @@
756
756
  margin-top: 16px;
757
757
  text-align: right;
758
758
  padding: ${e=>e.$bordered?"0 24px 24px":"0"};
759
- `;let ti=e=>{let{item:t,split:l,padding:n}=e;return(0,s.jsx)(te,{$split:l,$padding:n,children:(0,s.jsxs)(tt,{children:[t.avatar&&(0,s.jsx)(tl,{children:(0,s.jsx)(eb.Avatar,{src:t.avatar})}),(0,s.jsxs)(tn,{children:[t.title&&(0,s.jsx)(tr,{children:t.href?(0,s.jsx)("a",{href:t.href,children:t.title}):t.title}),t.description&&(0,s.jsx)(ta,{children:t.description})]})]})})},to=e=>{let{list:t=[],split:l,bordered:n,size:r,itemLayout:a,style:i,className:o}=e,c=(0,d.useMemo)(()=>"small"===r?"8px 16px":n?"12px 24px":"12px 0",[r,n]);return(0,s.jsx)(e7,{$bordered:n,$split:l,$size:r,style:i,$itemLayout:a,className:o,children:t.map((e,t)=>(0,s.jsx)(ti,{item:e,split:l,padding:c},String(t)))})};var ts=u(190),td=u(185),tc=u.n(td);let tu=[{group:"基础组件",key:"b-text",label:"文本",icon:"icon-text",component:e=>{let{id:t,text:l,item:n,style:r={},className:a}=e;return(0,s.jsx)("span",{id:t,style:{...(null==n?void 0:n.style)||{},...r},className:a,children:l})},formComponent:e=>{let{model:t,customStyle:l={},onChange:n}=e,r=(e,r)=>{let a={...l,[e]:r};n&&n({...t,customStyle:a})};return(0,s.jsxs)(eb.Form,{children:[(0,s.jsx)(eb.Form.Item,{label:"文本内容",children:(0,s.jsx)(eb.Input.TextArea,{size:"small",value:t.text,onChange:e=>{let l;return l=e.target.value,n&&n({...t,text:l})}})}),(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,s.jsxs)(eb.Input.Group,{compact:!0,children:[(0,s.jsxs)(eb.Select,{size:"small",value:l.fontFamily,style:{width:90},onChange:e=>r("fontFamily",e),children:[(0,s.jsx)(eb.Select.Option,{value:"'黑体', 'SimHei', sans-serif",children:"黑体"}),(0,s.jsx)(eb.Select.Option,{value:"'宋体', 'SimSun', serif",children:"宋体"}),(0,s.jsx)(eb.Select.Option,{value:"'仿宋', 'FangSong', serif",children:"仿宋"}),(0,s.jsx)(eb.Select.Option,{value:"'楷体', 'KaiTi', serif",children:"楷体"}),(0,s.jsx)(eb.Select.Option,{value:"Arial, sans-serif",children:"Arial"})]}),(0,s.jsx)(eb.Select,{size:"small",value:l.fontSize,style:{width:90},onChange:e=>r("fontSize",e),children:["12px","14px","16px","20px","22px","24px","32px","48px"].map(e=>(0,s.jsx)(eb.Select.Option,{value:e,children:e},e))}),(0,s.jsx)(eb.Input,{size:"small",type:"color",value:l.color,onChange:e=>r("color",e.target.value),style:{width:90}})]}),(0,s.jsxs)(eb.Input.Group,{compact:!0,children:[(0,s.jsx)(eb.Button,{type:"bold"===l.fontWeight?"primary":void 0,size:"small",onClick:()=>r("fontWeight","bold"===l.fontWeight?"normal":"bold"),children:"B"}),(0,s.jsx)(eb.Button,{type:"italic"===l.fontStyle?"primary":void 0,size:"small",onClick:()=>r("fontStyle","italic"===l.fontStyle?"normal":"italic"),children:"I"}),(0,s.jsx)(eb.Button,{type:"underline"===l.textDecoration?"primary":void 0,size:"small",onClick:()=>r("textDecoration","underline"===l.textDecoration?"none":"underline"),children:"U"})]})]})]})},defaultOptions:{style:{fontSize:14,color:"#444444",fontFamily:"'宋体', 'SimSun', serif",fontWeight:"normal",fontStyle:"normal",textDecoration:"none"},props:{text:"文本内容"}}},{group:"基础组件",key:"b-image",label:"图片",icon:"icon-image",component:e=>{let{id:t,src:l,alt:n,width:r,height:a,href:i,className:o}=e,d=(0,s.jsx)("img",{id:t,src:l,alt:n,style:{width:r,height:a},className:o});return i&&i.length?(0,s.jsx)("a",{href:i,target:"_blank",rel:"noreferrer",children:d}):(0,s.jsx)("div",{children:d})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n}),r={Authorization:`Bearer ${localStorage.getItem("ASKDATA_TOKEN")||""}`};return(0,s.jsxs)(eb.Form,{labelCol:{span:24},wrapperCol:{span:24},children:[(0,s.jsx)(eb.Form.Item,{label:(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:["图片URL",(0,s.jsx)(eb.Upload,{name:"file",multiple:!1,accept:".png,.jpg,.jpeg",headers:r,action:"/api/datareport/upload",showUploadList:!1,beforeUpload:e=>{let t=e.type.startsWith("image/");return t||eb.message.error("上传封面只能是图片文件"),t},onChange:e=>{if("done"===e.file.status){var t;n("src",null==(t=e.file.response)?void 0:t.data),eb.message.success("上传成功")}else"error"===e.file.status&&eb.message.error("上传失败")},children:(0,s.jsx)(eb.Button,{size:"small",type:"link",icon:(0,s.jsx)(ev.UploadOutlined,{})})})]}),children:(0,s.jsx)(eb.Input,{size:"small",value:t.src,onChange:e=>n("src",e.target.value)})}),(0,s.jsx)(eb.Form.Item,{label:"图片替代文本",children:(0,s.jsx)(eb.Input,{size:"small",value:t.alt,onChange:e=>n("alt",e.target.value)})}),(0,s.jsx)(eb.Form.Item,{label:"图片链接",children:(0,s.jsx)(eb.Input,{size:"small",value:t.href,onChange:e=>n("href",e.target.value)})}),(0,s.jsx)(eb.Form.Item,{label:"图片宽度",children:(0,s.jsx)(eb.Input,{size:"small",value:t.width,onChange:e=>n("width",e.target.value)})}),(0,s.jsx)(eb.Form.Item,{label:"图片高度",children:(0,s.jsx)(eb.Input,{size:"small",value:t.height,onChange:e=>n("height",e.target.value)})})]})},defaultOptions:{props:{src:"https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png",alt:"",href:"",width:"100%",height:"auto"}}},{group:"基础组件",key:"b-button",label:"按钮",icon:"icon-button",component:e=>{let{id:t,text:l="按钮",type:n="middle",icon:r,size:a,block:i=!1,shape:o="default",ghost:c=!1,item:u,style:p,className:m}=e,{env:x,callbacks:h}=(0,d.useContext)(em),f="danger"===n,g="string"==typeof r?r?(0,s.jsx)(ej,{type:r}):void 0:r;return(0,s.jsx)(eb.Button,{id:t,type:f?"default":n,icon:g,size:a,block:i,shape:["round","circle"].includes(o)?o:void 0,ghost:c,danger:f,onClick:()=>{x&&u&&h&&eq(x,u,h)},style:p,className:m,children:l})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n});return(0,s.jsxs)(eb.Form,{labelCol:{span:6},wrapperCol:{span:18},children:[(0,s.jsx)(eb.Form.Item,{label:"文本",children:(0,s.jsx)(eb.Input,{size:"small",value:t.text,onChange:e=>n("text",e.target.value),placeholder:"请输入按钮文本"})}),(0,s.jsx)(eb.Form.Item,{label:"图标",children:(0,s.jsx)(eb.Input,{size:"small",value:t.icon,onChange:e=>n("icon",e.target.value),placeholder:"请输入按钮图标(antdv 1.7.8)"})}),(0,s.jsx)(eb.Form.Item,{label:"类型",children:(0,s.jsxs)(eb.Radio.Group,{size:"small",value:t.type,onChange:e=>n("type",e.target.value),children:[(0,s.jsx)(eb.Radio.Button,{value:"default",children:"默认"}),(0,s.jsx)(eb.Radio.Button,{value:"primary",children:"主要"}),(0,s.jsx)(eb.Radio.Button,{value:"link",children:"链接"}),(0,s.jsx)(eb.Radio.Button,{value:"dashed",children:"虚线"}),(0,s.jsx)(eb.Radio.Button,{value:"text",children:"文本"})]})}),(0,s.jsx)(eb.Form.Item,{label:"大小",children:(0,s.jsxs)(eb.Radio.Group,{size:"small",value:t.size,onChange:e=>n("size",e.target.value),children:[(0,s.jsx)(eb.Radio.Button,{value:"small",children:"小"}),(0,s.jsx)(eb.Radio.Button,{value:"middle",children:"中"}),(0,s.jsx)(eb.Radio.Button,{value:"large",children:"大"})]})}),(0,s.jsx)(eb.Form.Item,{label:"形状",children:(0,s.jsxs)(eb.Radio.Group,{size:"small",value:t.shape,onChange:e=>n("shape",e.target.value),children:[(0,s.jsx)(eb.Radio.Button,{value:"default",children:"默认"}),(0,s.jsx)(eb.Radio.Button,{value:"round",children:"圆角"}),(0,s.jsx)(eb.Radio.Button,{value:"circle",children:"圆形"})]})}),(0,s.jsx)(eb.Form.Item,{label:"块级",children:(0,s.jsx)(eb.Switch,{size:"small",checked:!!t.block,onChange:e=>n("block",e)})}),(0,s.jsx)(eb.Form.Item,{label:"幽灵",children:(0,s.jsx)(eb.Switch,{size:"small",checked:!!t.ghost,onChange:e=>n("ghost",e)})})]})},defaultOptions:{props:{type:"primary",size:"default",shape:"default",block:!1,ghost:!1,text:"按钮文本",icon:""},cascadeIds:[]}},{group:"基础组件",key:"b-page-header",label:"页面标题",icon:"icon-page-header",component:e=>{let{id:t,title:l,subTitle:n,item:r,style:a={},className:i}=e,o=(0,d.useMemo)(()=>!r.children||Array.isArray(r.children)||"object"!=typeof r.children?null:r.children.extra||[],[r]),[c,u]=(0,d.useState)(o||[]);return(0,s.jsxs)(e6,{id:t,style:{...a},className:i,children:[(0,s.jsxs)("div",{className:"title",children:[(0,s.jsx)("span",{className:"main",children:l}),n&&(0,s.jsx)("span",{className:"sub",children:n})]}),(0,s.jsx)("div",{children:(0,s.jsx)(eu,{list:c,onListChange:e=>{let t=[...e];r.children.extra=t,u(t)}})})]})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n});return(0,s.jsxs)(eb.Form,{layout:"vertical",children:[(0,s.jsx)(eb.Form.Item,{label:"标题",children:(0,s.jsx)(eb.Input,{size:"small",value:t.title,onChange:e=>n("title",e.target.value),placeholder:"请输入标题"})}),(0,s.jsx)(eb.Form.Item,{label:"副标题",children:(0,s.jsx)(eb.Input,{size:"small",value:t.subTitle,onChange:e=>n("subTitle",e.target.value),placeholder:"请输入副标题"})})]})},defaultOptions:{props:{title:"标题",subTitle:"副标题"},children:{extra:[]}}},{group:"基础组件",key:"b-table",label:"数据表格",icon:"icon-table",component:e=>{let{id:t,dataSource:l=[],columns:n=[],pageSize:r=10,bordered:a=!0,size:i,showHeader:o=!0,style:d={},className:c}=e,u=!!r&&!(r<=l.length)&&{total:l.length,pageSize:r,size:i,showSizeChanger:!0,showQuickJumper:!0,hideOnSinglePage:!0,pageSizeOptions:["10","20","30","40"],showTotal:(e,t)=>`共 ${e} 条记录,显示第 ${t[0]}-${t[1]} 条`},p=n.map(e=>({...e,render:e.customRender&&("string"!=typeof e.customRender||""!==e.customRender.trim())?(t,l,n)=>Function("console","Math","Date","Array","Object","String","Number","Boolean","text","record","index",`
759
+ `;let ti=e=>{let{item:t,split:l,padding:n}=e;return(0,s.jsx)(te,{$split:l,$padding:n,children:(0,s.jsxs)(tt,{children:[t.avatar&&(0,s.jsx)(tl,{children:(0,s.jsx)(ey.Avatar,{src:t.avatar})}),(0,s.jsxs)(tn,{children:[t.title&&(0,s.jsx)(tr,{children:t.href?(0,s.jsx)("a",{href:t.href,children:t.title}):t.title}),t.description&&(0,s.jsx)(ta,{children:t.description})]})]})})},to=e=>{let{list:t=[],split:l,bordered:n,size:r,itemLayout:a,style:i,className:o}=e,c=(0,d.useMemo)(()=>"small"===r?"8px 16px":n?"12px 24px":"12px 0",[r,n]);return(0,s.jsx)(e7,{$bordered:n,$split:l,$size:r,style:i,$itemLayout:a,className:o,children:t.map((e,t)=>(0,s.jsx)(ti,{item:e,split:l,padding:c},String(t)))})};var ts=u(190),td=u(185),tc=u.n(td);let tu=[{group:"基础组件",key:"b-text",label:"文本",icon:"icon-text",component:e=>{let{id:t,text:l,item:n,style:r={},customStyle:a={},className:i}=e,o=(0,d.useMemo)(()=>({...(null==n?void 0:n.style)||{},...a||{},...r||{}}),[n,a,r]);return(0,s.jsx)("span",{id:t,style:o,className:i,children:l})},formComponent:e=>{var t,l,n,r,a,i;let{model:o,onChange:d}=e,c=(e,t)=>{let l={...o.customStyle||{},[e]:t};d&&d({...o,customStyle:l})};return(0,s.jsxs)(ey.Form,{children:[(0,s.jsx)(ey.Form.Item,{label:"文本内容",children:(0,s.jsx)(ey.Input.TextArea,{size:"small",value:o.text,onChange:e=>{let t;return t=e.target.value,d&&d({...o,text:t})}})}),(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,s.jsxs)(ey.Space.Compact,{children:[(0,s.jsxs)(ey.Select,{size:"small",value:null==(t=o.customStyle)?void 0:t.fontFamily,style:{width:90},onChange:e=>c("fontFamily",e),children:[(0,s.jsx)(ey.Select.Option,{value:"'黑体', 'SimHei', sans-serif",children:"黑体"}),(0,s.jsx)(ey.Select.Option,{value:"'宋体', 'SimSun', serif",children:"宋体"}),(0,s.jsx)(ey.Select.Option,{value:"'仿宋', 'FangSong', serif",children:"仿宋"}),(0,s.jsx)(ey.Select.Option,{value:"'楷体', 'KaiTi', serif",children:"楷体"}),(0,s.jsx)(ey.Select.Option,{value:"Arial, sans-serif",children:"Arial"})]}),(0,s.jsx)(ey.Select,{size:"small",value:null==(l=o.customStyle)?void 0:l.fontSize,style:{width:90},onChange:e=>c("fontSize",e),children:["12px","14px","16px","20px","22px","24px","32px","48px"].map(e=>(0,s.jsx)(ey.Select.Option,{value:e,children:e},e))}),(0,s.jsx)(ey.ColorPicker,{size:"small",value:null==(n=o.customStyle)?void 0:n.color,onChange:e=>c("color",e.toHexString()),style:{width:90},allowClear:!0})]}),(0,s.jsxs)(ey.Space.Compact,{children:[(0,s.jsx)(ey.Button,{type:(null==(r=o.customStyle)?void 0:r.fontWeight)==="bold"?"primary":void 0,size:"small",onClick:()=>{var e;return c("fontWeight",(null==(e=o.customStyle)?void 0:e.fontWeight)==="bold"?"normal":"bold")},children:"B"}),(0,s.jsx)(ey.Button,{type:(null==(a=o.customStyle)?void 0:a.fontStyle)==="italic"?"primary":void 0,size:"small",onClick:()=>{var e;return c("fontStyle",(null==(e=o.customStyle)?void 0:e.fontStyle)==="italic"?"normal":"italic")},children:"I"}),(0,s.jsx)(ey.Button,{type:(null==(i=o.customStyle)?void 0:i.textDecoration)==="underline"?"primary":void 0,size:"small",onClick:()=>{var e;return c("textDecoration",(null==(e=o.customStyle)?void 0:e.textDecoration)==="underline"?"none":"underline")},children:"U"})]})]})]})},defaultOptions:{style:{fontSize:14,color:"#444444",fontFamily:"'宋体', 'SimSun', serif",fontWeight:"normal",fontStyle:"normal",textDecoration:"none"},props:{text:"文本内容"}}},{group:"基础组件",key:"b-image",label:"图片",icon:"icon-image",component:e=>{let{id:t,src:l,alt:n,width:r,height:a,href:i,className:o}=e,d=(0,s.jsx)("img",{id:t,src:l,alt:n,style:{width:r,height:a},className:o});return i&&i.length?(0,s.jsx)("a",{href:i,target:"_blank",rel:"noreferrer",children:d}):(0,s.jsx)("div",{children:d})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n}),r={Authorization:`Bearer ${localStorage.getItem("ASKDATA_TOKEN")||""}`};return(0,s.jsxs)(ey.Form,{labelCol:{span:24},wrapperCol:{span:24},children:[(0,s.jsx)(ey.Form.Item,{label:(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:["图片URL",(0,s.jsx)(ey.Upload,{name:"file",multiple:!1,accept:".png,.jpg,.jpeg",headers:r,action:"/api/datareport/upload",showUploadList:!1,beforeUpload:e=>{let t=e.type.startsWith("image/");return t||ey.message.error("上传封面只能是图片文件"),t},onChange:e=>{if("done"===e.file.status){var t;n("src",null==(t=e.file.response)?void 0:t.data),ey.message.success("上传成功")}else"error"===e.file.status&&ey.message.error("上传失败")},children:(0,s.jsx)(ey.Button,{size:"small",type:"link",icon:(0,s.jsx)(ev.UploadOutlined,{})})})]}),children:(0,s.jsx)(ey.Input,{size:"small",value:t.src,onChange:e=>n("src",e.target.value)})}),(0,s.jsx)(ey.Form.Item,{label:"图片替代文本",children:(0,s.jsx)(ey.Input,{size:"small",value:t.alt,onChange:e=>n("alt",e.target.value)})}),(0,s.jsx)(ey.Form.Item,{label:"图片链接",children:(0,s.jsx)(ey.Input,{size:"small",value:t.href,onChange:e=>n("href",e.target.value)})}),(0,s.jsx)(ey.Form.Item,{label:"图片宽度",children:(0,s.jsx)(ey.Input,{size:"small",value:t.width,onChange:e=>n("width",e.target.value)})}),(0,s.jsx)(ey.Form.Item,{label:"图片高度",children:(0,s.jsx)(ey.Input,{size:"small",value:t.height,onChange:e=>n("height",e.target.value)})})]})},defaultOptions:{props:{src:"https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png",alt:"",href:"",width:"100%",height:"auto"}}},{group:"基础组件",key:"b-button",label:"按钮",icon:"icon-button",component:e=>{let{id:t,text:l="按钮",type:n="middle",icon:r,size:a,block:i=!1,shape:o="default",ghost:c=!1,item:u,style:p,className:m}=e,{env:x,callbacks:h}=(0,d.useContext)(em),f="danger"===n,g="string"==typeof r?r?(0,s.jsx)(ej,{type:r}):void 0:r;return(0,s.jsx)(ey.Button,{id:t,type:f?"default":n,icon:g,size:a,block:i,shape:["round","circle"].includes(o)?o:void 0,ghost:c,danger:f,onClick:()=>{x&&u&&h&&eq(x,u,h)},style:p,className:m,children:l})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n});return(0,s.jsxs)(ey.Form,{labelCol:{span:6},wrapperCol:{span:18},children:[(0,s.jsx)(ey.Form.Item,{label:"文本",children:(0,s.jsx)(ey.Input,{size:"small",value:t.text,onChange:e=>n("text",e.target.value),placeholder:"请输入按钮文本"})}),(0,s.jsx)(ey.Form.Item,{label:"图标",children:(0,s.jsx)(ey.Input,{size:"small",value:t.icon,onChange:e=>n("icon",e.target.value),placeholder:"请输入按钮图标(antdv 1.7.8)"})}),(0,s.jsx)(ey.Form.Item,{label:"类型",children:(0,s.jsxs)(ey.Radio.Group,{size:"small",value:t.type,onChange:e=>n("type",e.target.value),children:[(0,s.jsx)(ey.Radio.Button,{value:"default",children:"默认"}),(0,s.jsx)(ey.Radio.Button,{value:"primary",children:"主要"}),(0,s.jsx)(ey.Radio.Button,{value:"link",children:"链接"}),(0,s.jsx)(ey.Radio.Button,{value:"dashed",children:"虚线"}),(0,s.jsx)(ey.Radio.Button,{value:"text",children:"文本"})]})}),(0,s.jsx)(ey.Form.Item,{label:"大小",children:(0,s.jsxs)(ey.Radio.Group,{size:"small",value:t.size,onChange:e=>n("size",e.target.value),children:[(0,s.jsx)(ey.Radio.Button,{value:"small",children:"小"}),(0,s.jsx)(ey.Radio.Button,{value:"middle",children:"中"}),(0,s.jsx)(ey.Radio.Button,{value:"large",children:"大"})]})}),(0,s.jsx)(ey.Form.Item,{label:"形状",children:(0,s.jsxs)(ey.Radio.Group,{size:"small",value:t.shape,onChange:e=>n("shape",e.target.value),children:[(0,s.jsx)(ey.Radio.Button,{value:"default",children:"默认"}),(0,s.jsx)(ey.Radio.Button,{value:"round",children:"圆角"}),(0,s.jsx)(ey.Radio.Button,{value:"circle",children:"圆形"})]})}),(0,s.jsx)(ey.Form.Item,{label:"块级",children:(0,s.jsx)(ey.Switch,{size:"small",checked:!!t.block,onChange:e=>n("block",e)})}),(0,s.jsx)(ey.Form.Item,{label:"幽灵",children:(0,s.jsx)(ey.Switch,{size:"small",checked:!!t.ghost,onChange:e=>n("ghost",e)})})]})},defaultOptions:{props:{type:"primary",size:"default",shape:"default",block:!1,ghost:!1,text:"按钮文本",icon:""},cascadeIds:[]}},{group:"基础组件",key:"b-page-header",label:"页面标题",icon:"icon-page-header",component:e=>{let{id:t,title:l,subTitle:n,item:r,style:a={},className:i}=e,o=(0,d.useMemo)(()=>!r.children||Array.isArray(r.children)||"object"!=typeof r.children?null:r.children.extra||[],[r]),[c,u]=(0,d.useState)(o||[]);return(0,s.jsxs)(e6,{id:t,style:{...a},className:i,children:[(0,s.jsxs)("div",{className:"title",children:[(0,s.jsx)("span",{className:"main",children:l}),n&&(0,s.jsx)("span",{className:"sub",children:n})]}),(0,s.jsx)("div",{children:(0,s.jsx)(eu,{list:c,onListChange:e=>{let t=[...e];r.children.extra=t,u(t)}})})]})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n});return(0,s.jsxs)(ey.Form,{layout:"vertical",children:[(0,s.jsx)(ey.Form.Item,{label:"标题",children:(0,s.jsx)(ey.Input,{size:"small",value:t.title,onChange:e=>n("title",e.target.value),placeholder:"请输入标题"})}),(0,s.jsx)(ey.Form.Item,{label:"副标题",children:(0,s.jsx)(ey.Input,{size:"small",value:t.subTitle,onChange:e=>n("subTitle",e.target.value),placeholder:"请输入副标题"})})]})},defaultOptions:{props:{title:"标题",subTitle:"副标题"},children:{extra:[]}}},{group:"基础组件",key:"b-table",label:"数据表格",icon:"icon-table",component:e=>{let{id:t,dataSource:l=[],columns:n=[],pageSize:r=10,bordered:a=!0,size:i,showHeader:o=!0,style:d={},className:c}=e,u=!!r&&!(r<=l.length)&&{total:l.length,pageSize:r,size:i,showSizeChanger:!0,showQuickJumper:!0,hideOnSinglePage:!0,pageSizeOptions:["10","20","30","40"],showTotal:(e,t)=>`共 ${e} 条记录,显示第 ${t[0]}-${t[1]} 条`},p=n.map(e=>({...e,render:e.customRender&&("string"!=typeof e.customRender||""!==e.customRender.trim())?(t,l,n)=>Function("console","Math","Date","Array","Object","String","Number","Boolean","text","record","index",`
760
760
  "use strict";
761
761
  const window = undefined;
762
762
  const document = undefined;
@@ -766,7 +766,7 @@
766
766
  const module = undefined;
767
767
  const exports = undefined;
768
768
  ${e.customRender}
769
- `)(console,Math,Date,Array,Object,String,Number,Boolean,t,l,n):e.render}));return(0,s.jsx)(eb.Table,{id:t,dataSource:l,columns:p,pagination:u,bordered:a,size:i,showHeader:"boolean"!=typeof o||o,rowKey:(e,t)=>String(t),style:{padding:1,...d},className:c})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n}),r=(e,l)=>{let r=[...t.columns||[]];r[e]={...r[e],...l},n("columns",r)},[a,i]=(0,d.useState)(!1),[o,c]=(0,d.useState)(null),u=null!=o&&t.columns[o]?t.columns[o]:{title:"",dataIndex:"",width:"",align:"left",ellipsis:!1},p=[{title:"列名",dataIndex:"title"},{title:"数据索引",dataIndex:"dataIndex"},{title:"操作",width:80,align:"center",render:(e,l,r)=>(0,s.jsxs)(eb.Space,{children:[(0,s.jsx)("a",{onClick:()=>{c(r),i(!0)},children:(0,s.jsx)(ev.EditOutlined,{})}),(0,s.jsx)("a",{onClick:()=>{let e;(e=[...t.columns||[]]).splice(r,1),n("columns",e)},children:(0,s.jsx)(ev.DeleteOutlined,{})})]})}];return(0,s.jsxs)("div",{children:[(0,s.jsxs)(eb.Form,{labelCol:{span:12},wrapperCol:{span:12},children:[(0,s.jsx)(eb.Form.Item,{label:"大小",children:(0,s.jsxs)(eb.Radio.Group,{size:"small",value:t.size,onChange:e=>n("size",e.target.value),children:[(0,s.jsx)(eb.Radio.Button,{value:"small",children:"小"}),(0,s.jsx)(eb.Radio.Button,{value:"middle",children:"中"}),(0,s.jsx)(eb.Radio.Button,{value:"large",children:"大"})]})}),(0,s.jsx)(eb.Form.Item,{label:"边框",children:(0,s.jsx)(eb.Switch,{size:"small",checked:!!t.bordered,onChange:e=>n("bordered",e)})}),(0,s.jsx)(eb.Form.Item,{label:"显示表头",children:(0,s.jsx)(eb.Switch,{size:"small",checked:!!t.showHeader,onChange:e=>n("showHeader",e)})}),(0,s.jsx)(eb.Form.Item,{label:"分页大小",children:(0,s.jsx)(eb.InputNumber,{size:"small",value:t.pageSize,onChange:e=>n("pageSize",e)})})]}),(0,s.jsx)(eb.Divider,{children:"表格列设置"}),(0,s.jsx)(eb.Table,{size:"small",dataSource:t.columns,rowKey:(e,t)=>String(t),columns:p,pagination:!1,bordered:!0}),(0,s.jsx)(eb.Button,{size:"small",onClick:()=>{n("columns",[...t.columns||[],{title:"",dataIndex:"",width:"",align:"left",ellipsis:!1}])},block:!0,children:"添加列"}),(0,s.jsx)(eb.Modal,{title:"编辑列",open:a,footer:null,width:400,onCancel:()=>i(!1),children:(0,s.jsx)(eb.Form,{layout:"vertical",children:(0,s.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:[(0,s.jsx)(eb.Form.Item,{label:"列名",children:(0,s.jsx)(eb.Input,{value:u.title,onChange:e=>r(o,{title:e.target.value})})}),(0,s.jsx)(eb.Form.Item,{label:"数据索引",children:(0,s.jsx)(eb.Input,{value:u.dataIndex,onChange:e=>r(o,{dataIndex:e.target.value})})}),(0,s.jsx)(eb.Form.Item,{label:"宽度",children:(0,s.jsx)(eb.Input,{value:u.width,onChange:e=>r(o,{width:e.target.value})})}),(0,s.jsx)(eb.Form.Item,{label:"对齐",children:(0,s.jsxs)(eb.Radio.Group,{value:u.align,onChange:e=>r(o,{align:e.target.value}),children:[(0,s.jsx)(eb.Radio.Button,{value:"left",children:(0,s.jsx)(ev.AlignLeftOutlined,{})}),(0,s.jsx)(eb.Radio.Button,{value:"center",children:(0,s.jsx)(ev.AlignCenterOutlined,{})}),(0,s.jsx)(eb.Radio.Button,{value:"right",children:(0,s.jsx)(ev.AlignRightOutlined,{})})]})}),(0,s.jsx)(eb.Form.Item,{label:"省略",children:(0,s.jsx)(eb.Switch,{checked:!!u.ellipsis,onChange:e=>r(o,{ellipsis:e})})})]})})})]})},defaultOptions:{datasource:{source:"custom",datasourceId:null,scriptId:null,custom:null},props:{size:"default",bordered:!0,showHeader:!0,pageSize:10,dataSource:[{name:"苹果",count:12},{name:"华为",count:803},{name:"OPPO",count:654},{name:"vivo",count:719}],columns:[{title:"品牌",dataIndex:"name"},{title:"日销量(件)",dataIndex:"count"}]}}},{group:"基础组件",key:"b-list",label:"列表",icon:"icon-unordered-list",component:e=>{let{id:t,pageSize:l=10,bordered:n=!0,size:r="default",itemLayout:a="horizontal",item:i,split:o=!0,style:c={},className:u}=e,p=e3(t,i.datasource)||[],m=(0,d.useMemo)(()=>!!l&&!(l<=p.length)&&{total:p.length,pageSize:l,size:"default"===r?void 0:r,showSizeChanger:!0,showQuickJumper:!0,hideOnSinglePage:!0,pageSizeOptions:["10","20","30","40"],showTotal:(e,t)=>`共 ${e} 条记录,显示第 ${t[0]}-${t[1]} 条`},[l,p.length,r]),x=["p-list",a?`p-list--${a}`:void 0,r?`p-list--${r}`:void 0,o?"p-list--split":void 0,n?"p-list--bordered":void 0,u];return(0,s.jsxs)("div",{id:t,style:{display:"flex",flexDirection:"column",...c},className:x.filter(Boolean).join(" "),children:[(0,s.jsx)(to,{list:p,split:o,bordered:n,size:r,itemLayout:a}),m&&(0,s.jsx)(eb.Pagination,{...m})]})},formComponent:e=>{let{model:t,onChange:l}=e,[n]=eb.Form.useForm();return(0,d.useEffect)(()=>{n.setFieldsValue({size:t.size||"default",itemLayout:t.itemLayout||"horizontal",bordered:t.bordered??!1,split:t.split??!0,pageSize:t.pageSize||10})},[t,n]),(0,s.jsxs)(eb.Form,{form:n,labelCol:{span:12},wrapperCol:{span:12},onValuesChange:e=>{null==l||l({...t,...e})},children:[(0,s.jsx)(eb.Form.Item,{label:"大小",name:"size",children:(0,s.jsxs)(eb.Radio.Group,{size:"small",buttonStyle:"solid",children:[(0,s.jsx)(eb.Radio.Button,{value:"default",children:"默认"}),(0,s.jsx)(eb.Radio.Button,{value:"small",children:"小"})]})}),(0,s.jsx)(eb.Form.Item,{label:"布局",name:"itemLayout",children:(0,s.jsxs)(eb.Radio.Group,{size:"small",buttonStyle:"solid",children:[(0,s.jsx)(eb.Radio.Button,{value:"horizontal",children:"水平"}),(0,s.jsx)(eb.Radio.Button,{value:"vertical",children:"垂直"})]})}),(0,s.jsx)(eb.Form.Item,{label:"边框",name:"bordered",valuePropName:"checked",children:(0,s.jsx)(eb.Switch,{size:"small"})}),(0,s.jsx)(eb.Form.Item,{label:"分割线",name:"split",valuePropName:"checked",children:(0,s.jsx)(eb.Switch,{size:"small"})}),(0,s.jsx)(eb.Form.Item,{label:"分页大小",name:"pageSize",children:(0,s.jsx)(eb.InputNumber,{size:"small"})})]})},defaultOptions:{datasource:{source:"custom",custom:"[]"},props:{size:"default",itemLayout:"horizontal",bordered:!0,split:!0,pageSize:10}}},{group:"基础组件",key:"b-html",label:"HTML",icon:"icon-html",component:e=>{let{id:t,template:l="",item:n,style:r,className:a}=e,i=e3(t,n.datasource),o=(0,d.useMemo)(()=>Object.keys(i||{}),[i]),c=(0,d.useMemo)(()=>o.map(e=>null==i?void 0:i[e]),[o,i]),u=(0,d.useMemo)(()=>(l||"").replace(/{{\s*([^}]+)\s*}}/g,(e,t)=>{try{return Function(...o,`
769
+ `)(console,Math,Date,Array,Object,String,Number,Boolean,t,l,n):e.render}));return(0,s.jsx)(ey.Table,{id:t,dataSource:l,columns:p,pagination:u,bordered:a,size:i,showHeader:"boolean"!=typeof o||o,rowKey:(e,t)=>String(t),style:{padding:1,...d},className:c})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n}),r=(e,l)=>{let r=[...t.columns||[]];r[e]={...r[e],...l},n("columns",r)},[a,i]=(0,d.useState)(!1),[o,c]=(0,d.useState)(null),u=null!=o&&t.columns[o]?t.columns[o]:{title:"",dataIndex:"",width:"",align:"left",ellipsis:!1},p=[{title:"列名",dataIndex:"title"},{title:"数据索引",dataIndex:"dataIndex"},{title:"操作",width:80,align:"center",render:(e,l,r)=>(0,s.jsxs)(ey.Space,{children:[(0,s.jsx)("a",{onClick:()=>{c(r),i(!0)},children:(0,s.jsx)(ev.EditOutlined,{})}),(0,s.jsx)("a",{onClick:()=>{let e;(e=[...t.columns||[]]).splice(r,1),n("columns",e)},children:(0,s.jsx)(ev.DeleteOutlined,{})})]})}];return(0,s.jsxs)("div",{children:[(0,s.jsxs)(ey.Form,{labelCol:{span:12},wrapperCol:{span:12},children:[(0,s.jsx)(ey.Form.Item,{label:"大小",children:(0,s.jsxs)(ey.Radio.Group,{size:"small",value:t.size,onChange:e=>n("size",e.target.value),children:[(0,s.jsx)(ey.Radio.Button,{value:"small",children:"小"}),(0,s.jsx)(ey.Radio.Button,{value:"middle",children:"中"}),(0,s.jsx)(ey.Radio.Button,{value:"large",children:"大"})]})}),(0,s.jsx)(ey.Form.Item,{label:"边框",children:(0,s.jsx)(ey.Switch,{size:"small",checked:!!t.bordered,onChange:e=>n("bordered",e)})}),(0,s.jsx)(ey.Form.Item,{label:"显示表头",children:(0,s.jsx)(ey.Switch,{size:"small",checked:!!t.showHeader,onChange:e=>n("showHeader",e)})}),(0,s.jsx)(ey.Form.Item,{label:"分页大小",children:(0,s.jsx)(ey.InputNumber,{size:"small",value:t.pageSize,onChange:e=>n("pageSize",e)})})]}),(0,s.jsx)(ey.Divider,{children:"表格列设置"}),(0,s.jsx)(ey.Table,{size:"small",dataSource:t.columns,rowKey:(e,t)=>String(t),columns:p,pagination:!1,bordered:!0}),(0,s.jsx)(ey.Button,{size:"small",onClick:()=>{n("columns",[...t.columns||[],{title:"",dataIndex:"",width:"",align:"left",ellipsis:!1}])},block:!0,children:"添加列"}),(0,s.jsx)(ey.Modal,{title:"编辑列",open:a,footer:null,width:400,onCancel:()=>i(!1),children:(0,s.jsx)(ey.Form,{layout:"vertical",children:(0,s.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:[(0,s.jsx)(ey.Form.Item,{label:"列名",children:(0,s.jsx)(ey.Input,{value:u.title,onChange:e=>r(o,{title:e.target.value})})}),(0,s.jsx)(ey.Form.Item,{label:"数据索引",children:(0,s.jsx)(ey.Input,{value:u.dataIndex,onChange:e=>r(o,{dataIndex:e.target.value})})}),(0,s.jsx)(ey.Form.Item,{label:"宽度",children:(0,s.jsx)(ey.Input,{value:u.width,onChange:e=>r(o,{width:e.target.value})})}),(0,s.jsx)(ey.Form.Item,{label:"对齐",children:(0,s.jsxs)(ey.Radio.Group,{value:u.align,onChange:e=>r(o,{align:e.target.value}),children:[(0,s.jsx)(ey.Radio.Button,{value:"left",children:(0,s.jsx)(ev.AlignLeftOutlined,{})}),(0,s.jsx)(ey.Radio.Button,{value:"center",children:(0,s.jsx)(ev.AlignCenterOutlined,{})}),(0,s.jsx)(ey.Radio.Button,{value:"right",children:(0,s.jsx)(ev.AlignRightOutlined,{})})]})}),(0,s.jsx)(ey.Form.Item,{label:"省略",children:(0,s.jsx)(ey.Switch,{checked:!!u.ellipsis,onChange:e=>r(o,{ellipsis:e})})})]})})})]})},defaultOptions:{datasource:{source:"custom",datasourceId:null,scriptId:null,custom:null},props:{size:"default",bordered:!0,showHeader:!0,pageSize:10,dataSource:[{name:"苹果",count:12},{name:"华为",count:803},{name:"OPPO",count:654},{name:"vivo",count:719}],columns:[{title:"品牌",dataIndex:"name"},{title:"日销量(件)",dataIndex:"count"}]}}},{group:"基础组件",key:"b-list",label:"列表",icon:"icon-unordered-list",component:e=>{let{id:t,pageSize:l=10,bordered:n=!0,size:r="default",itemLayout:a="horizontal",item:i,split:o=!0,style:c={},className:u}=e,p=e3(t,i.datasource)||[],m=(0,d.useMemo)(()=>!!l&&!(l<=p.length)&&{total:p.length,pageSize:l,size:"default"===r?void 0:r,showSizeChanger:!0,showQuickJumper:!0,hideOnSinglePage:!0,pageSizeOptions:["10","20","30","40"],showTotal:(e,t)=>`共 ${e} 条记录,显示第 ${t[0]}-${t[1]} 条`},[l,p.length,r]),x=["p-list",a?`p-list--${a}`:void 0,r?`p-list--${r}`:void 0,o?"p-list--split":void 0,n?"p-list--bordered":void 0,u];return(0,s.jsxs)("div",{id:t,style:{display:"flex",flexDirection:"column",...c},className:x.filter(Boolean).join(" "),children:[(0,s.jsx)(to,{list:p,split:o,bordered:n,size:r,itemLayout:a}),m&&(0,s.jsx)(ey.Pagination,{...m})]})},formComponent:e=>{let{model:t,onChange:l}=e,[n]=ey.Form.useForm();return(0,d.useEffect)(()=>{n.setFieldsValue({size:t.size||"default",itemLayout:t.itemLayout||"horizontal",bordered:t.bordered??!1,split:t.split??!0,pageSize:t.pageSize||10})},[t,n]),(0,s.jsxs)(ey.Form,{form:n,labelCol:{span:12},wrapperCol:{span:12},onValuesChange:e=>{null==l||l({...t,...e})},children:[(0,s.jsx)(ey.Form.Item,{label:"大小",name:"size",children:(0,s.jsxs)(ey.Radio.Group,{size:"small",buttonStyle:"solid",children:[(0,s.jsx)(ey.Radio.Button,{value:"default",children:"默认"}),(0,s.jsx)(ey.Radio.Button,{value:"small",children:"小"})]})}),(0,s.jsx)(ey.Form.Item,{label:"布局",name:"itemLayout",children:(0,s.jsxs)(ey.Radio.Group,{size:"small",buttonStyle:"solid",children:[(0,s.jsx)(ey.Radio.Button,{value:"horizontal",children:"水平"}),(0,s.jsx)(ey.Radio.Button,{value:"vertical",children:"垂直"})]})}),(0,s.jsx)(ey.Form.Item,{label:"边框",name:"bordered",valuePropName:"checked",children:(0,s.jsx)(ey.Switch,{size:"small"})}),(0,s.jsx)(ey.Form.Item,{label:"分割线",name:"split",valuePropName:"checked",children:(0,s.jsx)(ey.Switch,{size:"small"})}),(0,s.jsx)(ey.Form.Item,{label:"分页大小",name:"pageSize",children:(0,s.jsx)(ey.InputNumber,{size:"small"})})]})},defaultOptions:{datasource:{source:"custom",custom:"[]"},props:{size:"default",itemLayout:"horizontal",bordered:!0,split:!0,pageSize:10}}},{group:"基础组件",key:"b-html",label:"HTML",icon:"icon-html",component:e=>{let{id:t,template:l="",item:n,style:r,className:a}=e,i=e3(t,n.datasource),o=(0,d.useMemo)(()=>Object.keys(i||{}),[i]),c=(0,d.useMemo)(()=>o.map(e=>null==i?void 0:i[e]),[o,i]),u=(0,d.useMemo)(()=>(l||"").replace(/{{\s*([^}]+)\s*}}/g,(e,t)=>{try{return Function(...o,`
770
770
  "use strict";
771
771
  const window = undefined;
772
772
  const document = undefined;
@@ -776,7 +776,7 @@
776
776
  const module = undefined;
777
777
  const exports = undefined;
778
778
  return ${t};
779
- `)(...c)}catch{return""}}),[l,c]);return(0,s.jsx)("div",{id:t,style:r,className:a,dangerouslySetInnerHTML:{__html:u}})},formComponent:e=>{let{model:t,onChange:l}=e,n=(0,d.useRef)(null);return(0,s.jsx)("div",{children:(0,s.jsx)(eb.Form,{layout:"vertical",children:(0,s.jsx)(eb.Form.Item,{label:(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:["模板 ",(0,s.jsx)("a",{onClick:()=>{var e,t;let l=null==(e=n.current)?void 0:e.editor;null==l||null==(t=l.getAction("editor.action.formatDocument"))||t.run()},children:"格式化"})]}),children:(0,s.jsx)("div",{style:{border:"1px solid #d9d9d9",borderRadius:4,textAlign:"left"},children:(0,s.jsx)(eA(),{onMount:e=>{n.current={editor:e}},height:"300px",defaultLanguage:"html",value:t.template,onChange:e=>{let n;return n=e||"",l&&l({...t,template:n||""})},options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,tabSize:2}})})})})})},defaultOptions:{datasource:{source:"custom",datasourceId:null,scriptId:null,custom:'{"name": "Confucius"}'},props:{dataSource:{name:"Confucius"},template:"<div>{{name}}, welcome to the world of programming.</div>"}}},{group:"基础组件",key:"b-echarts",label:"图表",icon:"icon-echarts",component:e=>{let{id:t,script:l="",item:n,height:r=400,style:a,className:i}=e,o=(0,d.useRef)(null),[c,u]=(0,d.useState)(null),p=e3(t,n.datasource);return(0,d.useEffect)(()=>{if(!o.current)return;let e=ts.init(o.current);u(e);let t=()=>e.resize();return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t),e.dispose()}},[]),(0,d.useEffect)(()=>{let e=(e=>{try{return JSON.parse(e)}catch(t){try{return Function("echarts","console","Math","Date","Array","Object","String","Number","Boolean","data",`
779
+ `)(...c)}catch{return""}}),[l,c]);return(0,s.jsx)("div",{id:t,style:r,className:a,dangerouslySetInnerHTML:{__html:u}})},formComponent:e=>{let{model:t,onChange:l}=e,n=(0,d.useRef)(null);return(0,s.jsx)("div",{children:(0,s.jsx)(ey.Form,{layout:"vertical",children:(0,s.jsx)(ey.Form.Item,{label:(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:["模板 ",(0,s.jsx)("a",{onClick:()=>{var e,t;let l=null==(e=n.current)?void 0:e.editor;null==l||null==(t=l.getAction("editor.action.formatDocument"))||t.run()},children:"格式化"})]}),children:(0,s.jsx)("div",{style:{border:"1px solid #d9d9d9",borderRadius:4,textAlign:"left"},children:(0,s.jsx)(eA(),{onMount:e=>{n.current={editor:e}},height:"300px",defaultLanguage:"html",value:t.template,onChange:e=>{let n;return n=e||"",l&&l({...t,template:n||""})},options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,tabSize:2}})})})})})},defaultOptions:{datasource:{source:"custom",datasourceId:null,scriptId:null,custom:'{"name": "Confucius"}'},props:{dataSource:{name:"Confucius"},template:"<div>{{name}}, welcome to the world of programming.</div>"}}},{group:"基础组件",key:"b-echarts",label:"图表",icon:"icon-echarts",component:e=>{let{id:t,script:l="",item:n,height:r=400,style:a,className:i}=e,o=(0,d.useRef)(null),[c,u]=(0,d.useState)(null),p=e3(t,n.datasource);return(0,d.useEffect)(()=>{if(!o.current)return;let e=ts.init(o.current);u(e);let t=()=>e.resize();return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t),e.dispose()}},[]),(0,d.useEffect)(()=>{let e=(e=>{try{return JSON.parse(e)}catch(t){try{return Function("echarts","console","Math","Date","Array","Object","String","Number","Boolean","data",`
780
780
  "use strict";
781
781
  const window = undefined;
782
782
  const document = undefined;
@@ -786,10 +786,10 @@
786
786
  const module = undefined;
787
787
  const exports = undefined;
788
788
  ${e}
789
- `)(ts,console,Math,Date,Array,Object,String,Number,Boolean,p)}catch(e){return console.error("ECharts 配置解析失败:",e),null}}})(l);c&&e&&(c.setOption(e),setTimeout(()=>c.resize(),50))},[c,l]),(0,s.jsx)("div",{id:t,style:{width:"100%",height:r,...a},className:i,children:(0,s.jsx)("div",{ref:o,style:{width:"100%",height:r,...a}})})},formComponent:e=>{let{model:t,onChange:l}=e,n=(0,d.useRef)(null);return(0,s.jsx)(eb.Form,{labelCol:{span:24},wrapperCol:{span:24},children:(0,s.jsx)(eb.Form.Item,{label:(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:["Echarts 渲染脚本 ",(0,s.jsx)("a",{onClick:()=>{var e,t;let l=null==(e=n.current)?void 0:e.editor;null==l||null==(t=l.getAction("editor.action.formatDocument"))||t.run()},children:"格式化"})]}),children:(0,s.jsxs)("div",{style:{border:"1px solid #d9d9d9",borderRadius:4,textAlign:"left"},children:[(0,s.jsxs)("div",{style:{color:"#0000ff",fontSize:14,padding:"0 50px"},children:["function getOptions(data) ","{"," "]}),(0,s.jsx)(eA(),{onMount:e=>{n.current={editor:e}},height:"400px",defaultLanguage:"javascript",value:t.script,onChange:e=>{let n;return n=e||"",l&&l({...t,script:n||""})},options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,tabSize:2}}),(0,s.jsx)("div",{style:{color:"#0000ff",fontSize:14,padding:"0 50px"},children:"}"})]})})})},defaultOptions:{datasource:{source:"custom",datasourceId:null,scriptId:null,custom:'[{"name":"Mon","value":150},{"name":"Tue","value":230},{"name":"Wed","value":224},{"name":"Thu","value":218},{"name":"Fri","value":135},{"name":"Sat","value":147},{"name":"Sun","value":260}]'},props:{script:`
789
+ `)(ts,console,Math,Date,Array,Object,String,Number,Boolean,p)}catch(e){return console.error("ECharts 配置解析失败:",e),null}}})(l);c&&e&&(c.setOption(e),setTimeout(()=>c.resize(),50))},[c,l]),(0,s.jsx)("div",{id:t,style:{width:"100%",height:r,...a},className:i,children:(0,s.jsx)("div",{ref:o,style:{width:"100%",height:r,...a}})})},formComponent:e=>{let{model:t,onChange:l}=e,n=(0,d.useRef)(null);return(0,s.jsx)(ey.Form,{labelCol:{span:24},wrapperCol:{span:24},children:(0,s.jsx)(ey.Form.Item,{label:(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:["Echarts 渲染脚本 ",(0,s.jsx)("a",{onClick:()=>{var e,t;let l=null==(e=n.current)?void 0:e.editor;null==l||null==(t=l.getAction("editor.action.formatDocument"))||t.run()},children:"格式化"})]}),children:(0,s.jsxs)("div",{style:{border:"1px solid #d9d9d9",borderRadius:4,textAlign:"left"},children:[(0,s.jsxs)("div",{style:{color:"#0000ff",fontSize:14,padding:"0 50px"},children:["function getOptions(data) ","{"," "]}),(0,s.jsx)(eA(),{onMount:e=>{n.current={editor:e}},height:"400px",defaultLanguage:"javascript",value:t.script,onChange:e=>{let n;return n=e||"",l&&l({...t,script:n||""})},options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,tabSize:2}}),(0,s.jsx)("div",{style:{color:"#0000ff",fontSize:14,padding:"0 50px"},children:"}"})]})})})},defaultOptions:{datasource:{source:"custom",datasourceId:null,scriptId:null,custom:'[{"name":"Mon","value":150},{"name":"Tue","value":230},{"name":"Wed","value":224},{"name":"Thu","value":218},{"name":"Fri","value":135},{"name":"Sat","value":147},{"name":"Sun","value":260}]'},props:{script:`
790
790
  return {
791
791
  xAxis: { type: 'category', data: data.map(i => i.name) },
792
792
  yAxis: { type: 'value' },
793
793
  series: [{ data: data.map(i => i.value), type: 'line' }]
794
794
  }
795
- `}}},{group:"表单组件",key:"b-input",label:"输入框",icon:"icon-form-input",component:e=>{let{id:t,var:l="",placeholder:n="",prefix:r,suffix:a,size:i,allowClear:o=!1,search:c=!1,item:u,value:p,onChange:m,onSearch:x,style:h={},className:f}=e,{env:g,callbacks:v}=(0,d.useContext)(em),b=e=>{m&&m(e),g&&u&&l&&e$(g,u,l,e)};return c?(0,s.jsx)(eb.Input.Search,{id:t,value:p,size:i,allowClear:o,placeholder:n,onChange:e=>b(e.target.value),onSearch:()=>{x&&x(p||""),g&&u&&v&&eq(g,u,v)},style:{...h},className:f}):(0,s.jsx)(eb.Input,{id:t,value:p,size:i,allowClear:o,placeholder:n,prefix:"string"==typeof r?void 0:r,suffix:"string"==typeof a?void 0:a,onChange:e=>b(e.target.value),style:{...h},className:f})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n});return(0,s.jsxs)(eb.Form,{labelCol:{span:6},wrapperCol:{span:18},children:[(0,s.jsx)(eb.Form.Item,{label:"搜索框",children:(0,s.jsx)(eb.Switch,{size:"small",checked:!!t.search,onChange:e=>n("search",e)})}),(0,s.jsx)(eb.Form.Item,{label:"变量名",children:(0,s.jsx)(eb.Input,{size:"small",value:t.var,onChange:e=>n("var",e.target.value),placeholder:"请输入变量名"})}),(0,s.jsx)(eb.Form.Item,{label:"占位符",children:(0,s.jsx)(eb.Input,{size:"small",value:t.placeholder,onChange:e=>n("placeholder",e.target.value),placeholder:"请输入占位符"})}),!t.search&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eb.Form.Item,{label:"前缀",children:(0,s.jsx)(eb.Input,{size:"small",value:t.prefix,onChange:e=>n("prefix",e.target.value),placeholder:"请输入前缀"})}),(0,s.jsx)(eb.Form.Item,{label:"后缀",children:(0,s.jsx)(eb.Input,{size:"small",value:t.suffix,onChange:e=>n("suffix",e.target.value),placeholder:"请输入后缀"})})]}),(0,s.jsx)(eb.Form.Item,{label:"大小",children:(0,s.jsxs)(eb.Radio.Group,{size:"small",value:t.size,onChange:e=>n("size",e.target.value),children:[(0,s.jsx)(eb.Radio.Button,{value:"small",children:"小"}),(0,s.jsx)(eb.Radio.Button,{value:"middle",children:"中"}),(0,s.jsx)(eb.Radio.Button,{value:"large",children:"大"})]})}),(0,s.jsx)(eb.Form.Item,{label:"清除图标",children:(0,s.jsx)(eb.Switch,{size:"small",checked:!!t.allowClear,onChange:e=>n("allowClear",e)})})]})},defaultOptions:{props:{var:"",size:"default",allowClear:!0,search:!1,prefix:"",suffix:"",placeholder:"请输入"},cascadeIds:[]}},{group:"表单组件",key:"b-input-number",label:"数字输入框",icon:"icon-form-input-number",component:e=>{let{id:t,var:l="",value:n,size:r,placeholder:a="请输入",min:i=0,max:o=Number.MAX_SAFE_INTEGER,step:c=1,precision:u=0,item:p,onChange:m,style:x={},className:h}=e,{env:f,callbacks:g}=(0,d.useContext)(em);return(0,s.jsx)(eb.InputNumber,{id:t,value:n,placeholder:a,size:r,min:i,max:o,step:c,precision:u,onChange:e=>{var t;return t=e??void 0,void(m&&m(t),f&&p&&l&&e$(f,p,l,t),f&&p&&g&&eq(f,p,g))},style:{width:"100%",...x},className:h})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n});return(0,s.jsxs)(eb.Form,{labelCol:{span:6},wrapperCol:{span:18},children:[(0,s.jsx)(eb.Form.Item,{label:"变量名",children:(0,s.jsx)(eb.Input,{size:"small",value:t.var,onChange:e=>n("var",e.target.value)})}),(0,s.jsx)(eb.Form.Item,{label:"最小值",children:(0,s.jsx)(eb.InputNumber,{size:"small",value:t.min,onChange:e=>n("min",e)})}),(0,s.jsx)(eb.Form.Item,{label:"最大值",children:(0,s.jsx)(eb.InputNumber,{size:"small",value:t.max,onChange:e=>n("max",e)})}),(0,s.jsx)(eb.Form.Item,{label:"步长",children:(0,s.jsx)(eb.InputNumber,{size:"small",value:t.step,onChange:e=>n("step",e)})})]})},defaultOptions:{props:{var:"",size:"default",allowClear:!0,prefix:"",suffix:"",placeholder:"请输入",step:1,min:0,max:100,precision:0},cascadeIds:[]}},{group:"表单组件",key:"b-select",label:"选择框",icon:"icon-form-select",component:e=>{let{id:t,var:l="",size:n,placeholder:r="请选择",allowClear:a=!1,multiple:i=!1,options:o=[],item:c,value:u,onChange:p,style:m={},className:x}=e,{env:h,callbacks:f}=(0,d.useContext)(em);return(0,s.jsx)(eb.Select,{id:t,value:u,size:n,placeholder:r,allowClear:a,mode:i?"multiple":void 0,options:o,onChange:e=>{p&&p(e),h&&c&&l&&e$(h,c,l,e),h&&c&&f&&eq(h,c,f)},style:{width:"100%",...m},className:x})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n}),r=(e,l,r)=>{let a=[...t.options||[]];a[e]={...a[e],[l]:r},n("options",a)},a=[{title:"选项标签",dataIndex:"label",render:(e,t,l)=>(0,s.jsx)(eb.Input,{size:"small",value:t.label,onChange:e=>r(l,"label",e.target.value)})},{title:"选项值",dataIndex:"value",render:(e,t,l)=>(0,s.jsx)(eb.Input,{size:"small",value:t.value,onChange:e=>r(l,"value",e.target.value)})},{title:"操作",render:(e,l,r)=>(0,s.jsx)(eb.Space,{children:(0,s.jsx)(eb.Button,{danger:!0,size:"small",onClick:()=>{let e;(e=[...t.options||[]]).splice(r,1),n("options",e)},children:(0,s.jsx)(ev.DeleteOutlined,{})})})}];return(0,s.jsxs)(eb.Form,{labelCol:{span:6},wrapperCol:{span:18},children:[(0,s.jsx)(eb.Form.Item,{label:"变量名",children:(0,s.jsx)(eb.Input,{size:"small",value:t.var,onChange:e=>n("var",e.target.value),placeholder:"请输入变量名"})}),(0,s.jsx)(eb.Form.Item,{label:"占位符",children:(0,s.jsx)(eb.Input,{size:"small",value:t.placeholder,onChange:e=>n("placeholder",e.target.value),placeholder:"请输入占位符"})}),(0,s.jsx)(eb.Form.Item,{label:"大小",children:(0,s.jsxs)(eb.Radio.Group,{size:"small",value:t.size,onChange:e=>n("size",e.target.value),children:[(0,s.jsx)(eb.Radio.Button,{value:"small",children:"小"}),(0,s.jsx)(eb.Radio.Button,{value:"middle",children:"中"}),(0,s.jsx)(eb.Radio.Button,{value:"large",children:"大"})]})}),(0,s.jsx)(eb.Form.Item,{label:"清除图标",children:(0,s.jsx)(eb.Switch,{size:"small",checked:!!t.allowClear,onChange:e=>n("allowClear",e)})}),(0,s.jsx)(eb.Form.Item,{label:"多选",children:(0,s.jsx)(eb.Switch,{size:"small",checked:!!t.multiple,onChange:e=>n("multiple",e)})}),(0,s.jsxs)(eb.Form.Item,{children:[(0,s.jsx)(eb.Table,{size:"small",dataSource:t.options,columns:a,pagination:!1,rowKey:(e,t)=>String(t),bordered:!0}),(0,s.jsx)(eb.Button,{size:"small",block:!0,onClick:()=>{n("options",[...t.options||[],{label:"",value:""}])},children:"添加选项"})]})]})},defaultOptions:{props:{var:"",size:"default",allowClear:!0,multiple:!1,options:[{label:"选项1",value:"1"},{label:"选项2",value:"2"}]},cascadeIds:[]}},{group:"表单组件",key:"b-capsule",label:"胶囊选择框",icon:"icon-form-capsule",component:e=>{let{id:t,var:l="",size:n="middle",options:r=[],item:a,onChange:i,style:o,className:c}=e,{env:u,callbacks:p}=(0,d.useContext)(em);return(0,s.jsx)("span",{id:t,children:(0,s.jsx)(eb.Radio.Group,{id:t,size:n,buttonStyle:"solid",onChange:e=>{var t;return t=e.target.value,void(i&&i(t),u&&a&&l&&e$(u,a,l,t),u&&a&&p&&eq(u,a,p))},style:o,className:c,children:r.map(e=>(0,s.jsx)(eb.Radio.Button,{value:e.value,children:e.label},e.value))})})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n}),r=(e,l,r)=>{let a=[...t.options||[]];a[e]={...a[e],[l]:r},n("options",a)},a=[{title:"选项标签",dataIndex:"label",render:(e,t,l)=>(0,s.jsx)(eb.Input,{size:"small",value:t.label,onChange:e=>r(l,"label",e.target.value)})},{title:"选项值",dataIndex:"value",render:(e,t,l)=>(0,s.jsx)(eb.Input,{size:"small",value:t.value,onChange:e=>r(l,"value",e.target.value)})},{title:"操作",render:(e,l,r)=>(0,s.jsx)(eb.Space,{children:(0,s.jsx)(eb.Button,{danger:!0,size:"small",onClick:()=>{let e;(e=[...t.options||[]]).splice(r,1),n("options",e)},children:(0,s.jsx)(ev.DeleteOutlined,{})})})}];return(0,s.jsxs)(eb.Form,{labelCol:{span:6},wrapperCol:{span:18},children:[(0,s.jsx)(eb.Form.Item,{label:"变量名",children:(0,s.jsx)(eb.Input,{size:"small",value:t.var,onChange:e=>n("var",e.target.value),placeholder:"请输入变量名"})}),(0,s.jsx)(eb.Form.Item,{label:"大小",children:(0,s.jsxs)(eb.Radio.Group,{size:"small",value:t.size,onChange:e=>n("size",e.target.value),children:[(0,s.jsx)(eb.Radio.Button,{value:"small",children:"小"}),(0,s.jsx)(eb.Radio.Button,{value:"middle",children:"中"}),(0,s.jsx)(eb.Radio.Button,{value:"large",children:"大"})]})}),(0,s.jsxs)(eb.Form.Item,{children:[(0,s.jsx)(eb.Table,{size:"small",dataSource:t.options,columns:a,pagination:!1,rowKey:(e,t)=>String(t),bordered:!0}),(0,s.jsx)(eb.Button,{size:"small",block:!0,onClick:()=>{n("options",[...t.options||[],{label:"",value:""}])},children:"添加选项"})]})]})},defaultOptions:{props:{var:"",size:"default",allowClear:!0,multiple:!1,options:[{label:"选项1",value:"1"},{label:"选项2",value:"2"}]},cascadeIds:[]}},{group:"表单组件",key:"b-checkbox",label:"复选框",icon:"icon-form-checkbox",component:e=>{let{id:t,var:l="",layout:n="horizontal",lineNumber:r=3,options:a=[],item:i,onChange:o,style:c,className:u}=e,{env:p,callbacks:m}=(0,d.useContext)(em),x={...c,display:"grid"===n?"grid":"flex",gap:"grid"===n?void 0:"8px",flexDirection:"vertical"===n?"column":"row",gridTemplateColumns:"grid"===n?`repeat(${r}, 1fr)`:void 0};return(0,s.jsx)("span",{id:t,children:(0,s.jsx)(eb.Checkbox.Group,{onChange:e=>{o&&o(e),p&&i&&l&&e$(p,i,l,e),p&&i&&m&&eq(p,i,m)},style:x,className:u,children:a.map(e=>(0,s.jsx)(eb.Checkbox,{value:e.value,children:e.label},e.value))})})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n}),r=(e,l,r)=>{let a=[...t.options||[]];a[e]={...a[e],[l]:r},n("options",a)},a=[{title:"选项标签",dataIndex:"label",render:(e,t,l)=>(0,s.jsx)(eb.Input,{size:"small",value:t.label,onChange:e=>r(l,"label",e.target.value)})},{title:"选项值",dataIndex:"value",render:(e,t,l)=>(0,s.jsx)(eb.Input,{size:"small",value:t.value,onChange:e=>r(l,"value",e.target.value)})},{title:"操作",render:(e,l,r)=>(0,s.jsx)(eb.Space,{children:(0,s.jsx)(eb.Button,{danger:!0,size:"small",onClick:()=>{let e;(e=[...t.options||[]]).splice(r,1),n("options",e)},children:(0,s.jsx)(ev.DeleteOutlined,{})})})}];return(0,s.jsxs)(eb.Form,{labelCol:{span:6},wrapperCol:{span:18},children:[(0,s.jsx)(eb.Form.Item,{label:"变量名",children:(0,s.jsx)(eb.Input,{size:"small",value:t.var,onChange:e=>n("var",e.target.value),placeholder:"请输入变量名"})}),(0,s.jsx)(eb.Form.Item,{label:"布局",children:(0,s.jsxs)(eb.Radio.Group,{size:"small",value:t.layout,onChange:e=>n("layout",e.target.value),children:[(0,s.jsx)(eb.Radio.Button,{value:"horizontal",children:"水平"}),(0,s.jsx)(eb.Radio.Button,{value:"vertical",children:"垂直"}),(0,s.jsx)(eb.Radio.Button,{value:"grid",children:"网格"})]})}),"grid"===t.layout&&(0,s.jsx)(eb.Form.Item,{label:"网格行数",children:(0,s.jsx)(eb.InputNumber,{size:"small",value:t.lineNumber,onChange:e=>n("lineNumber",e),min:1,max:10})}),(0,s.jsxs)(eb.Form.Item,{children:[(0,s.jsx)(eb.Table,{size:"small",dataSource:t.options,columns:a,pagination:!1,rowKey:(e,t)=>String(t),bordered:!0}),(0,s.jsx)(eb.Button,{size:"small",block:!0,onClick:()=>{n("options",[...t.options||[],{label:"",value:""}])},children:"添加选项"})]})]})},defaultOptions:{props:{var:"",layout:"horizontal",lineNumber:3,options:[{label:"选项1",value:"1"},{label:"选项2",value:"2"}]},cascadeIds:[]}},{group:"表单组件",key:"b-date-picker",label:"日期选择器",icon:"icon-form-date-picker",component:e=>{let{id:t,var:l="",size:n,allowClear:r=!1,type:a="date",showTime:i=!1,value:o,item:c,onChange:u,style:p={},className:m}=e,{env:x,callbacks:h}=(0,d.useContext)(em),f=e=>{u&&u(e),x&&c&&l&&e$(x,c,l,e),x&&c&&h&&eq(x,c,h)};if("time"===a){let e="string"==typeof o&&o?tc()(o,"HH:mm"):void 0;return(0,s.jsx)(eb.TimePicker,{id:t,value:e,format:"HH:mm",placeholder:"请选择时间",size:n,allowClear:r,onChange:e=>f(e?e.format("HH:mm"):void 0),style:{...(null==c?void 0:c.style)||{},...p},className:m})}if("month"===a||"year"===a){let e="month"===a?"YYYY-MM":"YYYY",l="string"==typeof o&&o?tc()(o,e):void 0;return(0,s.jsx)(eb.DatePicker,{id:t,picker:a,value:l,format:e,placeholder:"month"===a?"请选择月份":"请选择年份",size:n,allowClear:r,onChange:t=>f(t?t.format(e):void 0),onPanelChange:t=>f(t?t.format(e):void 0),style:{...(null==c?void 0:c.style)||{},...p},className:m})}if("range"===a){let e=i?"YYYY-MM-DD HH:mm":"YYYY-MM-DD",l=Array.isArray(o)&&o[0]?tc()(o[0],e):void 0,a=Array.isArray(o)&&o[1]?tc()(o[1],e):void 0;return(0,s.jsx)(eb.DatePicker.RangePicker,{id:t,value:[l,a],format:e,placeholder:["开始日期","结束日期"],size:n,allowClear:r,showTime:i,onChange:t=>f(t&&t[0]&&t[1]?[t[0].format(e),t[1].format(e)]:void 0),style:{...(null==c?void 0:c.style)||{},...p},className:m})}let g=i?"YYYY-MM-DD HH:mm":"YYYY-MM-DD",v="string"==typeof o&&o?tc()(o,g):void 0;return(0,s.jsx)(eb.DatePicker,{id:t,value:v,format:g,placeholder:"请选择日期",size:n,allowClear:r,showTime:i,style:{...(null==c?void 0:c.style)||{},...p},className:m,onChange:e=>f(e?e.format(g):void 0)})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n});return(0,s.jsxs)(eb.Form,{labelCol:{span:6},wrapperCol:{span:18},children:[(0,s.jsx)(eb.Form.Item,{label:"变量名",children:(0,s.jsx)(eb.Input,{size:"small",value:t.var,onChange:e=>n("var",e.target.value),placeholder:"请输入变量名"})}),(0,s.jsx)(eb.Form.Item,{label:"类型",children:(0,s.jsxs)(eb.Radio.Group,{size:"small",value:t.type,onChange:e=>n("type",e.target.value),children:[(0,s.jsx)(eb.Radio.Button,{value:"date",children:"日期"}),(0,s.jsx)(eb.Radio.Button,{value:"time",children:"时间"}),(0,s.jsx)(eb.Radio.Button,{value:"month",children:"月份"}),(0,s.jsx)(eb.Radio.Button,{value:"year",children:"年份"}),(0,s.jsx)(eb.Radio.Button,{value:"range",children:"日期范围"})]})}),(0,s.jsx)(eb.Form.Item,{label:"大小",children:(0,s.jsxs)(eb.Radio.Group,{size:"small",value:t.size,onChange:e=>n("size",e.target.value),children:[(0,s.jsx)(eb.Radio.Button,{value:"small",children:"小"}),(0,s.jsx)(eb.Radio.Button,{value:"middle",children:"中"}),(0,s.jsx)(eb.Radio.Button,{value:"large",children:"大"})]})}),(0,s.jsx)(eb.Form.Item,{label:"清除图标",children:(0,s.jsx)(eb.Switch,{size:"small",checked:!!t.allowClear,onChange:e=>n("allowClear",e)})}),(0,s.jsx)(eb.Form.Item,{label:"显示时间",children:(0,s.jsx)(eb.Switch,{size:"small",checked:!!t.showTime,onChange:e=>n("showTime",e)})})]})},defaultOptions:{props:{var:"",size:"default",allowClear:!0,showTime:!1,type:"date"},cascadeIds:[]}},{group:"表单组件",key:"b-switch",label:"开关",icon:"icon-form-switch",component:e=>{let{id:t,var:l="",checked:n,disabled:r,size:a="default",checkedChildren:i,unCheckedChildren:o,item:c,onChange:u,style:p={},className:m}=e,{env:x,callbacks:h}=(0,d.useContext)(em);return(0,s.jsx)("span",{children:(0,s.jsx)(eb.Switch,{id:t,checked:n,disabled:r,size:"small"===a?"small":void 0,checkedChildren:i,unCheckedChildren:o,onChange:e=>{u&&u(e),x&&c&&l&&e$(x,c,l,e),x&&c&&h&&eq(x,c,h)},style:p,className:m})})},formComponent:e=>{let{model:t,onChange:l}=e;return(0,s.jsx)(eb.Form,{labelCol:{span:6},wrapperCol:{span:18},children:(0,s.jsx)(eb.Form.Item,{label:"变量名",children:(0,s.jsx)(eb.Input,{size:"small",value:t.var,onChange:e=>{let n;return n=e.target.value,l&&l({...t,var:n})},placeholder:"请输入变量名"})})})},defaultOptions:{props:{var:"",size:"default",checkedChildren:"开",unCheckedChildren:"关"},cascadeIds:[]}},{group:"容器组件",key:"b-space",label:"容器",icon:"icon-space",component:e=>{let{id:t,align:l="start",size:n="small",direction:r="horizontal",item:a,style:i={},className:o}=e,{designable:c}=(0,d.useContext)(ei),[u,p]=(0,d.useState)(a.children||[]),m=(0,d.useMemo)(()=>({...i,...a.style||{},alignItems:l,flexDirection:r,gap:n}),[a,l,n,r]);return(0,s.jsx)(eu,{rootComponent:eb.Space,rootData:{id:t,style:m,className:o},list:u,item:a,onListChange:e=>{a.children=e,p(e)}})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n});return(0,s.jsxs)(eb.Form,{labelCol:{span:6},wrapperCol:{span:18},children:[(0,s.jsx)(eb.Form.Item,{label:"方向",children:(0,s.jsxs)(eb.Radio.Group,{size:"small",value:t.direction,onChange:e=>n("direction",e.target.value),children:[(0,s.jsx)(eb.Radio.Button,{value:"horizontal",children:"水平"}),(0,s.jsx)(eb.Radio.Button,{value:"vertical",children:"垂直"})]})}),(0,s.jsx)(eb.Form.Item,{label:"大小",children:(0,s.jsxs)(eb.Radio.Group,{size:"small",value:t.size,onChange:e=>n("size",e.target.value),children:[(0,s.jsx)(eb.Radio.Button,{value:"small",children:"小"}),(0,s.jsx)(eb.Radio.Button,{value:"middle",children:"中"}),(0,s.jsx)(eb.Radio.Button,{value:"large",children:"大"})]})}),(0,s.jsx)(eb.Form.Item,{label:"对齐",children:(0,s.jsxs)(eb.Radio.Group,{size:"small",value:t.align,onChange:e=>n("align",e.target.value),children:[(0,s.jsx)(eb.Radio.Button,{value:"start",children:"开始"}),(0,s.jsx)(eb.Radio.Button,{value:"end",children:"结束"}),(0,s.jsx)(eb.Radio.Button,{value:"center",children:"居中"}),(0,s.jsx)(eb.Radio.Button,{value:"baseline",children:"基线"})]})})]})},defaultOptions:{props:{align:"flex-start",direction:"row",size:"8px"},children:[]}},{group:"容器组件",key:"b-card",label:"卡片",icon:"icon-card",component:e=>{let{id:t,bordered:l=!1,size:n="default",title:r,hoverable:a=!1,shadow:i=!0,item:o,style:c,className:u}=e,p=(0,d.useMemo)(()=>!o.children||Array.isArray(o.children)||"object"!=typeof o.children?null:o.children.title||[],[o]),[m,x]=(0,d.useState)(p||[]),h=(0,d.useMemo)(()=>!o.children||Array.isArray(o.children)||"object"!=typeof o.children?null:o.children.extra||[],[o]),[f,g]=(0,d.useState)(h||[]),v=(0,d.useMemo)(()=>o.children?Array.isArray(o.children)?o.children:"object"!=typeof o.children?null:o.children.body||[]:null,[o]),[b,y]=(0,d.useState)(v||[]),j=(0,d.useMemo)(()=>!o.children||Array.isArray(o.children)||"object"!=typeof o.children?null:o.children.actions||[],[o]),[C,w]=(0,d.useState)(j||[]);return(0,s.jsx)(eb.Card,{id:t,variant:l?"outlined":"borderless",size:n,hoverable:a,className:[i?"ant-card-shadow":void 0,u].filter(Boolean).join(" "),title:(null==r?void 0:r.length)&&!(null==p?void 0:p.length)?r:p?(0,s.jsx)(eu,{list:m,onListChange:e=>{o.children.title=e,x(e)}}):r,extra:h&&(0,s.jsx)(eu,{list:f,onListChange:e=>{o.children.extra=e,g(e)}}),actions:j&&[(0,s.jsx)(eu,{list:C,onListChange:e=>{o.children.actions=e,w(e)}})],styles:{header:{borderBottom:"none"}},style:c,children:v&&(0,s.jsx)(eu,{list:b,onListChange:e=>{Array.isArray(o.children)?o.children=e:o.children.body=e,y(e)}})})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n});return(0,s.jsxs)(eb.Form,{labelCol:{span:12},wrapperCol:{span:12},children:[(0,s.jsx)(eb.Form.Item,{label:"标题",children:(0,s.jsx)(eb.Input,{size:"small",value:t.title,onChange:e=>n("title",e.target.value)})}),(0,s.jsx)(eb.Form.Item,{label:"边框",children:(0,s.jsx)(eb.Switch,{size:"small",checked:!!t.bordered,onChange:e=>n("bordered",e)})}),(0,s.jsx)(eb.Form.Item,{label:"悬停效果",children:(0,s.jsx)(eb.Switch,{size:"small",checked:!!t.hoverable,onChange:e=>n("hoverable",e)})}),(0,s.jsx)(eb.Form.Item,{label:"阴影",children:(0,s.jsx)(eb.Switch,{size:"small",checked:!!t.shadow,onChange:e=>n("shadow",e)})}),(0,s.jsx)(eb.Form.Item,{label:"大小",children:(0,s.jsxs)(eb.Radio.Group,{size:"small",value:t.size,onChange:e=>n("size",e.target.value),children:[(0,s.jsx)(eb.Radio.Button,{value:"default",children:"默认"}),(0,s.jsx)(eb.Radio.Button,{value:"small",children:"小"})]})})]})},defaultOptions:{props:{title:"标题",bordered:!0,hoverable:!0,shadow:!0,size:"default"},children:{title:[],extra:[],body:[],actions:[]}}},{group:"容器组件",key:"b-row",label:"栅格行",icon:"icon-grid-row",component:e=>{let{id:t,gutter:l,item:n,style:r,className:a}=e,{designable:i}=(0,d.useContext)(ei),[o,c]=(0,d.useState)(n.children||[]);return(0,s.jsx)(eu,{rootComponent:eb.Row,rootData:{id:t,gutter:l,style:n.style||r,className:n.className||a},list:o,item:n,onListChange:e=>{n.children=e,c(e)}})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n}),r=t.gutter||[0,0];return(0,s.jsxs)(eb.Form,{labelCol:{span:12},wrapperCol:{span:12},children:[(0,s.jsx)(eb.Form.Item,{label:"列间距",children:(0,s.jsx)(eb.InputNumber,{size:"small",value:r[0],min:0,step:4,onChange:e=>n("gutter",[e||0,r[1]])})}),(0,s.jsx)(eb.Form.Item,{label:"行间距",children:(0,s.jsx)(eb.InputNumber,{size:"small",value:r[1],min:0,step:4,onChange:e=>n("gutter",[r[0],e||0])})})]})},defaultOptions:{props:{gutter:[12,12]},children:[]}},{group:"容器组件",key:"b-col",label:"栅格列",icon:"icon-grid-columns",component:e=>{let{id:t,span:l=24,xs:n,sm:r,md:a,lg:i,xl:o,xxl:c,item:u,style:p={},className:m}=e,{designable:x}=(0,d.useContext)(ei),{deviceWidth:h}=(0,d.useContext)(em),[f,g]=(0,d.useState)(u.children||[]),v=(0,d.useMemo)(()=>{let e=h||1600,t=null;return e<576&&n&&(t=n),e>=576&&r&&(t=r),e>=768&&a&&(t=a),e>=992&&i&&(t=i),e>=1200&&o&&(t=o),e>=1600&&c&&(t=c),t||l},[n,r,a,i,o,c,l,h]);return(0,s.jsx)(eu,{rootComponent:eb.Col,rootData:{id:t||u.id,span:v,style:{...u.style||{},...p},className:m},list:f,item:u,onListChange:e=>{u.children=e,g(e)}})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n});return(0,s.jsxs)(eb.Form,{labelCol:{span:12},wrapperCol:{span:12},children:[(0,s.jsx)(eb.Form.Item,{label:"默认列数",children:(0,s.jsx)(eb.InputNumber,{size:"small",value:t.span,min:0,max:24,step:4,onChange:e=>n("span",e||0)})}),(0,s.jsx)(eb.Form.Item,{label:(0,s.jsxs)(s.Fragment,{children:["xs ",(0,s.jsx)(eb.Tooltip,{title:"<576px 响应式栅格",children:(0,s.jsx)(e9,{})})]}),children:(0,s.jsx)(eb.InputNumber,{size:"small",value:t.xs,min:0,max:24,step:4,onChange:e=>n("xs",e||0)})}),(0,s.jsx)(eb.Form.Item,{label:(0,s.jsxs)(s.Fragment,{children:["sm ",(0,s.jsx)(eb.Tooltip,{title:"≥576px 响应式栅格",children:(0,s.jsx)(e9,{})})]}),children:(0,s.jsx)(eb.InputNumber,{size:"small",value:t.sm,min:0,max:24,step:4,onChange:e=>n("sm",e||0)})}),(0,s.jsx)(eb.Form.Item,{label:(0,s.jsxs)(s.Fragment,{children:["md ",(0,s.jsx)(eb.Tooltip,{title:"≥768px 响应式栅格",children:(0,s.jsx)(e9,{})})]}),children:(0,s.jsx)(eb.InputNumber,{size:"small",value:t.md,min:0,max:24,step:4,onChange:e=>n("md",e||0)})}),(0,s.jsx)(eb.Form.Item,{label:(0,s.jsxs)(s.Fragment,{children:["lg ",(0,s.jsx)(eb.Tooltip,{title:"≥992px 响应式栅格",children:(0,s.jsx)(e9,{})})]}),children:(0,s.jsx)(eb.InputNumber,{size:"small",value:t.lg,min:0,max:24,step:4,onChange:e=>n("lg",e||0)})}),(0,s.jsx)(eb.Form.Item,{label:(0,s.jsxs)(s.Fragment,{children:["xl ",(0,s.jsx)(eb.Tooltip,{title:"≥1200px 响应式栅格",children:(0,s.jsx)(e9,{})})]}),children:(0,s.jsx)(eb.InputNumber,{size:"small",value:t.xl,min:0,max:24,step:4,onChange:e=>n("xl",e||0)})}),(0,s.jsx)(eb.Form.Item,{label:(0,s.jsxs)(s.Fragment,{children:["xxl ",(0,s.jsx)(eb.Tooltip,{title:"≥1600px 响应式栅格",children:(0,s.jsx)(e9,{})})]}),children:(0,s.jsx)(eb.InputNumber,{size:"small",value:t.xxl,min:0,max:24,step:4,onChange:e=>n("xxl",e||0)})})]})},defaultOptions:{props:{xs:24,sm:12,md:12,lg:6,xl:6,xxl:6,span:8},children:[]}}]})(),p})());
795
+ `}}},{group:"表单组件",key:"b-input",label:"输入框",icon:"icon-form-input",component:e=>{let{id:t,var:l="",placeholder:n="",prefix:r,suffix:a,size:i,allowClear:o=!1,search:c=!1,item:u,value:p,onChange:m,onSearch:x,style:h={},className:f}=e,{env:g,callbacks:v}=(0,d.useContext)(em),y=e=>{m&&m(e),g&&u&&l&&e$(g,u,l,e)};return c?(0,s.jsx)(ey.Input.Search,{id:t,value:p,size:i,allowClear:o,placeholder:n,onChange:e=>y(e.target.value),onSearch:()=>{x&&x(p||""),g&&u&&v&&eq(g,u,v)},style:{...h},className:f}):(0,s.jsx)(ey.Input,{id:t,value:p,size:i,allowClear:o,placeholder:n,prefix:"string"==typeof r?void 0:r,suffix:"string"==typeof a?void 0:a,onChange:e=>y(e.target.value),style:{...h},className:f})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n});return(0,s.jsxs)(ey.Form,{labelCol:{span:6},wrapperCol:{span:18},children:[(0,s.jsx)(ey.Form.Item,{label:"搜索框",children:(0,s.jsx)(ey.Switch,{size:"small",checked:!!t.search,onChange:e=>n("search",e)})}),(0,s.jsx)(ey.Form.Item,{label:"变量名",children:(0,s.jsx)(ey.Input,{size:"small",value:t.var,onChange:e=>n("var",e.target.value),placeholder:"请输入变量名"})}),(0,s.jsx)(ey.Form.Item,{label:"占位符",children:(0,s.jsx)(ey.Input,{size:"small",value:t.placeholder,onChange:e=>n("placeholder",e.target.value),placeholder:"请输入占位符"})}),!t.search&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ey.Form.Item,{label:"前缀",children:(0,s.jsx)(ey.Input,{size:"small",value:t.prefix,onChange:e=>n("prefix",e.target.value),placeholder:"请输入前缀"})}),(0,s.jsx)(ey.Form.Item,{label:"后缀",children:(0,s.jsx)(ey.Input,{size:"small",value:t.suffix,onChange:e=>n("suffix",e.target.value),placeholder:"请输入后缀"})})]}),(0,s.jsx)(ey.Form.Item,{label:"大小",children:(0,s.jsxs)(ey.Radio.Group,{size:"small",value:t.size,onChange:e=>n("size",e.target.value),children:[(0,s.jsx)(ey.Radio.Button,{value:"small",children:"小"}),(0,s.jsx)(ey.Radio.Button,{value:"middle",children:"中"}),(0,s.jsx)(ey.Radio.Button,{value:"large",children:"大"})]})}),(0,s.jsx)(ey.Form.Item,{label:"清除图标",children:(0,s.jsx)(ey.Switch,{size:"small",checked:!!t.allowClear,onChange:e=>n("allowClear",e)})})]})},defaultOptions:{props:{var:"",size:"default",allowClear:!0,search:!1,prefix:"",suffix:"",placeholder:"请输入"},cascadeIds:[]}},{group:"表单组件",key:"b-input-number",label:"数字输入框",icon:"icon-form-input-number",component:e=>{let{id:t,var:l="",value:n,size:r,placeholder:a="请输入",min:i=0,max:o=Number.MAX_SAFE_INTEGER,step:c=1,precision:u=0,item:p,onChange:m,style:x={},className:h}=e,{env:f,callbacks:g}=(0,d.useContext)(em);return(0,s.jsx)(ey.InputNumber,{id:t,value:n,placeholder:a,size:r,min:i,max:o,step:c,precision:u,onChange:e=>{var t;return t=e??void 0,void(m&&m(t),f&&p&&l&&e$(f,p,l,t),f&&p&&g&&eq(f,p,g))},style:{width:"100%",...x},className:h})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n});return(0,s.jsxs)(ey.Form,{labelCol:{span:6},wrapperCol:{span:18},children:[(0,s.jsx)(ey.Form.Item,{label:"变量名",children:(0,s.jsx)(ey.Input,{size:"small",value:t.var,onChange:e=>n("var",e.target.value)})}),(0,s.jsx)(ey.Form.Item,{label:"最小值",children:(0,s.jsx)(ey.InputNumber,{size:"small",value:t.min,onChange:e=>n("min",e)})}),(0,s.jsx)(ey.Form.Item,{label:"最大值",children:(0,s.jsx)(ey.InputNumber,{size:"small",value:t.max,onChange:e=>n("max",e)})}),(0,s.jsx)(ey.Form.Item,{label:"步长",children:(0,s.jsx)(ey.InputNumber,{size:"small",value:t.step,onChange:e=>n("step",e)})})]})},defaultOptions:{props:{var:"",size:"default",allowClear:!0,prefix:"",suffix:"",placeholder:"请输入",step:1,min:0,max:100,precision:0},cascadeIds:[]}},{group:"表单组件",key:"b-select",label:"选择框",icon:"icon-form-select",component:e=>{let{id:t,var:l="",size:n,placeholder:r="请选择",allowClear:a=!1,multiple:i=!1,options:o=[],item:c,value:u,onChange:p,style:m={},className:x}=e,{env:h,callbacks:f}=(0,d.useContext)(em);return(0,s.jsx)(ey.Select,{id:t,value:u,size:n,placeholder:r,allowClear:a,mode:i?"multiple":void 0,options:o,onChange:e=>{p&&p(e),h&&c&&l&&e$(h,c,l,e),h&&c&&f&&eq(h,c,f)},style:{width:"100%",...m},className:x})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n}),r=(e,l,r)=>{let a=[...t.options||[]];a[e]={...a[e],[l]:r},n("options",a)},a=[{title:"选项标签",dataIndex:"label",render:(e,t,l)=>(0,s.jsx)(ey.Input,{size:"small",value:t.label,onChange:e=>r(l,"label",e.target.value)})},{title:"选项值",dataIndex:"value",render:(e,t,l)=>(0,s.jsx)(ey.Input,{size:"small",value:t.value,onChange:e=>r(l,"value",e.target.value)})},{title:"操作",render:(e,l,r)=>(0,s.jsx)(ey.Space,{children:(0,s.jsx)(ey.Button,{danger:!0,size:"small",onClick:()=>{let e;(e=[...t.options||[]]).splice(r,1),n("options",e)},children:(0,s.jsx)(ev.DeleteOutlined,{})})})}];return(0,s.jsxs)(ey.Form,{labelCol:{span:6},wrapperCol:{span:18},children:[(0,s.jsx)(ey.Form.Item,{label:"变量名",children:(0,s.jsx)(ey.Input,{size:"small",value:t.var,onChange:e=>n("var",e.target.value),placeholder:"请输入变量名"})}),(0,s.jsx)(ey.Form.Item,{label:"占位符",children:(0,s.jsx)(ey.Input,{size:"small",value:t.placeholder,onChange:e=>n("placeholder",e.target.value),placeholder:"请输入占位符"})}),(0,s.jsx)(ey.Form.Item,{label:"大小",children:(0,s.jsxs)(ey.Radio.Group,{size:"small",value:t.size,onChange:e=>n("size",e.target.value),children:[(0,s.jsx)(ey.Radio.Button,{value:"small",children:"小"}),(0,s.jsx)(ey.Radio.Button,{value:"middle",children:"中"}),(0,s.jsx)(ey.Radio.Button,{value:"large",children:"大"})]})}),(0,s.jsx)(ey.Form.Item,{label:"清除图标",children:(0,s.jsx)(ey.Switch,{size:"small",checked:!!t.allowClear,onChange:e=>n("allowClear",e)})}),(0,s.jsx)(ey.Form.Item,{label:"多选",children:(0,s.jsx)(ey.Switch,{size:"small",checked:!!t.multiple,onChange:e=>n("multiple",e)})}),(0,s.jsxs)(ey.Form.Item,{children:[(0,s.jsx)(ey.Table,{size:"small",dataSource:t.options,columns:a,pagination:!1,rowKey:(e,t)=>String(t),bordered:!0}),(0,s.jsx)(ey.Button,{size:"small",block:!0,onClick:()=>{n("options",[...t.options||[],{label:"",value:""}])},children:"添加选项"})]})]})},defaultOptions:{props:{var:"",size:"default",allowClear:!0,multiple:!1,options:[{label:"选项1",value:"1"},{label:"选项2",value:"2"}]},cascadeIds:[]}},{group:"表单组件",key:"b-capsule",label:"胶囊选择框",icon:"icon-form-capsule",component:e=>{let{id:t,var:l="",size:n="middle",options:r=[],item:a,onChange:i,style:o,className:c}=e,{env:u,callbacks:p}=(0,d.useContext)(em);return(0,s.jsx)("span",{id:t,children:(0,s.jsx)(ey.Radio.Group,{id:t,size:n,buttonStyle:"solid",onChange:e=>{var t;return t=e.target.value,void(i&&i(t),u&&a&&l&&e$(u,a,l,t),u&&a&&p&&eq(u,a,p))},style:o,className:c,children:r.map(e=>(0,s.jsx)(ey.Radio.Button,{value:e.value,children:e.label},e.value))})})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n}),r=(e,l,r)=>{let a=[...t.options||[]];a[e]={...a[e],[l]:r},n("options",a)},a=[{title:"选项标签",dataIndex:"label",render:(e,t,l)=>(0,s.jsx)(ey.Input,{size:"small",value:t.label,onChange:e=>r(l,"label",e.target.value)})},{title:"选项值",dataIndex:"value",render:(e,t,l)=>(0,s.jsx)(ey.Input,{size:"small",value:t.value,onChange:e=>r(l,"value",e.target.value)})},{title:"操作",render:(e,l,r)=>(0,s.jsx)(ey.Space,{children:(0,s.jsx)(ey.Button,{danger:!0,size:"small",onClick:()=>{let e;(e=[...t.options||[]]).splice(r,1),n("options",e)},children:(0,s.jsx)(ev.DeleteOutlined,{})})})}];return(0,s.jsxs)(ey.Form,{labelCol:{span:6},wrapperCol:{span:18},children:[(0,s.jsx)(ey.Form.Item,{label:"变量名",children:(0,s.jsx)(ey.Input,{size:"small",value:t.var,onChange:e=>n("var",e.target.value),placeholder:"请输入变量名"})}),(0,s.jsx)(ey.Form.Item,{label:"大小",children:(0,s.jsxs)(ey.Radio.Group,{size:"small",value:t.size,onChange:e=>n("size",e.target.value),children:[(0,s.jsx)(ey.Radio.Button,{value:"small",children:"小"}),(0,s.jsx)(ey.Radio.Button,{value:"middle",children:"中"}),(0,s.jsx)(ey.Radio.Button,{value:"large",children:"大"})]})}),(0,s.jsxs)(ey.Form.Item,{children:[(0,s.jsx)(ey.Table,{size:"small",dataSource:t.options,columns:a,pagination:!1,rowKey:(e,t)=>String(t),bordered:!0}),(0,s.jsx)(ey.Button,{size:"small",block:!0,onClick:()=>{n("options",[...t.options||[],{label:"",value:""}])},children:"添加选项"})]})]})},defaultOptions:{props:{var:"",size:"default",allowClear:!0,multiple:!1,options:[{label:"选项1",value:"1"},{label:"选项2",value:"2"}]},cascadeIds:[]}},{group:"表单组件",key:"b-checkbox",label:"复选框",icon:"icon-form-checkbox",component:e=>{let{id:t,var:l="",layout:n="horizontal",lineNumber:r=3,options:a=[],item:i,onChange:o,style:c,className:u}=e,{env:p,callbacks:m}=(0,d.useContext)(em),x={...c,display:"grid"===n?"grid":"flex",gap:"grid"===n?void 0:"8px",flexDirection:"vertical"===n?"column":"row",gridTemplateColumns:"grid"===n?`repeat(${r}, 1fr)`:void 0};return(0,s.jsx)("span",{id:t,children:(0,s.jsx)(ey.Checkbox.Group,{onChange:e=>{o&&o(e),p&&i&&l&&e$(p,i,l,e),p&&i&&m&&eq(p,i,m)},style:x,className:u,children:a.map(e=>(0,s.jsx)(ey.Checkbox,{value:e.value,children:e.label},e.value))})})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n}),r=(e,l,r)=>{let a=[...t.options||[]];a[e]={...a[e],[l]:r},n("options",a)},a=[{title:"选项标签",dataIndex:"label",render:(e,t,l)=>(0,s.jsx)(ey.Input,{size:"small",value:t.label,onChange:e=>r(l,"label",e.target.value)})},{title:"选项值",dataIndex:"value",render:(e,t,l)=>(0,s.jsx)(ey.Input,{size:"small",value:t.value,onChange:e=>r(l,"value",e.target.value)})},{title:"操作",render:(e,l,r)=>(0,s.jsx)(ey.Space,{children:(0,s.jsx)(ey.Button,{danger:!0,size:"small",onClick:()=>{let e;(e=[...t.options||[]]).splice(r,1),n("options",e)},children:(0,s.jsx)(ev.DeleteOutlined,{})})})}];return(0,s.jsxs)(ey.Form,{labelCol:{span:6},wrapperCol:{span:18},children:[(0,s.jsx)(ey.Form.Item,{label:"变量名",children:(0,s.jsx)(ey.Input,{size:"small",value:t.var,onChange:e=>n("var",e.target.value),placeholder:"请输入变量名"})}),(0,s.jsx)(ey.Form.Item,{label:"布局",children:(0,s.jsxs)(ey.Radio.Group,{size:"small",value:t.layout,onChange:e=>n("layout",e.target.value),children:[(0,s.jsx)(ey.Radio.Button,{value:"horizontal",children:"水平"}),(0,s.jsx)(ey.Radio.Button,{value:"vertical",children:"垂直"}),(0,s.jsx)(ey.Radio.Button,{value:"grid",children:"网格"})]})}),"grid"===t.layout&&(0,s.jsx)(ey.Form.Item,{label:"网格行数",children:(0,s.jsx)(ey.InputNumber,{size:"small",value:t.lineNumber,onChange:e=>n("lineNumber",e),min:1,max:10})}),(0,s.jsxs)(ey.Form.Item,{children:[(0,s.jsx)(ey.Table,{size:"small",dataSource:t.options,columns:a,pagination:!1,rowKey:(e,t)=>String(t),bordered:!0}),(0,s.jsx)(ey.Button,{size:"small",block:!0,onClick:()=>{n("options",[...t.options||[],{label:"",value:""}])},children:"添加选项"})]})]})},defaultOptions:{props:{var:"",layout:"horizontal",lineNumber:3,options:[{label:"选项1",value:"1"},{label:"选项2",value:"2"}]},cascadeIds:[]}},{group:"表单组件",key:"b-date-picker",label:"日期选择器",icon:"icon-form-date-picker",component:e=>{let{id:t,var:l="",size:n,allowClear:r=!1,type:a="date",showTime:i=!1,value:o,item:c,onChange:u,style:p={},className:m}=e,{env:x,callbacks:h}=(0,d.useContext)(em),f=e=>{u&&u(e),x&&c&&l&&e$(x,c,l,e),x&&c&&h&&eq(x,c,h)};if("time"===a){let e="string"==typeof o&&o?tc()(o,"HH:mm"):void 0;return(0,s.jsx)(ey.TimePicker,{id:t,value:e,format:"HH:mm",placeholder:"请选择时间",size:n,allowClear:r,onChange:e=>f(e?e.format("HH:mm"):void 0),style:{...(null==c?void 0:c.style)||{},...p},className:m})}if("month"===a||"year"===a){let e="month"===a?"YYYY-MM":"YYYY",l="string"==typeof o&&o?tc()(o,e):void 0;return(0,s.jsx)(ey.DatePicker,{id:t,picker:a,value:l,format:e,placeholder:"month"===a?"请选择月份":"请选择年份",size:n,allowClear:r,onChange:t=>f(t?t.format(e):void 0),onPanelChange:t=>f(t?t.format(e):void 0),style:{...(null==c?void 0:c.style)||{},...p},className:m})}if("range"===a){let e=i?"YYYY-MM-DD HH:mm":"YYYY-MM-DD",l=Array.isArray(o)&&o[0]?tc()(o[0],e):void 0,a=Array.isArray(o)&&o[1]?tc()(o[1],e):void 0;return(0,s.jsx)(ey.DatePicker.RangePicker,{id:t,value:[l,a],format:e,placeholder:["开始日期","结束日期"],size:n,allowClear:r,showTime:i,onChange:t=>f(t&&t[0]&&t[1]?[t[0].format(e),t[1].format(e)]:void 0),style:{...(null==c?void 0:c.style)||{},...p},className:m})}let g=i?"YYYY-MM-DD HH:mm":"YYYY-MM-DD",v="string"==typeof o&&o?tc()(o,g):void 0;return(0,s.jsx)(ey.DatePicker,{id:t,value:v,format:g,placeholder:"请选择日期",size:n,allowClear:r,showTime:i,style:{...(null==c?void 0:c.style)||{},...p},className:m,onChange:e=>f(e?e.format(g):void 0)})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n});return(0,s.jsxs)(ey.Form,{labelCol:{span:6},wrapperCol:{span:18},children:[(0,s.jsx)(ey.Form.Item,{label:"变量名",children:(0,s.jsx)(ey.Input,{size:"small",value:t.var,onChange:e=>n("var",e.target.value),placeholder:"请输入变量名"})}),(0,s.jsx)(ey.Form.Item,{label:"类型",children:(0,s.jsxs)(ey.Radio.Group,{size:"small",value:t.type,onChange:e=>n("type",e.target.value),children:[(0,s.jsx)(ey.Radio.Button,{value:"date",children:"日期"}),(0,s.jsx)(ey.Radio.Button,{value:"time",children:"时间"}),(0,s.jsx)(ey.Radio.Button,{value:"month",children:"月份"}),(0,s.jsx)(ey.Radio.Button,{value:"year",children:"年份"}),(0,s.jsx)(ey.Radio.Button,{value:"range",children:"日期范围"})]})}),(0,s.jsx)(ey.Form.Item,{label:"大小",children:(0,s.jsxs)(ey.Radio.Group,{size:"small",value:t.size,onChange:e=>n("size",e.target.value),children:[(0,s.jsx)(ey.Radio.Button,{value:"small",children:"小"}),(0,s.jsx)(ey.Radio.Button,{value:"middle",children:"中"}),(0,s.jsx)(ey.Radio.Button,{value:"large",children:"大"})]})}),(0,s.jsx)(ey.Form.Item,{label:"清除图标",children:(0,s.jsx)(ey.Switch,{size:"small",checked:!!t.allowClear,onChange:e=>n("allowClear",e)})}),(0,s.jsx)(ey.Form.Item,{label:"显示时间",children:(0,s.jsx)(ey.Switch,{size:"small",checked:!!t.showTime,onChange:e=>n("showTime",e)})})]})},defaultOptions:{props:{var:"",size:"default",allowClear:!0,showTime:!1,type:"date"},cascadeIds:[]}},{group:"表单组件",key:"b-switch",label:"开关",icon:"icon-form-switch",component:e=>{let{id:t,var:l="",checked:n,disabled:r,size:a="default",checkedChildren:i,unCheckedChildren:o,item:c,onChange:u,style:p={},className:m}=e,{env:x,callbacks:h}=(0,d.useContext)(em);return(0,s.jsx)("span",{children:(0,s.jsx)(ey.Switch,{id:t,checked:n,disabled:r,size:"small"===a?"small":void 0,checkedChildren:i,unCheckedChildren:o,onChange:e=>{u&&u(e),x&&c&&l&&e$(x,c,l,e),x&&c&&h&&eq(x,c,h)},style:p,className:m})})},formComponent:e=>{let{model:t,onChange:l}=e;return(0,s.jsx)(ey.Form,{labelCol:{span:6},wrapperCol:{span:18},children:(0,s.jsx)(ey.Form.Item,{label:"变量名",children:(0,s.jsx)(ey.Input,{size:"small",value:t.var,onChange:e=>{let n;return n=e.target.value,l&&l({...t,var:n})},placeholder:"请输入变量名"})})})},defaultOptions:{props:{var:"",size:"default",checkedChildren:"开",unCheckedChildren:"关"},cascadeIds:[]}},{group:"容器组件",key:"b-space",label:"容器",icon:"icon-space",component:e=>{let{id:t,align:l="start",size:n="small",direction:r="horizontal",item:a,style:i={},className:o}=e,{designable:c}=(0,d.useContext)(ei),[u,p]=(0,d.useState)(a.children||[]),m=(0,d.useMemo)(()=>({...i,...a.style||{},alignItems:l,flexDirection:r,gap:n}),[a,l,n,r]);return(0,s.jsx)(eu,{rootComponent:ey.Space,rootData:{id:t,style:m,className:o},list:u,item:a,onListChange:e=>{a.children=e,p(e)}})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n});return(0,s.jsxs)(ey.Form,{labelCol:{span:6},wrapperCol:{span:18},children:[(0,s.jsx)(ey.Form.Item,{label:"方向",children:(0,s.jsxs)(ey.Radio.Group,{size:"small",value:t.direction,onChange:e=>n("direction",e.target.value),children:[(0,s.jsx)(ey.Radio.Button,{value:"horizontal",children:"水平"}),(0,s.jsx)(ey.Radio.Button,{value:"vertical",children:"垂直"})]})}),(0,s.jsx)(ey.Form.Item,{label:"大小",children:(0,s.jsxs)(ey.Radio.Group,{size:"small",value:t.size,onChange:e=>n("size",e.target.value),children:[(0,s.jsx)(ey.Radio.Button,{value:"small",children:"小"}),(0,s.jsx)(ey.Radio.Button,{value:"middle",children:"中"}),(0,s.jsx)(ey.Radio.Button,{value:"large",children:"大"})]})}),(0,s.jsx)(ey.Form.Item,{label:"对齐",children:(0,s.jsxs)(ey.Radio.Group,{size:"small",value:t.align,onChange:e=>n("align",e.target.value),children:[(0,s.jsx)(ey.Radio.Button,{value:"start",children:"开始"}),(0,s.jsx)(ey.Radio.Button,{value:"end",children:"结束"}),(0,s.jsx)(ey.Radio.Button,{value:"center",children:"居中"}),(0,s.jsx)(ey.Radio.Button,{value:"baseline",children:"基线"})]})})]})},defaultOptions:{props:{align:"flex-start",direction:"row",size:"8px"},children:[]}},{group:"容器组件",key:"b-card",label:"卡片",icon:"icon-card",component:e=>{let{id:t,bordered:l=!1,size:n="default",title:r,hoverable:a=!1,shadow:i=!0,item:o,style:c,className:u}=e,p=(0,d.useMemo)(()=>!o.children||Array.isArray(o.children)||"object"!=typeof o.children?null:o.children.title||[],[o]),[m,x]=(0,d.useState)(p||[]),h=(0,d.useMemo)(()=>!o.children||Array.isArray(o.children)||"object"!=typeof o.children?null:o.children.extra||[],[o]),[f,g]=(0,d.useState)(h||[]),v=(0,d.useMemo)(()=>o.children?Array.isArray(o.children)?o.children:"object"!=typeof o.children?null:o.children.body||[]:null,[o]),[y,b]=(0,d.useState)(v||[]),j=(0,d.useMemo)(()=>!o.children||Array.isArray(o.children)||"object"!=typeof o.children?null:o.children.actions||[],[o]),[C,w]=(0,d.useState)(j||[]);return(0,s.jsx)(ey.Card,{id:t,variant:l?"outlined":"borderless",size:n,hoverable:a,className:[i?"ant-card-shadow":void 0,u].filter(Boolean).join(" "),title:(null==r?void 0:r.length)&&!(null==p?void 0:p.length)?r:p?(0,s.jsx)(eu,{list:m,onListChange:e=>{o.children.title=e,x(e)}}):r,extra:h&&(0,s.jsx)(eu,{list:f,onListChange:e=>{o.children.extra=e,g(e)}}),actions:j&&[(0,s.jsx)(eu,{list:C,onListChange:e=>{o.children.actions=e,w(e)}})],styles:{header:{borderBottom:"none"}},style:c,children:v&&(0,s.jsx)(eu,{list:y,onListChange:e=>{Array.isArray(o.children)?o.children=e:o.children.body=e,b(e)}})})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n});return(0,s.jsxs)(ey.Form,{labelCol:{span:12},wrapperCol:{span:12},children:[(0,s.jsx)(ey.Form.Item,{label:"标题",children:(0,s.jsx)(ey.Input,{size:"small",value:t.title,onChange:e=>n("title",e.target.value)})}),(0,s.jsx)(ey.Form.Item,{label:"边框",children:(0,s.jsx)(ey.Switch,{size:"small",checked:!!t.bordered,onChange:e=>n("bordered",e)})}),(0,s.jsx)(ey.Form.Item,{label:"悬停效果",children:(0,s.jsx)(ey.Switch,{size:"small",checked:!!t.hoverable,onChange:e=>n("hoverable",e)})}),(0,s.jsx)(ey.Form.Item,{label:"阴影",children:(0,s.jsx)(ey.Switch,{size:"small",checked:!!t.shadow,onChange:e=>n("shadow",e)})}),(0,s.jsx)(ey.Form.Item,{label:"大小",children:(0,s.jsxs)(ey.Radio.Group,{size:"small",value:t.size,onChange:e=>n("size",e.target.value),children:[(0,s.jsx)(ey.Radio.Button,{value:"default",children:"默认"}),(0,s.jsx)(ey.Radio.Button,{value:"small",children:"小"})]})})]})},defaultOptions:{props:{title:"标题",bordered:!0,hoverable:!0,shadow:!0,size:"default"},children:{title:[],extra:[],body:[],actions:[]}}},{group:"容器组件",key:"b-row",label:"栅格行",icon:"icon-grid-row",component:e=>{let{id:t,gutter:l,item:n,style:r,className:a}=e,{designable:i}=(0,d.useContext)(ei),[o,c]=(0,d.useState)(n.children||[]);return(0,s.jsx)(eu,{rootComponent:ey.Row,rootData:{id:t,gutter:l,style:n.style||r,className:n.className||a},list:o,item:n,onListChange:e=>{n.children=e,c(e)}})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n}),r=t.gutter||[0,0];return(0,s.jsxs)(ey.Form,{labelCol:{span:12},wrapperCol:{span:12},children:[(0,s.jsx)(ey.Form.Item,{label:"列间距",children:(0,s.jsx)(ey.InputNumber,{size:"small",value:r[0],min:0,step:4,onChange:e=>n("gutter",[e||0,r[1]])})}),(0,s.jsx)(ey.Form.Item,{label:"行间距",children:(0,s.jsx)(ey.InputNumber,{size:"small",value:r[1],min:0,step:4,onChange:e=>n("gutter",[r[0],e||0])})})]})},defaultOptions:{props:{gutter:[12,12]},children:[]}},{group:"容器组件",key:"b-col",label:"栅格列",icon:"icon-grid-columns",component:e=>{let{id:t,span:l=24,xs:n,sm:r,md:a,lg:i,xl:o,xxl:c,item:u,style:p={},className:m}=e,{designable:x}=(0,d.useContext)(ei),{deviceWidth:h}=(0,d.useContext)(em),[f,g]=(0,d.useState)(u.children||[]),v=(0,d.useMemo)(()=>{let e=h||1600,t=null;return e<576&&n&&(t=n),e>=576&&r&&(t=r),e>=768&&a&&(t=a),e>=992&&i&&(t=i),e>=1200&&o&&(t=o),e>=1600&&c&&(t=c),t||l},[n,r,a,i,o,c,l,h]);return(0,s.jsx)(eu,{rootComponent:ey.Col,rootData:{id:t||u.id,span:v,style:{...u.style||{},...p},className:m},list:f,item:u,onListChange:e=>{u.children=e,g(e)}})},formComponent:e=>{let{model:t,onChange:l}=e,n=(e,n)=>l&&l({...t,[e]:n});return(0,s.jsxs)(ey.Form,{labelCol:{span:12},wrapperCol:{span:12},children:[(0,s.jsx)(ey.Form.Item,{label:"默认列数",children:(0,s.jsx)(ey.InputNumber,{size:"small",value:t.span,min:0,max:24,step:4,onChange:e=>n("span",e||0)})}),(0,s.jsx)(ey.Form.Item,{label:(0,s.jsxs)(s.Fragment,{children:["xs ",(0,s.jsx)(ey.Tooltip,{title:"<576px 响应式栅格",children:(0,s.jsx)(e9,{})})]}),children:(0,s.jsx)(ey.InputNumber,{size:"small",value:t.xs,min:0,max:24,step:4,onChange:e=>n("xs",e||0)})}),(0,s.jsx)(ey.Form.Item,{label:(0,s.jsxs)(s.Fragment,{children:["sm ",(0,s.jsx)(ey.Tooltip,{title:"≥576px 响应式栅格",children:(0,s.jsx)(e9,{})})]}),children:(0,s.jsx)(ey.InputNumber,{size:"small",value:t.sm,min:0,max:24,step:4,onChange:e=>n("sm",e||0)})}),(0,s.jsx)(ey.Form.Item,{label:(0,s.jsxs)(s.Fragment,{children:["md ",(0,s.jsx)(ey.Tooltip,{title:"≥768px 响应式栅格",children:(0,s.jsx)(e9,{})})]}),children:(0,s.jsx)(ey.InputNumber,{size:"small",value:t.md,min:0,max:24,step:4,onChange:e=>n("md",e||0)})}),(0,s.jsx)(ey.Form.Item,{label:(0,s.jsxs)(s.Fragment,{children:["lg ",(0,s.jsx)(ey.Tooltip,{title:"≥992px 响应式栅格",children:(0,s.jsx)(e9,{})})]}),children:(0,s.jsx)(ey.InputNumber,{size:"small",value:t.lg,min:0,max:24,step:4,onChange:e=>n("lg",e||0)})}),(0,s.jsx)(ey.Form.Item,{label:(0,s.jsxs)(s.Fragment,{children:["xl ",(0,s.jsx)(ey.Tooltip,{title:"≥1200px 响应式栅格",children:(0,s.jsx)(e9,{})})]}),children:(0,s.jsx)(ey.InputNumber,{size:"small",value:t.xl,min:0,max:24,step:4,onChange:e=>n("xl",e||0)})}),(0,s.jsx)(ey.Form.Item,{label:(0,s.jsxs)(s.Fragment,{children:["xxl ",(0,s.jsx)(ey.Tooltip,{title:"≥1600px 响应式栅格",children:(0,s.jsx)(e9,{})})]}),children:(0,s.jsx)(ey.InputNumber,{size:"small",value:t.xxl,min:0,max:24,step:4,onChange:e=>n("xxl",e||0)})})]})},defaultOptions:{props:{xs:24,sm:12,md:12,lg:6,xl:6,xxl:6,span:8},children:[]}}]})(),p})());