bi-sdk-react 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/js/bi-sdk.es.js +53 -32
- package/dist/types/components/PageDesigner.d.ts +1 -1
- package/dist/types/components/panel/ChatInput.d.ts +1 -1
- package/dist/types/components/plugins/@antd/item-props/CheckboxProps.d.ts +3 -3
- package/dist/types/components/plugins/@antd/item-props/ColProps.d.ts +2 -2
- package/dist/umd/js/bi-sdk.umd.min.js +43 -22
- package/package.json +1 -1
- package/src/components/PageDesigner.tsx +69 -4
- package/src/components/panel/ChatInput.tsx +76 -46
- package/src/components/panel/PropertiesPanel.tsx +2 -2
- package/src/components/plugins/@antd/index.ts +0 -1
- package/src/components/plugins/@antd/item-props/CapsuleProps.tsx +1 -1
- package/src/components/plugins/@antd/item-props/CheckboxProps.tsx +90 -42
- package/src/components/plugins/@antd/item-props/ColProps.tsx +139 -25
- package/src/components/plugins/@antd/item-props/SelectProps.tsx +1 -1
- package/src/components/plugins/@antd/item-props/TextProps.tsx +1 -2
|
@@ -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),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`
|
|
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:()=>e9,PluginType:()=>i.PluginType,plugins:()=>tp,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 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 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}}),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: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;
|
|
@@ -152,6 +152,11 @@
|
|
|
152
152
|
background-color: #fafafa;
|
|
153
153
|
font-size: 12px;
|
|
154
154
|
position: relative;
|
|
155
|
+
|
|
156
|
+
.anticon {
|
|
157
|
+
font-size: 36px;
|
|
158
|
+
color: var(--ant-green-8);
|
|
159
|
+
}
|
|
155
160
|
}
|
|
156
161
|
.attachment-card .name {
|
|
157
162
|
max-width: 80px;
|
|
@@ -167,9 +172,19 @@
|
|
|
167
172
|
position: absolute;
|
|
168
173
|
top: 4px;
|
|
169
174
|
right: 2px;
|
|
175
|
+
|
|
176
|
+
.anticon {
|
|
177
|
+
font-size: 12px;
|
|
178
|
+
color: var(--ant-color-text-tertiary);
|
|
179
|
+
}
|
|
170
180
|
}
|
|
171
181
|
.attachment-card .remove:hover {
|
|
172
182
|
color: #666;
|
|
183
|
+
|
|
184
|
+
.anticon {
|
|
185
|
+
font-size: 12px;
|
|
186
|
+
color: var(--ant-color-text-secondary);
|
|
187
|
+
}
|
|
173
188
|
}
|
|
174
189
|
.agent-info {
|
|
175
190
|
box-sizing: border-box;
|
|
@@ -179,11 +194,17 @@
|
|
|
179
194
|
border-bottom: none;
|
|
180
195
|
background-color: #eff1f9;
|
|
181
196
|
font-size: 14px;
|
|
182
|
-
color:
|
|
197
|
+
color: var(--ant-color-text-label);
|
|
183
198
|
display: flex;
|
|
184
199
|
align-items: center;
|
|
185
|
-
|
|
200
|
+
flex-wrap: wrap;
|
|
186
201
|
user-select: none;
|
|
202
|
+
gap: 8px;
|
|
203
|
+
|
|
204
|
+
a {
|
|
205
|
+
color: var(--ant-color-text-disabled);
|
|
206
|
+
margin-left: 4px;
|
|
207
|
+
}
|
|
187
208
|
}
|
|
188
209
|
.attachment-bar + .agent-info {
|
|
189
210
|
border-radius: 0;
|
|
@@ -308,7 +329,7 @@
|
|
|
308
329
|
width: 50px;
|
|
309
330
|
height: 26px;
|
|
310
331
|
color: #fff;
|
|
311
|
-
font-size:
|
|
332
|
+
font-size: 14px;
|
|
312
333
|
background-color: rgb(184, 184, 191);
|
|
313
334
|
border: unset;
|
|
314
335
|
border-radius: 14px;
|
|
@@ -316,9 +337,9 @@
|
|
|
316
337
|
cursor: pointer;
|
|
317
338
|
}
|
|
318
339
|
.send-btn.send-btn-active {
|
|
319
|
-
background-color: var(--
|
|
340
|
+
background-color: var(--ant-color-primary);
|
|
320
341
|
}
|
|
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)(
|
|
342
|
+
`,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)([]),[w,S]=(0,d.useState)(l||""),[I,z]=(0,d.useState)(0),[k,O]=(0,d.useState)(!1),[T,R]=(0,d.useState)(Array.isArray(p)?p:[]),F=(0,d.useMemo)(()=>!1,[]);(0,d.useImperativeHandle)(t,()=>({focus(){var e;null==(e=v.current)||e.focus()}})),(0,d.useEffect)(()=>S(l||""),[l]),(0,d.useEffect)(()=>{m&&m(w)},[w]),(0,d.useEffect)(()=>b(c||""),[c]),(0,d.useEffect)(()=>R(Array.isArray(p)?p:[]),[p]);let D=!!(w&&w.trim()),N=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},E=()=>{if(!D||a)return;let e=Date.now();if(e-I<400)return;z(e);let t=(w||"").trim();if(!t)return;let l={demand:t,title:k?y:"",agentIds:j.map(e=>e.id),csvData:T.reduce((e,t)=>({...e,[t.name]:t.csvBySheet}),{})};x&&x(l),S("")},A=(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;return t=e.id||null,void(f&&f(t),C(t=>[...t,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:[T.length>0&&(0,s.jsx)("div",{className:"attachment-bar",children:T.map(e=>(0,s.jsxs)("div",{className:"attachment-card",children:[(0,s.jsx)(ej,{type:"icon-excel"}),(0,s.jsx)(ey.Typography.Text,{className:"name",ellipsis:{tooltip:e.name},children:e.name}),(0,s.jsx)("a",{className:"remove",onClick:()=>{var t;let l;return t=e.uid,void(R(l=T.filter(e=>e.uid!==t)),g&&g(l))},children:(0,s.jsx)(ev.DeleteOutlined,{})})]}))}),j.length>0&&(0,s.jsx)("div",{className:"agent-info",children:j.map((e,t)=>(0,s.jsxs)("div",{children:[(0,s.jsxs)("span",{className:"name",children:["@ ",e.name]}),(0,s.jsx)("a",{className:"remove",onClick:()=>{f&&f(null),C(e=>e.filter((e,l)=>l!==t))},children:"\xd7"})]},String(e.id)))}),k&&(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:w,onPressEnter:e=>{"Enter"===e.key&&(e.shiftKey||(e.preventDefault(),E()))},onChange:e=>S(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:()=>A,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:k,disabled:r||a,onChange:e=>O(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 N(n),a=[...T,{uid:`${Date.now()}_${Math.random()}`,name:e.name,size:e.size,csvBySheet:r}];R(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:[!F&&(0,s.jsx)("div",{className:"tips",children:"按 Enter 发送,Shift+Enter 换行"}),(0,s.jsx)("a",{className:`send-btn ${!a&&(null==w?void 0:w.length)>0?"send-btn-active":""}`,onClick:E,children:(0,s.jsx)(ev.SendOutlined,{})})]})]})]})})}),eT=x().div`
|
|
322
343
|
display: flex;
|
|
323
344
|
flex-direction: column;
|
|
324
345
|
height: 100%;
|
|
@@ -398,7 +419,7 @@
|
|
|
398
419
|
font-size: 16px;
|
|
399
420
|
color: var(--ant-color-text-secondary);
|
|
400
421
|
}
|
|
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),
|
|
422
|
+
`,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),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)(ey.Space,{children:(0,s.jsx)(ey.Tooltip,{title:"复制到剪切板",children:(0,s.jsx)("a",{className:"toolbar",onClick:()=>{eL()(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
423
|
display: flex;
|
|
403
424
|
flex-direction: column;
|
|
404
425
|
height: 100%;
|
|
@@ -525,7 +546,7 @@
|
|
|
525
546
|
justify-content: flex-end;
|
|
526
547
|
}
|
|
527
548
|
}
|
|
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:
|
|
549
|
+
`,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:5},wrapperCol:{span:19},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
550
|
display: flex;
|
|
530
551
|
flex-direction: column;
|
|
531
552
|
height: 100%;
|
|
@@ -665,11 +686,11 @@
|
|
|
665
686
|
border-right: solid 2px #1890ff;
|
|
666
687
|
background: linear-gradient(to left, #1890ff1a, #ffffff);
|
|
667
688
|
}
|
|
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]),
|
|
689
|
+
`,e5=e=>{let{open:t,onCancel:l,onOk:n}=e,[r,a]=(0,d.useState)(JSON.stringify({info:{},datasources:[],scripts:[],variables:[],items:[]}));return(0,s.jsx)(ey.Modal,{title:"导入页面",open:t,width:800,onCancel:l,onOk:()=>null==n?void 0:n(JSON.parse(r)),okText:"导入",cancelText:"取消",styles:{body:{height:"calc(100vh - 250px)",overflow:"auto"}},children:(0,s.jsx)("div",{className:"body",style:{flex:"1 1 auto",display:"flex",height:"100%"},children:(0,s.jsx)(eE.Editor,{height:"100%",defaultLanguage:"json",value:r,options:{minimap:{enabled:!1}},onChange:e=>a(e||"")})})})},e9=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,A]=(0,d.useState)(!1),B=(0,d.useMemo)(()=>{let e=S?"250px":"",t=z?"400px":"";return{gridTemplateColumns:`${e} 1fr ${t}`}},[S,z]),L=(0,d.useMemo)(()=>({display:S?"flex":"none"}),[S]),P=(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),M(e.items),F(e),m([JSON.parse(JSON.stringify(e))]),h([]),setTimeout(()=>g(!1),0)}}));let M=(e,t)=>{e&&e.forEach(e=>{e.id||(e.id=t||Math.random().toString(36).slice(2,10)),Array.isArray(e.children)?M(e.children):"object"==typeof e.children&&e.children&&Object.keys(e.children).forEach(t=>{Array.isArray(e.children[t])&&M(e.children[t],Math.random().toString(36).slice(2,10))})})};return(0,s.jsxs)(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.jsx)(ey.Divider,{orientation:"vertical"}),(0,s.jsx)(ey.Tooltip,{title:"导入JSON",children:(0,s.jsx)("a",{className:`toolbar ${x.length>0?"active":""}`,onClick:()=>{A(!0)},children:(0,s.jsx)(ev.ImportOutlined,{})})})]}),(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:B,children:[(0,s.jsxs)("div",{className:"left",style:L,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)(eP,{})]})]}),(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:P,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"})})})]})})]})]})]}),(0,s.jsx)(e5,{open:E,onOk:e=>{A(!1),F(e)},onCancel:()=>A(!1)})]})}),e6=x()(ev.InfoCircleOutlined)`
|
|
669
690
|
vertical-align: middle;
|
|
670
691
|
margin-left: 2px;
|
|
671
692
|
color: var(--ant-color-text-description);
|
|
672
|
-
`,
|
|
693
|
+
`,e3=x().div`
|
|
673
694
|
width: 100%;
|
|
674
695
|
padding: 0 12px;
|
|
675
696
|
border-bottom: solid 1px #e8e8e8;
|
|
@@ -689,7 +710,7 @@
|
|
|
689
710
|
color: #999;
|
|
690
711
|
font-size: 12px;
|
|
691
712
|
}
|
|
692
|
-
`,
|
|
713
|
+
`,e7=(e,t)=>(0,d.useMemo)(()=>{if(!t)return null;if("custom"===(t.source||"custom"))try{return JSON.parse(t.custom||"[]")}catch(e){}return null},[e,t]),te=x().div`
|
|
693
714
|
box-sizing: border-box;
|
|
694
715
|
margin: 0;
|
|
695
716
|
padding: 0;
|
|
@@ -708,7 +729,7 @@
|
|
|
708
729
|
${e=>"vertical"===e.$itemLayout&&(0,m.css)`
|
|
709
730
|
flex-direction: column;
|
|
710
731
|
`}
|
|
711
|
-
`,
|
|
732
|
+
`,tt=x().div`
|
|
712
733
|
display: flex;
|
|
713
734
|
align-items: center;
|
|
714
735
|
justify-content: space-between;
|
|
@@ -721,18 +742,18 @@
|
|
|
721
742
|
border-bottom: none;
|
|
722
743
|
}
|
|
723
744
|
`}
|
|
724
|
-
`,
|
|
745
|
+
`,tl=x().div`
|
|
725
746
|
display: flex;
|
|
726
747
|
flex: 1;
|
|
727
748
|
align-items: flex-start;
|
|
728
749
|
max-width: 100%;
|
|
729
|
-
`,tl=x().div`
|
|
730
|
-
margin-right: 16px;
|
|
731
750
|
`,tn=x().div`
|
|
751
|
+
margin-right: 16px;
|
|
752
|
+
`,tr=x().div`
|
|
732
753
|
flex: 1 0;
|
|
733
754
|
width: 0;
|
|
734
755
|
color: rgba(0, 0, 0, 0.85);
|
|
735
|
-
`,
|
|
756
|
+
`,ta=x().h4`
|
|
736
757
|
margin-bottom: 4px;
|
|
737
758
|
color: rgba(0, 0, 0, 0.85);
|
|
738
759
|
font-size: 14px;
|
|
@@ -748,7 +769,7 @@
|
|
|
748
769
|
color: #1890ff;
|
|
749
770
|
}
|
|
750
771
|
}
|
|
751
|
-
`,
|
|
772
|
+
`,ti=x().div`
|
|
752
773
|
color: rgba(0, 0, 0, 0.45);
|
|
753
774
|
font-size: 14px;
|
|
754
775
|
line-height: 1.5715;
|
|
@@ -756,7 +777,7 @@
|
|
|
756
777
|
margin-top: 16px;
|
|
757
778
|
text-align: right;
|
|
758
779
|
padding: ${e=>e.$bordered?"0 24px 24px":"0"};
|
|
759
|
-
`;let
|
|
780
|
+
`;let to=e=>{let{item:t,split:l,padding:n}=e;return(0,s.jsx)(tt,{$split:l,$padding:n,children:(0,s.jsxs)(tl,{children:[t.avatar&&(0,s.jsx)(tn,{children:(0,s.jsx)(ey.Avatar,{src:t.avatar})}),(0,s.jsxs)(tr,{children:[t.title&&(0,s.jsx)(ta,{children:t.href?(0,s.jsx)("a",{href:t.href,children:t.title}):t.title}),t.description&&(0,s.jsx)(ti,{children:t.description})]})]})})},ts=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)(te,{$bordered:n,$split:l,$size:r,style:i,$itemLayout:a,className:o,children:t.map((e,t)=>(0,s.jsx)(to,{item:e,split:l,padding:c},String(t)))})};var td=u(190),tc=u(185),tu=u.n(tc);let tp=[{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,{layout:"vertical",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()),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)(e3,{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
781
|
"use strict";
|
|
761
782
|
const window = undefined;
|
|
762
783
|
const document = undefined;
|
|
@@ -766,7 +787,7 @@
|
|
|
766
787
|
const module = undefined;
|
|
767
788
|
const exports = undefined;
|
|
768
789
|
${e.customRender}
|
|
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=
|
|
790
|
+
`)(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=e7(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)(ts,{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=e7(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
791
|
"use strict";
|
|
771
792
|
const window = undefined;
|
|
772
793
|
const document = undefined;
|
|
@@ -776,7 +797,7 @@
|
|
|
776
797
|
const module = undefined;
|
|
777
798
|
const exports = undefined;
|
|
778
799
|
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)(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:{
|
|
800
|
+
`)(...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:{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=e7(t,n.datasource);return(0,d.useEffect)(()=>{if(!o.current)return;let e=td.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
801
|
"use strict";
|
|
781
802
|
const window = undefined;
|
|
782
803
|
const document = undefined;
|
|
@@ -786,10 +807,10 @@
|
|
|
786
807
|
const module = undefined;
|
|
787
808
|
const exports = undefined;
|
|
788
809
|
${e}
|
|
789
|
-
`)(
|
|
810
|
+
`)(td,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
811
|
return {
|
|
791
812
|
xAxis: { type: 'category', data: data.map(i => i.name) },
|
|
792
813
|
yAxis: { type: 'value' },
|
|
793
814
|
series: [{ data: data.map(i => i.value), type: 'line' }]
|
|
794
815
|
}
|
|
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})());
|
|
816
|
+
`}}},{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,{labelCol:{span:24},wrapperCol:{span:24},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,{labelCol:{span:24},wrapperCol:{span:24},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,{labelCol:{span:24},wrapperCol:{span:24},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?tu()(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?tu()(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]?tu()(o[0],e):void 0,a=Array.isArray(o)&&o[1]?tu()(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?tu()(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)(e6,{})})]}),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)(e6,{})})]}),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)(e6,{})})]}),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)(e6,{})})]}),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)(e6,{})})]}),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)(e6,{})})]}),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})());
|