grid-component-editor
Version:
延长loading超时时间;转义伪类中文,防止乱码
2 lines • 275 kB
JavaScript
/*! For license information please see GE.js.LICENSE.txt */
!function(){var e={7302:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.Flex=t.Box=void 0;var a=n(5893),i={primary:16,d2:8,x:"0 16px ",y:"16px 0","x-d2":"0 8px ","y-d2":"8px 0"},l=function(e){return"number"==typeof e?e:"string"==typeof e?i[e]:Array.isArray(e)?e.join("px ")+"px ":void 0};t.Box=function(e){var t=e.className,n=e.padding,i=void 0===n?"d2":n,u=e.style,s=e.border,c=void 0===s||s,f=o(e,["className","padding","style","border"]);return a.jsx("div",r({className:[t,c&&"GE-border"].join(" "),style:Object.assign({padding:l(i)},f.margin&&{margin:l(f.margin)},u)},f,{children:f.children}),void 0)};var u=Object.assign,s={start:"flex-start",end:"flex-end",center:"center"},c="space-between",f="space-around",d="stretch",p=u(s,{"row-wrap":"row wrap","row-nowrap":"row nowrap","column-wrap":"column wrap","column-nowrap":"column nowrap"}),h=u(s,{between:c,around:f,evenly:"space-evenly"}),y=u(s,{stretch:d,between:c,around:f}),g=u(s,{stretch:d,baseline:"baseline"});t.Flex=function(e){var t=e.justify,n=void 0===t?"between":t,i=e.flow,l=void 0===i?"row-nowrap":i,s=e.align,c=e.items,f=o(e,["justify","flow","align","items"]);return f.style=u({display:"flex",flexFlow:p[l],justifyContent:h[n]},f.style,s&&{alignContent:y[s]},c&&{alignItems:g[c]}),a.jsx("div",r({},f,{children:f.children}),void 0)}},2873:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var a=n(5893);t.default=function(e){var t=e.children,n=e.type,i=void 0===n?"primary":n,l=(e.icon,e.size),u=void 0===l?"normal":l,s=e.disabled,c=void 0!==s&&s,f=e.className,d=e.onClick,p=o(e,["children","type","icon","size","disabled","className","onClick"]);return a.jsx("button",r({disabled:c,className:["GE-btn",f,"GE-btn-"+u,"GE-btn-"+i].join(" "),onClick:d},p,{children:t}),void 0)}},5325:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var a=n(5893),i=n(7294);t.default=function(e){var t=e.children,n=void 0===t?"":t,l=e.title,u=void 0===l?"":l,s=e.className,c=void 0===s?"":s,f=e.fold,d=void 0===f||f,p=(o(e,["children","title","className","fold"]),i.useState(d)),h=p[0],y=p[1];return a.jsxs("div",r({className:"GE-collapse-con "+c},{children:[a.jsx("div",r({className:"GE-collapse-title",onClick:function(){return y(!h)}},{children:u}),void 0),a.jsx("div",r({className:["GE-collapse",h?"GE-collapse-fold":""].join(" ")},{children:n}),void 0)]}),void 0)}},3739:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(5893),a=n(7294),i=n(815),l=n(3003),u={fixed:null,info:function(e){return Promise.resolve(this.render(e))},render:function(e,t){var n=this;return this.fixed||(this.fixed=l.useFixed()),new Promise((function(t){n.fixed.render(a.createElement(s,{onClick:function(e){return n.fixed.unmount(),t(e)}},e))}))}};function s(e){var t=e.children,n=e.onClick;return o.jsx("div",r({className:"GE-confirm"},{children:o.jsxs("div",r({className:"GE-confirm-content"},{children:[o.jsx("div",r({className:"GE-confirm-content-msg"},{children:t}),void 0),o.jsxs("div",r({className:"GE-confirm-content-bottom"},{children:[o.jsx(i.Button,r({className:"GE-margin-x",onClick:function(){return n(!0)}},{children:"确定"}),void 0),o.jsx(i.Button,r({onClick:function(){return n(!1)},type:"ghost"},{children:"取消"}),void 0)]}),void 0)]}),void 0)}),void 0)}t.default=u},3361:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var a=arguments[t],i=0,l=a.length;i<l;i++,o++)r[o]=a[i];return r};Object.defineProperty(t,"__esModule",{value:!0});var a=n(5893),i=n(7294),l=n(815),u=n(3003);function s(e){var t=e.open,n=void 0!==t&&t,s=e.id,f=e.anchorEl,d=e.onClose,p=e.position,h=void 0===p?"bottom":p,y=e.className,g=void 0===y?"":y,m=e.values,v=void 0===m?[]:m,b=e.onChange,w=e.children,O=void 0===w?[]:w,S=i.useRef(u.useFixed(s)),_=i.useState(v),x=_[0],k=_[1];return i.useEffect((function(){return k(v)}),[v]),i.useEffect((function(){var e=S.current;n?e.render(a.jsx("div",r({className:"GE-dropd "+g,onClick:d},{children:a.jsxs("div",r({className:"GE-dropd-content scroll GE-dropd-content-"+h,style:c(f.getBoundingClientRect(),h)},{children:[O.map((function(e){return a.jsxs(l.Flex,r({className:"GE-dropd-content-item "+(x.includes(e.key)?"GE-dropd-content-item-act":""),onClick:function(t){return function(e,t){if(e.stopPropagation(),t){var n=x.findIndex((function(e){return e==t})),r=-1==n?o(x,[t]):o(x.slice(0,n),x.slice(n+1,x.length));k(r),b&&b(r)}}(t,e.key)}},{children:[e," ",x.includes(e.key)&&a.jsx(l.Icon,{type:"iconge-right"},void 0)]}),e.key)})),!!O.length||a.jsx("p",r({className:"GE-dropd-nodata"},{children:"无数据"}),void 0)]}),void 0)}),void 0)):e.unmount()}),[n,x]),null}s.Item=function(e){var t=e.children;return a.jsx("div",{children:t},void 0)},t.default=s;var c=function(e,t){var n=e.x,r=e.y,o=e.height;e.width,void 0===t&&(t="bottom");var a="px";switch(t){case"bottom":return{top:r+o+a,left:n+a};case"left":return{top:r+a,right:innerWidth-n+10+a}}}},8548:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(5893),a=n(7294),i=n(815);t.default=function(e){var t=e.label,n=void 0===t?"":t,l=e.value,u=void 0===l?"":l,s=e.type,c=void 0===s?"text":s,f=e.multiple,d=void 0!==f&&f,p=e.options,h=void 0===p?void 0:p,y=e.className,g=void 0===y?"":y,m=e.placeholder,v=void 0===m?"":m,b=e.onChange,w=a.useState(u),O=w[0],S=w[1],_=function(e){b&&b(e)},x=null;switch(c){case"boolean":x=o.jsx(i.Switch,{value:u,style:{marginLeft:30},onChange:_},void 0);break;default:x=o.jsx("input",{type:c,className:"GE-input",onChange:function(e){var t=e.target.value;return S(t)},onBlur:function(e){var t=e.target.value;return _(t)},value:O,placeholder:v},void 0)}return h&&(x=a.createElement(i.Select,{value:O,options:h,onChange:_,multiple:d})),o.jsxs("div",r({className:"GE-field "+g},{children:[o.jsx("label",r({className:"GE-text-title"},{children:n}),void 0),x]}),void 0)}},1984:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var a=n(5893);t.default=function(e){var t=e.type,n=e.size,i=void 0===n?16:n,l=e.IType,u=void 0===l?"font":l,s=e.onClick,c=o(e,["type","size","IType","onClick"]);return"font"==u?a.jsx("i",r({className:"iconfont "+t,style:{fontSize:i},onClick:s},c),void 0):a.jsx("svg",r({className:"icon","aria-hidden":"true",onClick:s},c,{style:{height:i,width:i}},{children:a.jsx("use",{xlinkHref:"#"+t},void 0)}),void 0)}},815:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Transition=t.Confirm=t.Switch=t.Box=t.Flex=t.Message=t.Select=t.Collapse=t.Tooltip=t.Dropdown=t.Tab=t.Field=t.Button=t.Icon=void 0;var o=r(n(7782));t.Tab=o.default;var a=n(7302);Object.defineProperty(t,"Flex",{enumerable:!0,get:function(){return a.Flex}}),Object.defineProperty(t,"Box",{enumerable:!0,get:function(){return a.Box}});var i=r(n(2873));t.Button=i.default;var l=n(1984);Object.defineProperty(t,"Icon",{enumerable:!0,get:function(){return r(l).default}});var u=r(n(8548));t.Field=u.default;var s=r(n(5921));t.Select=s.default;var c=r(n(8050));t.Switch=c.default;var f=r(n(3361));t.Dropdown=f.default;var d=r(n(9533));t.Tooltip=d.default;var p=r(n(5325));t.Collapse=p.default;var h=r(n(4496));t.Message=h.default;var y=r(n(3739));t.Confirm=y.default;var g=r(n(7243));t.Transition=g.default},4496:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(5893),a=n(7294),i=n(3003),l=n(815),u=1,s={fixed:null,defaultDur:5e3,info:function(e,t){void 0===t&&(t=this.defaultDur),this.render(e,{duration:t})},error:function(e,t){void 0===t&&(t=this.defaultDur),this.render(e,{duration:t})},warning:function(e,t){void 0===t&&(t=this.defaultDur),this.render(e,{duration:t})},render:function(e,t){var n=this,r=t.duration;t.type,this.fixed||(this.fixed=i.useFixed()),u&&(clearTimeout(u),u=setTimeout((function(){n.fixed.unmount()}),r)),this.fixed.render(a.createElement(c,{unmount:function(){return n.fixed.unmount(),clearTimeout(u)},children:e},e))}};function c(e){var t=e.children,n=e.unmount;return o.jsxs("div",r({className:"GE-msg "},{children:[o.jsx("span",r({className:"msg"},{children:t}),void 0)," ",o.jsx(l.Icon,{type:"iconge-false",onClick:n},void 0)]}),void 0)}t.default=s},5905:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var a=arguments[t],i=0,l=a.length;i<l;i++,o++)r[o]=a[i];return r};Object.defineProperty(t,"__esModule",{value:!0});var a=n(5893),i=n(7294),l=n(815);t.default=function(e){var t=e.onOrder,n=e.className,u=void 0===n?"":n,s=e.order,c=void 0===s||s,f=e.list,d=void 0===f?[]:f,p=i.useState([]),h=p[0],y=p[1];return i.useLayoutEffect((function(){y(d)}),[d]),a.jsx("div",r({className:"GE-order"+u,onKeyUp:function(e){if(c){var n=e.target.dataset.georderIndex,r=e.keyCode%49;if(!(!n||r+1>h.length||r>8)){var a=h[r];h[r]=h[n],h[n]=a,y(o(h)),t&&t(h)}}}},{children:h.map((function(e,t){return a.jsx(l.Transition,{children:a.jsxs(l.Button,r({type:"ghost",className:"GE-order-active",size:"small","data-georder-index":t},{children:[e," ",c&&"-"+(t+1)]}),void 0)},e)}))}),void 0)}},5921:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},a=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var a=arguments[t],i=0,l=a.length;i<l;i++,o++)r[o]=a[i];return r};Object.defineProperty(t,"__esModule",{value:!0});var i=n(5893),l=n(7294),u=function(e,t){return t.replace(e,"<b class='primary-color'>"+e+"</b>")},s="";t.default=function(e){var t=e.value,n=void 0===t?"":t,c=e.options,f=void 0===c?[]:c,d=e.className,p=void 0===d?"":d,h=(e.placeholder,e.onChange),y=o(e,["value","options","className","placeholder","onChange"]),g=l.useState((function(){return Array.isArray(n)?n:""===n?[]:[n]})),m=g[0],v=g[1],b=l.useRef(null);return i.jsxs("div",r({className:"GE-select "+p,style:y.style},{children:[i.jsx("input",{className:"GE-input GE-select-input ",ref:b,onInput:function(e){if(""!==(s=e.target.value)){var t=[],n=[];f.forEach((function(e,n){return e.label.includes(s)&&t.push(n)}));var r=t.length;t.forEach((function(e,t){return n.push(e<r&&e===t?-1:t)})),n.forEach((function(e){if(-1!=e){var n=f[e];f[e]=f[t[e]],f[t[e]]=n}}))}v(a(m))},value:f.filter((function(e){return m.includes(e.value)})).map((function(e){return e.label})).join(",")},void 0),i.jsx("span",{className:"GE-select-icon "},void 0),i.jsx("div",r({className:"GE-select-con scroll"},{children:f.map((function(e){var t=e.value,n=e.label;return i.jsx("div",{className:"GE-select-option "+(m.includes(t)?"GE-select-active":""),onMouseDown:function(e){return function(e,t,n){if(y.multiple)e.preventDefault(),m.includes(n)?m.splice(m.findIndex((function(e){return e===n})),1):m.push(n),v(a(m)),h&&h(m);else{if(m.includes(n))return;v([n]),h&&h(n)}}(e,0,t)},dangerouslySetInnerHTML:{__html:u(s,n)}},n)}))}),void 0)]}),void 0)}},8050:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var a=n(5893),i=n(7294);t.default=function(e){e.type,e.className;var t=e.value,n=e.onChange,l=o(e,["type","className","value","onChange"]),u=i.useState(t),s=u[0],c=u[1];return a.jsx("label",r({className:["GE-switch",s&&"GE-switch-on"].join(" "),onClick:function(){return n&&n(!s),c(!s)}},l),void 0)}},7782:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(5893),a=n(7294);t.default=function(e){var t=e.currentKey,n=e.options,i=void 0===n?[]:n,l=e.className,u=void 0===l?"":l,s=e.children,c=void 0===s?[]:s,f=a.useState(t),d=f[0],p=f[1];return o.jsxs("div",r({className:"GE-tab "+u},{children:[o.jsx("div",r({className:"GE-tab-head",onClickCapture:function(e){var t=e.target.dataset.tabkey;return t&&p(t)}},{children:i.map((function(e){return o.jsx("div",r({className:"GE-tab-item "+(e.key==d?"GE-tab-item-active":""),"data-tabkey":e.key},{children:e.label}),e.key)}))}),void 0),c.map((function(e){return o.jsx("div",r({style:{display:d==e.key?"block":"none"}},{children:e}),e.key)}))]}),void 0)}},9533:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var a=n(5893),i=n(7294);t.default=function(e){var t=e.position,n=void 0===t?"left":t,l=e.offset,u=void 0===l?10:l,s=o(e,["position","offset"]),c=i.useRef();return a.jsxs(a.Fragment,{children:[a.jsx("div",r({onMouseOver:function(e){Object.assign(c.current.style,function(e,t,n){var r=t.x,o=t.y,a=t.height,i=t.width,l="px",u="translateY(-50%)";switch(e){case"right":return{top:o+a/2+l,left:i+r+n+l,transform:u};case"bottom":return{top:o+a+n+l,left:i/2+r+l,transform:u="translateX(-50%)"};case"left":return{top:o+a/2+l,right:window.innerWidth-r+n+l,transform:u}}}(n,e.currentTarget.getBoundingClientRect(),u))},className:"GE-tooltip"},{children:s.children}),void 0),a.jsx("div",r({ref:c,className:"GE-tooltip-con"},{children:s.des}),void 0)]},void 0)}},7243:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var a=n(5893);t.default=function(e){var t=e.type,n=void 0===t?"fade":t,i=o(e,["type"]);return a.jsx("span",r({className:i.className||" GE-transi-"+n},i,{children:i.children}),void 0)}},4894:function(e,t){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.GridConfigurableProps=t.MeasureOptions=t.Measure=t.createConfigurableDict=t.StatusProps=t.DOMCaptureOperate=t.ModeStatus=t.FoldedRightBoxWidth=t.RightBoxWidth=t.FoldedLeftBoxWidth=t.LeftBoxWidth=void 0,t.LeftBoxWidth=100,t.FoldedLeftBoxWidth=60,t.RightBoxWidth=220,t.FoldedRightBoxWidth=60,t.ModeStatus={DISPLAY:"display",EDIT:"edit"},t.DOMCaptureOperate={DELETE:"GE-delete",FOCUS:"GE-focus",PREVIEW:"GE-preview",RECALL:"GE-recall",RESET:"GE-reset",CANCEL_PREVIEW:"GE-cancel-preview",GLOBAL_SETTING:"GE-setting",SAVE:"GE-save"},t.StatusProps=function(e){return{cols:{lg:24,md:24,sm:12,xs:4,xxs:2},style:{minHeight:300},droppingItem:{i:"t",w:4,h:2},draggableCancel:"GE-cancel-drag",compactType:null,isDraggable:e,isResizable:e,isDroppable:e,preventCollision:!0}},t.createConfigurableDict=function(e,t,n){return{label:e,value:t,placeholder:n}},t.Measure={sum:"汇总",count:"数量",avg:"平均",max:"最大值",min:"最小值"},t.MeasureOptions=Object.entries(t.Measure).map((function(e){var n=e[0],r=e[1];return t.createConfigurableDict(r,n)})),t.GridConfigurableProps={configurableProps:{margin:t.createConfigurableDict("组件间隔","10,10"),rowHeight:n({type:"number"},t.createConfigurableDict("单位高","20")),theme:n(n({},t.createConfigurableDict("主题","dark")),{options:[{label:"深色",value:"dark"},{label:"浅色",value:"light"}]})}}},902:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__assign||function(){return(a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function l(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}u((r=r.apply(e,t||[])).next())}))},l=this&&this.__generator||function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(5893),c=n(7294),f=u(n(5234)),d=n(3003),p=u(n(5587)),h=u(n(708)),y=n(2639),g=n(815),m=n(8103),v=n(4894),b=n(9684),w=function(e){function t(t){var n=e.call(this,t)||this;return n.nameRef=c.createRef(),n.isEditing=n.props.mode===v.ModeStatus.EDIT,n._onOperate=function(e){return i(n,void 0,void 0,(function(){var t,n,r;return l(this,(function(o){switch(o.label){case 0:if(t=e.target.dataset,n=t.index,!(r=t.operate))return[2];if("click"!==e.type)return[3,11];switch(r){case v.DOMCaptureOperate.DELETE:return[3,1];case v.DOMCaptureOperate.PREVIEW:return[3,3];case v.DOMCaptureOperate.CANCEL_PREVIEW:return[3,4];case v.DOMCaptureOperate.GLOBAL_SETTING:return[3,5];case v.DOMCaptureOperate.SAVE:return[3,6];case v.DOMCaptureOperate.RECALL:return[3,7];case v.DOMCaptureOperate.RESET:return[3,8]}return[3,10];case 1:return[4,g.Confirm.info("确定要删除当前组件?")];case 2:return o.sent()&&this.dispatch(m.ReducerKey.DELETE_COMPONENT,n),[2];case 3:return b._assign(this.gridProps,{isDraggable:!1,isResizable:!1}),this.setState({preview:!0}),[2];case 4:return b._assign(this.gridProps,{isDraggable:!0,isResizable:!0}),this.setState({preview:!1}),[2];case 5:return this.dispatch(m.ReducerKey.CUR_FOCUS_INDEX,""),[2];case 6:return this._onSave(),[2];case 7:return this.dispatch(m.ReducerKey.RECALL,""),[2];case 8:return[4,g.Confirm.info("确定要清空所有组件?")];case 9:return o.sent()&&this.dispatch(m.ReducerKey.RESET,""),[2];case 10:return[2];case 11:return r==v.DOMCaptureOperate.FOCUS&&this.dispatch(m.ReducerKey.CUR_FOCUS_INDEX,n),[2]}}))}))},n.editorInit(),n}return o(t,e),t.prototype.editorInit=function(){var e=this;b._ctrlPlus({s:function(){return e._onSave()},z:function(){return e.dispatch(m.ReducerKey.RECALL,"")}});var t=this;b._assign(this.gridProps,v.StatusProps(this.isEditing),this.isEditing&&{onResizeStop:function(e,n,r){var o=r.h,a=r.w,i=r.i;return t.dispatch(m.ReducerKey.U_COM,{h:o,w:a,i:i})},onDragStop:function(t,n,r){var o=r.x,a=r.y,i=r.i;return b._assign(e.state.components[i],{x:o,y:a})},onDrop:function(e,n,r){var o,a=n.h,i=n.w,l=n.x,u=n.y,s=r.dataTransfer,c=JSON.parse(s.getData("text/json")),f=c.name,d=c.type,p=c.i,h=void 0===p?b._createIndex():p;t.dispatch(m.ReducerKey.COMPONENT,((o={})[h]=b._assign({h:a,w:i,x:l,y:u,i:h,name:f,type:d},t.createComConfig(f,d)),o))}})},t.prototype._onSave=function(){var e=this.state,t=e.components,n=e.globalConfig;this.requestFunc("save",{mode:this.props.mode,name:this.nameRef.current.innerText,components:b._clearCache(t),globalConfig:n})},t.prototype.createContextObj=function(){var e=this.state,t=e.components,n=e.globalConfig,r=e.curFocusIndex;return{components:t,globalConfig:n,curFocusCom:t[r],curFocusIndex:r,requestFunc:this.requestFunc,dispatch:this.dispatch}},t.prototype.createComConfig=function(e,t){var n={props:a(a({},m.InjectToProps[t]),this.RegisterCom[e].props),query:{dimensions:[],measure:[],aggregator:{},format:"list",queryType:t,modelId:void 0,filterField:"",limit:1e3}};return"control"===t&&b._assign(n,{eventProps:this.RegisterCom[e].eventProps}),n},t.prototype.render=function(){var e=this.state,t=e.preview,n=e.curFocusIndex,r=e.snapshotIndex;return b._assign(this.gridProps,this.state.globalConfig),s.jsx("div",a({className:"GE",id:"GE"},{children:this.isEditing?s.jsx(y.GridProvider,a({value:this.createContextObj()},{children:s.jsxs("div",a({className:d.useClass({"GE-preview":t,height100:!0}),onClick:this._onOperate,onDoubleClick:this._onOperate},{children:[s.jsxs(g.Flex,a({className:"GE_top"},{children:[s.jsx("b",{className:"GE-text-title GE-input",tabIndex:0,contentEditable:!0,ref:this.nameRef,dangerouslySetInnerHTML:{__html:this.props.title||"标题"}},void 0),s.jsx(g.Flex,a({items:"center"},{children:[["撤销(ctrl+z)",d.useClass({recall:!0,"GE-disabled":!r}),v.DOMCaptureOperate.RECALL],["重做","reset",v.DOMCaptureOperate.RESET],["预览","preview",v.DOMCaptureOperate.PREVIEW],["保存(ctrl+s)","save",v.DOMCaptureOperate.SAVE],["全局设置",d.useClass({setting:!0,"primary-color":!n}),v.DOMCaptureOperate.GLOBAL_SETTING]].map((function(e){return s.jsx(g.Tooltip,a({position:"bottom",des:e[0]},{children:s.jsx(g.Box,a({padding:"d2",border:!1},{children:s.jsx(g.Icon,{type:"primary-color iconge-"+e[1],size:20,"data-operate":e[2]},void 0)}),void 0)}),e[1])}))}),void 0)]}),void 0),s.jsxs(g.Flex,a({className:"GE_content"},{children:[s.jsx(h.default,{registerCom:this.RegisterCom},0),s.jsxs("div",a({className:"GE_editing_container scroll"},{children:[s.jsx(g.Icon,{type:"iconge-false GE-cancel-preview","data-operate":v.DOMCaptureOperate.CANCEL_PREVIEW},void 0),this.CreateGrid()]}),void 0),s.jsx(p.default,{registerComponents:this.RegisterCom},void 0)]}),void 0)]}),void 0)}),void 0):this.CreateGrid()}),void 0)},t}(f.default);t.default=w},3003:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useClass=t.useFixed=void 0;var o=n(8690);Object.defineProperty(t,"useFixed",{enumerable:!0,get:function(){return r(o).default}});var a=n(5472);Object.defineProperty(t,"useClass",{enumerable:!0,get:function(){return r(a).default}})},5472:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return Object.keys(e).filter((function(t){return e[t]})).join(" ")}},8690:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3935);t.default=function(e){void 0===e&&(e="GE-fixed-root");var t={divEl:null,render:function(e){r.render(e,this.divEl)},unmount:function(){r.unmountComponentAtNode(this.divEl)}};return t.divEl=document.getElementById(e),t.divEl||(document.body.appendChild(t.divEl=document.createElement("div")),t.divEl.id=e),t}},680:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getCSSVar=t.Parser=void 0;var o=r(n(902)),a=n(5234);Object.defineProperty(t,"Parser",{enumerable:!0,get:function(){return r(a).default}});var i=n(9684);Object.defineProperty(t,"getCSSVar",{enumerable:!0,get:function(){return i.getCSSVar}}),t.default=o.default},708:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(5893),a=n(7294),i=n(815),l=n(9684),u=n(4894),s=n(8103),c=n(9684),f=l._getStorage(s.StorageKey.recent)||[],d=null,p=0;function h(e){var t=e.category,n=e.com;return o.jsxs(a.Fragment,{children:[o.jsx("div",r({className:"GE-left-category"},{children:t}),void 0),o.jsx("div",r({className:"GE-icons-con"},{children:c._entries(n).map((function(e,t){var n=e[0],a=e[1],l=a.label,u=a.icon,s=a.type;return o.jsx(i.Tooltip,r({position:"right",des:l},{children:o.jsx("span",r({className:"droppable-element "},y({name:n,type:s}),{children:o.jsx(i.Icon,{type:u,size:28,IType:"svg"},void 0)}),void 0)}),t+"")}))}),void 0)]},void 0)}t.default=function(e){var t=e.registerCom,n=a.useState(!1),l=n[0],s=n[1],y=a.useState(p),g=(y[0],y[1]),m={},v={};return d=g,f.length&&(v["最近"]={},new Set(f).forEach((function(e){v["最近"][e]=t[e]}))),o.jsxs("div",r({className:"GE-padding scroll GE-left",style:{width:l?u.FoldedLeftBoxWidth:u.LeftBoxWidth}},{children:[o.jsxs("div",r({className:"GE-left-top"},{children:[o.jsx("span",r({className:"GE-text-title"},{children:"组件"}),void 0),o.jsx(i.Icon,{type:"iconge-to-"+(l?"left":"right"),onClick:function(){return s(!l)}},void 0)]}),void 0),c._entries(v).map((function(e){var t=e[0],n=e[1];return o.jsx(h,{category:t,com:n},t)})),a.useMemo((function(){return c._entries(t).map((function(e){var t=e[0],n=e[1];m[n.category]||(m[n.category]={}),m[n.category][t]=n})),c._entries(m).map((function(e){var t=e[0],n=e[1];return o.jsx(h,{category:t,com:n},t)}))}),[])]}),void 0)};var y=function(e){var t=e.name,n=e.type;return{draggable:!0,unselectable:"on",onDragStart:function(e){!function(e,t){e.dataTransfer.setData("text/json",JSON.stringify(t)),4==f.length&&f.pop(),f.unshift(t.name),l._setStorage(s.StorageKey.recent,f),d(++p)}(e,{name:t,type:n})}}}},5234:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__assign||function(){return(a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return l(t,e),t},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function l(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}u((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},f=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var a=arguments[t],i=0,l=a.length;i<l;i++,o++)r[o]=a[i];return r},d=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var p=n(5893),h=u(n(7294)),y=n(9968),g=n(3003),m=n(2639),v=d(n(1984)),b=n(8103),w=n(4894),O=n(9684),S=y.WidthProvider(y.Responsive),_=function(e){function t(t){var n=e.call(this,t)||this;return n.RegisterCom={},n.requestFunc=n.props.onRequest,n.closureDispatch=function(e,t){return function(t){return n.dispatch(b.ReducerKey.FETCH_DATAS,{i:e,filter:t})}},n.gridProps=O._assign({},w.StatusProps(!1),n.props.globalConfig),n.state={curFocusIndex:"",preview:!1,snapshotIndex:0,components:t.components,globalConfig:t.globalConfig},n.init(n.state,t),n}return o(t,e),t.prototype.init=function(e,t){O._assign(this.RegisterCom,t.config.registerComponents),O._notifyIn(e.globalConfig,"theme",(function(e){return t.onTheme(e),O._assign(document.body.dataset,{theme:e}),e})),this.dispatch=this.dispatch.bind(this)},t.prototype.componentDidMount=function(){var e=this,t={},n={};for(var r in O._entries(this.state.components).forEach((function(r){var o=r[0],a=r[1],i=a.type,l=a.query;"display"===i?t[o]=l:(O._assign(n,l),e.dispatch(b.ReducerKey.FETCH_DATA,{i:o,query:l}),e.dispatch(b.ReducerKey.FETCH_DATAS,{i:o}))})),t)r in n||this.midDispatch(r,t[r])},t.prototype.midDispatch=function(e,t){var n;return s(this,void 0,void 0,(function(){var r,o,a;return c(this,(function(i){switch(i.label){case 0:return t.modelId||(null===(n=t.filter)||void 0===n?void 0:n.modelId)?(this.dispatch(b.ReducerKey.U_COM_PROP,{i:e,props:{gloading:!0}}),r="control"==t.queryType?["option",(a={},a[t.modelId]=t.filterField,a),""]:["engine",O._formatQuery(t),t.endpoint],[4,this.requestFunc(r[0],r[1],r[2])]):[2];case 1:return o=i.sent(),this.dispatch(b.ReducerKey.U_COM_PROP,{i:e,props:{gdata:o,gloading:!1}}),[2]}}))}))},t.prototype.dispatch=function(e,t){return s(this,void 0,void 0,(function(){var n,r,o,a,i;return c(this,(function(l){switch(e){case b.ReducerKey.FETCH_DATA:return this.midDispatch(t.i,t.query),[2];case b.ReducerKey.FETCH_DATAS:for(i in n=this.state.components,r=n[t.i],o=r.query,r.props,a=t.filter,o)i in n&&this.midDispatch(i,O._assign(n[i].query,{filter:a}));return[2];default:this.setState(m.reducer(this.state,{type:e,payload:t}))}return[2]}))}))},t.prototype.preventDrag=function(e,t){!1===t&&e.stopPropagation()},t.prototype.CreateGrid=function(){var e=this,t=this.state,n=t.components,r=t.curFocusIndex;return p.jsx(S,a({},this.gridProps,{children:O._entries(n).map((function(t){var n=t[0],o=t[1],i="",l=p.jsxs("span",{children:["组件",o.name,"未注册,无法解析"]},void 0);return o.name in e.RegisterCom&&(i=w.DOMCaptureOperate.FOCUS,l=e.CreateComponent({component:o})),p.jsxs("div",a({className:g.useClass({GE_com:!0,"GE-loading":o.props.gloading,GE_com_focus:r==n}),"data-index":n,"data-grid":o,"data-operate":i,onMouseDownCapture:function(t){return e.preventDrag(t,o.isDraggable)}},{children:[e.gridProps.isDroppable&&p.jsx(v.default,{type:"iconge-false","data-operate":w.DOMCaptureOperate.DELETE,"data-index":o.i},void 0),l]}),n)}))}),void 0)},t.prototype.CreateComponent=function(e){var t=this,n=e.component,r=n.props,o=n.eventProps,i=n.name,l=n.i,u=n.query,s={},c=this.RegisterCom[i],d=c.props,y=c.el;if(o)for(var g=function(e){s[e]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return d[e].apply(d,f([t.closureDispatch(l,u.filterField)],n))}},m=0,v=o;m<v.length;m++)g(v[m]);return p.jsx(x,a({count:r[b.CountKey]},{children:h.createElement(y,a(a({},r),s))}),void 0)},t.prototype.render=function(){return p.jsx("div",a({className:"GE",id:"GE"},{children:this.CreateGrid()}),void 0)},t}(h.default.Component);function x(e){var t=e.count,n=e.children;return h.useMemo((function(){return n}),[t])}t.default=_},7209:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(5893),a=n(7294),i=n(2639),l=n(4894),u=n(4684),s=n(9684),c=l.RightBoxWidth/24;t.default=function(){var e=a.useContext(i.GridContext),t=e.components,n=e.curFocusCom,f=n.query,d=n.x,p=n.y,h=n.h,y=n.w,g=a.useRef(null),m=a.useState(0),v=m[0],b=m[1];return a.useEffect((function(){var e=g.current,n=e.getContext("2d"),r=[],o=0;s._entries(t).forEach((function(e){var t=e[0],n=e[1],a=n.x,i=n.y,u=n.h,s=n.w;"display"==n.type&&r.push({x:a*c,y:10*i,w:s*l.RightBoxWidth/24,h:10*u,i:t}),i+u>o&&(o=i+u)})),n.clearRect(0,0,l.RightBoxWidth,e.height=10*o+20),n.fillStyle=u.bgColor.active,n.fillRect(0,0,l.RightBoxWidth,e.height),n.fillStyle=u.color.primary,n.fillRect(d*c+3,10*p+3,y*l.RightBoxWidth/24-3,10*h-3);var a=function(e){var t=e.x,r=e.y,o=e.w,a=e.h,i=e.i;n.strokeStyle=u.color[i in f?"primary":"textBlur"],n.strokeRect(t+3,r+3,o-3,a-3)},i=window.requestAnimationFrame(a),m=function(t){for(var n=t.clientX,o=t.clientY,a=e.getBoundingClientRect(),i=a.x,l=a.y,u=0,s=r;u<s.length;u++){var c=s[u],d=c.x,p=c.y,h=c.w,y=c.h,g=c.i;if(n>d+i&&n<d+i+h&&o>p+l&&o<p+l+y){g in f?delete f[g]:f[g]=g,b(++v);break}}};return e.addEventListener("click",m,!1),r.forEach(a),function(){e.removeEventListener("click",m,!1),window.cancelAnimationFrame(i)}}),[v]),o.jsxs(o.Fragment,{children:[o.jsx("p",r({className:"GE-text-title"},{children:"关联组件 "}),void 0),o.jsx("canvas",{ref:g,width:l.RightBoxWidth},void 0)]},void 0)}},4989:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function l(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var l=n(5893),u=n(7294),s=n(2639),c=n(815),f=i(n(5905)),d=n(4894),p=n(8103),h=n(9684),y={},g={first:[],third:{},last:[]},m=function(e){var t={},n={};return e.dimensions.map((function(e){var n=e.fieldName,r=e.fieldType;return t[n]=r})),e.measure.map((function(e){var t=e.fieldName,r=e.fieldType;return n[t]=r})),{third:t,last:n}},v={minHeight:40};t.default=function(){var e=this,t=u.useContext(s.GridContext),n=t.dispatch,i=t.requestFunc,b=t.curFocusIndex,w=t.curFocusCom,O=w.type,S=w.props,_=w.query,x=u.useState(0),k=x[0],E=x[1],P=u.useState({dimension:null,measure:null}),C=P[0],j=P[1],D=function(e,t,n){var r,o;switch(t){case"dataSource":y=g.first.find((function(t){return t.id==+e})),h._assign(_,{modelId:y.id,measure:[],dimensions:[],filterField:"",endpoint:y.endpoint}),h._assign(g,m(y)),E(++k);break;case"aggregator":h._assign(_.aggregator,((r={})[n]=e,r));break;case"deleteMea":_.measure.splice(_.measure.findIndex((function(t){return t[0]==e})),1),delete _.aggregator[e],E(++k);break;case"filter":S.filter={},h._assign(S.filter,((o={})[_.filterField=e]="",o));break;case"limit":_.limit=+e}},R=function(e,t){var n=[],r="dimensions"==t?T:z;e.forEach((function(e){n.push([e,r[e]]),"measure"==t&&(_.aggregator[e]="sum")})),_[t]=n,E(++k)},N=g.first,T=g.third,z=g.last,M=_.modelId,L=void 0===M?"":M,I=_.dimensions,F=_.measure,A=_.limit,H=_.aggregator,W=_.filterField;return u.useEffect((function(){o(e,void 0,void 0,(function(){var e,t;return a(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,i("dataSource",undefined)];case 1:return e=n.sent().data,(t=void 0===e?[]:e).forEach((function(e){e.label=e.model_name,e.value=e.id})),h._assign(g,{first:t}),_.modelId&&h._assign(g,m(y=g.first.find((function(e){return e.id==+_.modelId})))),E(++k),[3,3];case 2:return n.sent(),[3,3];case 3:return[2]}}))}))}),[]),L||(T=z=[]),l.jsxs("div",r({className:N.length?"":"GE-loading"},{children:[l.jsx(c.Field,{options:N,label:"数据模型",value:L,onChange:function(e){return D(e,"dataSource")}},void 0),"display"==O?l.jsxs(u.Fragment,{children:[l.jsxs(c.Box,r({className:"relative",style:v},{children:[l.jsx("div",r({className:"GE-dimensions-label",style:{top:I.length?0:"50%"},onClick:function(e){return j(r(r({},C),{dimension:e.currentTarget}))}},{children:"维度"}),void 0),l.jsx(f.default,{list:I.map((function(e){return e[0]})),onOrder:function(e){return R(e,"dimensions")}},void 0),l.jsx(c.Dropdown,r({position:"left",open:!!C.dimension,anchorEl:C.dimension,id:"dimensions-drop",values:I.map((function(e){return e[0]})),onChange:function(e){return R(e,"dimensions")},onClose:function(){return j(r(r({},C),{dimension:null}))}},{children:Object.keys(T).map((function(e){return l.jsx(c.Dropdown.Item,{children:e},e)}))}),void 0)]}),void 0),l.jsxs(c.Box,r({className:"relative",margin:"y",style:v},{children:[l.jsx("div",r({className:"GE-dimensions-label",style:{top:F.length?0:"50%"},onClick:function(e){return j(r(r({},C),{measure:e.currentTarget}))}},{children:"度量"}),void 0),F.map((function(e){var t=e[0];return l.jsxs(c.Flex,r({items:"center",justify:"around"},{children:[l.jsxs(c.Box,r({className:"GE-measure-title",padding:[5,8]},{children:[t,l.jsx(c.Icon,{type:"iconge-del",onClick:function(){return D(t,"deleteMea")}},void 0)]}),void 0),l.jsx("b",r({className:"GE-measure-aggre"},{children:"·"}),void 0),l.jsx(c.Select,{className:"GE-measure-aggre",style:{width:"40%"},options:d.MeasureOptions,value:H[t],onChange:function(e){return D(e,"aggregator",t)}},void 0)]}),t)})),l.jsx(c.Dropdown,r({position:"left",open:!!C.measure,id:"measure-drop",anchorEl:C.measure,values:F.map((function(e){return e[0]})),onChange:function(e){return R(e,"measure")},onClose:function(){return j(r(r({},C),{measure:null}))}},{children:Object.keys(z).map((function(e){return l.jsx(c.Dropdown.Item,{children:e},e)}))}),void 0)]}),void 0),l.jsx(c.Field,{label:"单次数据量",type:"number",value:A,onChange:function(e){return D(e,"limit")}},void 0)]},b):l.jsx(c.Field,{label:"关联过滤字段",options:Object.keys(r(r({},T),z)).map((function(e){return{label:e,value:e}})),multiple:!0,value:W,onChange:function(e){return D(e,"filter")}},void 0),l.jsx(c.Button,r({onClick:function(){return n(p.ReducerKey.FETCH_DATA,{i:b,query:_})},type:"ghost",style:{width:"100%"}},{children:"更新"}),void 0)]}),void 0)}},6015:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(5893),a=n(7294),i=n(2639),l=r(n(7209)),u=r(n(4989));t.default=function(){var e=a.useContext(i.GridContext).curFocusCom,t=e.type,n=e.i;return o.jsxs(a.Fragment,{children:["control"==t&&o.jsxs(o.Fragment,{children:[" ",o.jsx(l.default,{},void 0)," ",o.jsx("br",{},void 0)]},void 0),o.jsx(u.default,{},void 0)]},n)}},5587:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(5893),i=n(7294),l=o(n(6015)),u=n(2639),s=n(4684),c=n(815),f=n(8103),d=n(4894),p={"基础":"1","数据":"2","高级":"3"};t.default=function(e){var t=e.registerComponents,n=i.useContext(u.GridContext),o=n.dispatch,h=n.globalConfig,y=n.curFocusCom,g=n.curFocusIndex,m=i.useState(!1),v=m[0],b=(m[1],{}),w=[],O=[],S="全局",_=d.GridConfigurableProps.configurableProps;if(g){var x=y.name;console.log(y),b=y.props,f._countIncrement(y),_=t[x].configurableProps,S=t[x].label,w=a.jsxs(c.Tab,r({options:Object.entries(p).map((function(e){return{label:e[0],key:e[1]}})),currentKey:"1"},{children:[a.jsxs("div",{children:[" ",O]},"1"),a.jsx(l.default,{},"2"),a.jsx("div",{children:"暂无内容"},"3")]}),void 0)}else b=h,w=O;for(var k=function(e){e in b&&(_[e].value=b[e],O.push(a.jsx(c.Field,r({},_[e],{onChange:function(t){return function(e,t){var n;b[e]=function(e){if(e.includes&&e.includes(",")){var t=e.split(",");return[+t[0],+t[1]]}return"boolean"==typeof e||isNaN(+e)?e:+e}(t),o(f.ReducerKey.FULL_UPDATE,((n={})[e]=t,n))}(e,t)}}),e+g)))},E=0,P=Object.keys(_);E<P.length;E++)k(P[E]);return a.jsxs("div",r({className:"GE-padding scroll GE_right",style:{width:v?d.FoldedRightBoxWidth:d.RightBoxWidth+2*parseInt(s.primaryMargin)}},{children:[a.jsx(c.Flex,r({className:"GE-text-title"},{children:a.jsxs("span",{children:["属性-",a.jsx("span",r({style:{fontSize:10}},{children:S}),void 0)]},void 0)}),void 0),w]}),void 0)}},2639:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.reducer=t.GridProvider=t.GridContext=void 0;var o=n(9684),a=n(7294),i=n(8103);t.GridContext=a.createContext({curFocusIndex:"",curFocusCom:{},components:{},globalConfig:{},dispatch:function(e,t){},requestFunc:function(e,t){}}),t.GridProvider=t.GridContext.Provider;var l=[],u=function(e){l.push(JSON.parse(JSON.stringify(e.components))),e.snapshotIndex++};t.reducer=function(e,t){var n=t.type,a=t.payload;switch(n){case i.ReducerKey.INIT:return r(r({},e),a);case i.ReducerKey.COMPONENT:return u(e),o._assign(e.components,a),r({},e);case i.ReducerKey.U_COM:var s=e.components[a.i];return i._countIncrement(s),o._assign(s,a),r({},e);case i.ReducerKey.U_COM_PROP:return s=e.components[a.i],i._countIncrement(s),o._assign(s.props,a.props),r({},e);case i.ReducerKey.DELETE_COMPONENT:u(e);var c=e.components,f=e.curFocusIndex;return delete c[a],f==a&&(e.curFocusIndex=""),r({},e);case i.ReducerKey.CUR_FOCUS_INDEX:if(e.curFocusIndex==a)return;return r(r({},e),{curFocusIndex:a});case i.ReducerKey.RECALL:return o._assign(e,e.snapshotIndex&&{components:l.pop(),snapshotIndex:--e.snapshotIndex});case i.ReducerKey.RESET:return u(e),r(r({},e),{components:[],curFocusIndex:""});default:return e}}},4684:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bgColor=t.color=t.primaryMargin=void 0,t.primaryMargin="16px",t.color={primary:" #5b8ff9",textBlur:" #999",textTitle:" #333"},t.bgColor={primary:"#fff",active:"rgb(91 143 249 / 15%)"}},8103:function(e,t){"use strict";var n,r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,argum