@nocobase/plugin-data-visualization 2.1.0-beta.36 → 2.1.0-beta.38

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.
Files changed (41) hide show
  1. package/dist/client/{680.55c8681f2ccb5c51.js → 680.c3725300a5f4414b.js} +1 -1
  2. package/dist/client/index.js +1 -1
  3. package/dist/client-v2/468.95cb9025bce70a9c.js +10 -0
  4. package/dist/client-v2/568.5b6cd8eb09c264ba.js +10 -0
  5. package/dist/client-v2/chart/configs.d.ts +2 -2
  6. package/dist/client-v2/chart/types.d.ts +3 -4
  7. package/dist/client-v2/flow/models/Chart.d.ts +1 -0
  8. package/dist/client-v2/flow/models/ChartBlockModel.d.ts +1 -0
  9. package/dist/client-v2/flow/models/ECharts.d.ts +2 -0
  10. package/dist/client-v2/flow/models/EventsEditor.d.ts +5 -2
  11. package/dist/client-v2/flow/models/QueryBuilder.d.ts +17 -1
  12. package/dist/client-v2/flow/models/SQLEditor.d.ts +6 -1
  13. package/dist/client-v2/flow/models/config-store.d.ts +6 -2
  14. package/dist/client-v2/flow/utils.d.ts +1 -1
  15. package/dist/client-v2/index.js +1 -1
  16. package/dist/client-v2/locale.d.ts +1 -0
  17. package/dist/externalVersion.js +13 -14
  18. package/dist/node_modules/koa-compose/package.json +1 -1
  19. package/package.json +2 -2
  20. package/dist/client/flow/components/CodeEditor.d.ts +0 -22
  21. package/dist/client/flow/components/DaraButton.d.ts +0 -14
  22. package/dist/client/flow/models/Chart.d.ts +0 -17
  23. package/dist/client/flow/models/ChartBlockModel.d.ts +0 -65
  24. package/dist/client/flow/models/ChartOptionsBuilder.d.ts +0 -18
  25. package/dist/client/flow/models/ChartOptionsBuilder.service.d.ts +0 -58
  26. package/dist/client/flow/models/ChartOptionsEditor.d.ts +0 -16
  27. package/dist/client/flow/models/ChartOptionsPanel.d.ts +0 -11
  28. package/dist/client/flow/models/ConfigPanel.d.ts +0 -10
  29. package/dist/client/flow/models/ECharts.d.ts +0 -20
  30. package/dist/client/flow/models/EventsEditor.d.ts +0 -11
  31. package/dist/client/flow/models/EventsPanel.d.ts +0 -10
  32. package/dist/client/flow/models/QueryBuilder.d.ts +0 -13
  33. package/dist/client/flow/models/QueryBuilder.service.d.ts +0 -20
  34. package/dist/client/flow/models/QueryPanel.d.ts +0 -10
  35. package/dist/client/flow/models/ResultPanel.d.ts +0 -10
  36. package/dist/client/flow/models/SQLEditor.d.ts +0 -10
  37. package/dist/client/flow/models/config-store.d.ts +0 -20
  38. package/dist/client/flow/resources/ChartResource.d.ts +0 -37
  39. package/dist/client/flow/utils.d.ts +0 -42
  40. package/dist/client-v2/174.dba50627bca0d5e3.js +0 -10
  41. package/dist/client-v2/542.16e56a96bbebf9b3.js +0 -10
@@ -7,4 +7,4 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@nocobase/client-v2"),require("dayjs"),require("@formily/reactive"),require("react"),require("antd"),require("@formily/react"),require("@nocobase/flow-engine"),require("@ant-design/icons"),require("@nocobase/utils/client"),require("lodash")):"function"==typeof define&&define.amd?define("@nocobase/plugin-data-visualization/client-v2",["react-i18next","@nocobase/client-v2","dayjs","@formily/reactive","react","antd","@formily/react","@nocobase/flow-engine","@ant-design/icons","@nocobase/utils/client","lodash"],t):"object"==typeof exports?exports["@nocobase/plugin-data-visualization/client-v2"]=t(require("react-i18next"),require("@nocobase/client-v2"),require("dayjs"),require("@formily/reactive"),require("react"),require("antd"),require("@formily/react"),require("@nocobase/flow-engine"),require("@ant-design/icons"),require("@nocobase/utils/client"),require("lodash")):e["@nocobase/plugin-data-visualization/client-v2"]=t(e["react-i18next"],e["@nocobase/client-v2"],e.dayjs,e["@formily/reactive"],e.react,e.antd,e["@formily/react"],e["@nocobase/flow-engine"],e["@ant-design/icons"],e["@nocobase/utils/client"],e.lodash)}(self,function(e,t,r,n,o,i,a,u,l,c,f){return function(){"use strict";var s,p,y,d={9667:function(e,t,r){r.d(t,{Gm:function(){return d},VS:function(){return d}});var n=r(3485),o=r(5230),i=r(7663);function a(e,t,r,n,o,i,a){try{var u=e[i](a),l=u.value}catch(e){r(e);return}u.done?t(l):Promise.resolve(l).then(n,o)}function u(e,t,r){return(u=p()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&f(o,r.prototype),o}).apply(null,arguments)}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e){var t="function"==typeof Map?new Map:void 0;return(s=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return u(e,arguments,c(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),f(r,e)})(e)}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}var y=function(e,t,r){var n,i,a,u=(null==e||null==(n=e.uiSchema)?void 0:n.enum)||(null==e||null==(a=e.options)||null==(i=a.uiSchema)?void 0:i.enum),l=function(e,t){if(Array.isArray(t))return t.map(function(t){return l(e,t)});var n=e.find(function(e){var r;return e.value===((null==t||null==(r=t.toString)?void 0:r.call(t))||t)});return o.Schema.compile((null==n?void 0:n.label)||t,{t:(null==r?void 0:r.t)||function(e){return e}})};return u&&Array.isArray(u)?l(u,t):t},d=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,r;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,r=arguments,t=c(t),l(e=function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,p()?Reflect.construct(t,r||[],c(this).constructor):t.apply(this,r)),"charts",new i.EK),l(e,"fieldInterfaceConfigs",{select:{valueFormatter:y},multipleSelect:{valueFormatter:y},radioGroup:{valueFormatter:y},checkboxGroup:{valueFormatter:y}}),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&f(n,e),t=[{key:"registerFieldInterfaceConfig",value:function(e,t){this.fieldInterfaceConfigs[e]=t}},{key:"load",value:function(){var e;return(e=function(){return function(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,n=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(e){return this.flowEngine.registerModelLoaders({ChartBlockModel:{loader:function(){return Promise.all([r.e("174"),r.e("542")]).then(r.bind(r,2149))}}}),[2]})},function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function u(e){a(i,n,o,u,l,"next",e)}function l(e){a(i,n,o,u,l,"throw",e)}u(void 0)})}).call(this)}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(n.prototype,t),n}(s(n.Plugin));t.Ay=d},7663:function(e,t,r){r.d(t,{t1:function(){return O},uy:function(){return d},Dl:function(){return s},Tp:function(){return y},xD:function(){return p},EK:function(){return f}});var n=r(3485),o=r(9667);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,t)||c(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.")}()}function l(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c(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 c(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}}var f=function(){var e;function t(){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");a(this,"charts",new Map)}return e=[{key:"addGroup",value:function(e,t){if(this.charts.has(e))throw Error('[data-visualization] Chart group "'.concat(e,'" already exists'));this.charts.set(e,t)}},{key:"add",value:function(e,t){var r=this.charts.get(e);if(r){var n,o,i=Array.isArray(t)?t:[t];this.charts.set(e,(n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){a(e,t,r[t])})}return e}({},r),o=o={charts:l(r.charts).concat(l(i))},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n))}}},{key:"getChartTypes",value:function(){return Array.from(this.charts.entries()).sort(function(e,t){var r=u(e,2)[1],n=u(t,2)[1];return(r.sort||0)-(n.sort||0)}).map(function(e){var t=u(e,2),r=t[0],n=t[1];return{label:n.title,value:r,children:n.charts.map(function(e){return{key:"".concat(r,".").concat(e.name),label:e.title,value:e.name}})}})}},{key:"getCharts",value:function(){var e={};return this.charts.forEach(function(t,r){t.charts.forEach(function(t){e["".concat(r,".").concat(t.name)]=t})}),e}},{key:"getChart",value:function(e){if(e)return this.getCharts()[e]}},{key:"getDefaultChartType",value:function(){var e,t=this.getChartTypes()[0],r=null==t||null==(e=t.children)?void 0:e[0];return t&&r?"".concat(t.value,".").concat(r.value):void 0}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}(),s=function(){return(0,n.usePlugin)(o.Ay).charts.getChartTypes()},p=function(){return(0,n.usePlugin)(o.Ay).charts.getDefaultChartType()},y=function(){return(0,n.usePlugin)(o.Ay).charts.getCharts()},d=function(e){return(0,n.usePlugin)(o.Ay).charts.getChart(e)},v=r(9155),b=r(8376),m=r(9488);function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var g={field:function(e){var t=e.name,r=e.title,n=e.required,o=e.defaultValue,i=e.description;return h({},t,{title:(0,m.vV)(r),type:"string","x-decorator":"FormItem","x-component":"Select","x-reactions":"{{ useChartFields }}",required:n,description:i,default:o})},input:function(e){var t=e.name,r=e.title,n=e.required,o=e.defaultValue,i=e.description;return h({},t,{title:(0,m.vV)(r),type:"string","x-decorator":"FormItem","x-component":"Input",required:n,default:o,description:i})},boolean:function(e){var t=e.name,r=e.title,n=e.defaultValue,o=e.description;return h({},t,{"x-content":(0,m.vV)(r),type:"boolean","x-decorator":"FormItem","x-component":"Checkbox",default:void 0!==n&&n,description:o})},select:function(e){var t=e.name,r=e.title,n=e.required,o=e.defaultValue,i=e.options,a=e.description;return h({},t,{title:(0,m.vV)(r),type:"string","x-decorator":"FormItem","x-component":"Select",required:n,default:o,description:a,enum:i})},radio:function(e){var t=e.name,r=e.title,n=e.defaultValue,o=e.options,i=e.description,a=e.componentProps;return h({},t,{title:(0,m.vV)(r),type:"string","x-decorator":"FormItem","x-component":"Radio.Group","x-component-props":function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){h(e,t,r[t])})}return e}({},a),default:n,description:i,enum:o})},percent:function(e){return h({},e.name,{title:e.title,type:"number","x-decorator":"FormItem","x-component":"InputNumber",default:e.defaultValue,description:e.description,"x-component-props":{suffix:"%"}})},xField:{configType:"field",name:"xField",title:"xField",required:!0},yField:{configType:"field",name:"yField",title:"yField",required:!0},seriesField:{configType:"field",name:"seriesField",title:"seriesField"},colorField:{configType:"field",name:"colorField",title:"colorField",required:!0},isStack:{configType:"boolean",name:"isStack",title:"isStack"},smooth:{configType:"boolean",name:"smooth",title:"smooth"},isPercent:{configType:"boolean",name:"isPercent",title:"isPercent"},isGroup:{configType:"boolean",name:"isGroup",title:"isGroup"},size:function(){return{size:{title:(0,m.vV)("Size"),type:"object","x-decorator":"FormItem","x-component":"Space",properties:{type:{"x-component":"Select","x-component-props":{allowClear:!1},default:"ratio",enum:[{label:(0,m.vV)("Aspect ratio"),value:"ratio"},{label:(0,m.vV)("Fixed height"),value:"fixed"}]},fixed:{type:"number","x-component":"InputNumber","x-component-props":{min:0,addonAfter:"px"},"x-reactions":[{dependencies:[".type"],fulfill:{state:{visible:"{{$deps[0] === 'fixed'}}"}}}]},ratio:{type:"object","x-component":"Space","x-reactions":[{dependencies:[".type"],fulfill:{state:{visible:"{{$deps[0] === 'ratio'}}"}}}],properties:{width:{type:"number","x-component":"InputNumber","x-component-props":{placeholder:(0,m.vV)("Width"),min:1}},colon:{type:"void","x-component":"Text","x-component-props":{children:":"}},height:{type:"number","x-component":"InputNumber","x-component-props":{placeholder:(0,m.vV)("Height"),min:1}}}}}}}}};function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var O=function(){var e;function t(e){var r=e.name,n=e.title,o=e.enableAdvancedConfig,i=e.Component,a=e.config;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");Y(this,"name",void 0),Y(this,"title",void 0),Y(this,"enableAdvancedConfig",!1),Y(this,"Component",void 0),Y(this,"config",void 0),Y(this,"configTypes",new Map),this.name=r,this.title=n,this.Component=(0,v.memo)(i,function(e,t){return JSON.stringify(e)===JSON.stringify(t)}),this.config=a,this.enableAdvancedConfig=o||!1,this.addConfigTypes(g)}return e=[{key:"schema",get:function(){var e=this;return this.config?{type:"object",properties:this.config.reduce(function(t,r){var n={};if("string"==typeof r&&(r=e.configTypes.get(r)),"function"==typeof r)n=r();else if(r.configType){var o=e.configTypes.get(r.configType);n=(null==o?void 0:o(r))||{}}else n=r;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){Y(e,t,r[t])})}return e}({},t,n)},{})}:{}}},{key:"addConfigTypes",value:function(e){var t=this;Object.entries(e).forEach(function(e){var r=function(e){if(Array.isArray(e))return e}(e)||function(e){var t,r,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(t=n.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,r=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw r}}return o}}(e)||function(e){if(e){if("string"==typeof e)return w(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return w(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=r[0],o=r[1];t.configTypes.set(n,o)})}},{key:"infer",value:function(e,t){var r=t.measures,n=t.dimensions,o=[],i=function(e,t){if(t.alias)return e.find(function(e){return e.value===t.alias});var r=(0,b.cn)(t.field).alias;return e.find(function(e){return e.value===r})};if((null==r?void 0:r.length)&&(a=i(e,r[0]),o=r.map(function(t){return i(e,t)})),n){if(1===n.length)f=i(e,n[0]);else if(n.length>1){n.forEach(function(t,r){var n=i(e,t);["date","time","datetime"].includes(null==n?void 0:n.type)&&(f=n,c=r)}),c=c||0;var a,u,l,c,f=f||i(e,n[c]),s=n.filter(function(e,t){return t!==c}).map(function(t){return i(e,t)});1===s.length?(u=s[0],l=s[0]):s.length>1&&(l=s[0],u=s[1])}}return{xField:f,yField:a,seriesField:u,colorField:l,yFields:o}}},{key:"getProps",value:function(e){return e}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}()},8376:function(e,t,r){r.d(t,{A5:function(){return w},JR:function(){return p},Nj:function(){return Y},OK:function(){return v},_A:function(){return s},_J:function(){return y},cY:function(){return m},cn:function(){return g},lu:function(){return h},yy:function(){return d}});var n=r(5230),o=r(9155),i=r.n(o),a=r(9488);function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(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.")}()}function c(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function f(e,t){if(e){if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return u(e,t)}}function s(e){if(!Array.isArray(e)||0===e.length)return{objects:[],rows:[],columns:[]};var t=Object.keys(e[0]),r=t[0],n=t.slice(1),o=[t];e.forEach(function(e){o.push(t.map(function(t){return e[t]}))});var i=[e.map(function(e){return e[r]})];return n.forEach(function(t){i.push(e.map(function(e){return e[t]}))}),{dimensions:t,objects:e,rows:o,columns:i}}function p(e){if(!e)return e;var t,r,n,o=e.dataset,i=Array.isArray(o)?null==(t=o[0])?void 0:t.source:null==o?void 0:o.source,a=e.series,u=Array.isArray(a)?a:a?[a]:[];if(!Array.isArray(i)||0===i.length)return e;var l=i[0];if(!l||(void 0===l?"undefined":c(l))!=="object"||Array.isArray(l))return e;var f=u.filter(function(e){return(null==e?void 0:e.type)==="pie"});if(0===f.length)return e;var s=null==(n=f[0])||null==(r=n.encode)?void 0:r.value,p=Array.isArray(s)?s[0]:s;if(("string"!=typeof p||!p)&&Object.prototype.hasOwnProperty.call(l,"value")&&(p="value"),"string"!=typeof p||!p)return e;var y=function(e){return e.includes("{c}")?e.replace(/\{c\}/g,"{@"+p+"}"):e};return f.forEach(function(e){(null==e?void 0:e.label)&&"string"==typeof e.label.formatter&&(e.label.formatter=y(e.label.formatter)),(null==e?void 0:e.tooltip)&&"string"==typeof e.tooltip.formatter&&(e.tooltip.formatter=y(e.tooltip.formatter))}),e.tooltip&&"string"==typeof e.tooltip.formatter&&(e.tooltip.formatter=y(e.tooltip.formatter)),e}var y={datetime:[{label:(0,a.MZ)("YYYY"),value:"YYYY"},{label:(0,a.MZ)("MM"),value:"MM"},{label:(0,a.MZ)("DD"),value:"DD"},{label:(0,a.MZ)("HH:mm"),value:"HH:mm"},{label:(0,a.MZ)("YYYY-MM"),value:"YYYY-MM"},{label:(0,a.MZ)("YYYY-MM-DD"),value:"YYYY-MM-DD"},{label:(0,a.MZ)("YYYY-MM-DD HH:mm"),value:"YYYY-MM-DD HH:mm"},{label:(0,a.MZ)("YYYY-MM-DD HH:mm:ss"),value:"YYYY-MM-DD HH:mm:ss"},{label:(0,a.MZ)("MM/DD/YYYY"),value:"MM/DD/YYYY"},{label:(0,a.MZ)("MM/DD/YYYY HH:mm"),value:"MM/DD/YYYY HH:mm"},{label:(0,a.MZ)("MM/DD/YYYY HH:mm:ss"),value:"MM/DD/YYYY HH:mm:ss"}],date:[{label:(0,a.MZ)("YYYY"),value:"YYYY"},{label:(0,a.MZ)("MM"),value:"MM"},{label:(0,a.MZ)("DD"),value:"DD"},{label:(0,a.MZ)("YYYY-MM"),value:"YYYY-MM"},{label:(0,a.MZ)("YYYY-MM-DD"),value:"YYYY-MM-DD"},{label:(0,a.MZ)("MM/DD/YYYY"),value:"MM/DD/YYYY"}],time:[{label:(0,a.MZ)("HH"),value:"HH"},{label:(0,a.MZ)("HH:mm"),value:"HH:mm"},{label:(0,a.MZ)("HH:mm:ss"),value:"HH:mm:ss"}]};function d(e){return new Promise(function(t){setTimeout(t,e)})}function v(e,t){if("string"!=typeof e)return"";var r=e.trim();if(!r)return"";var n=r.replace(RegExp("[::]\\s*$","u"),""),o="string"==typeof t&&/^zh([-_]|$)/i.test(t);return"".concat(n).concat(o?":":":")}var b=function(){if("u"<typeof window)return!1;try{var e,t=new URLSearchParams(window.location.search||"").get("_debug");if("true"===t||"1"===t)return!0;var r=null==(e=window.localStorage)?void 0:e.getItem("nocobase.debug");if("true"===r||"1"===r)return!0}catch(e){}return!1},m=function(){for(var e,t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];b()&&(e=console).log.apply(e,function(e){if(Array.isArray(e))return u(e)}(r)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||f(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())},h=function(){var e=(0,a.kj)();return i().useCallback(function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n.Schema.compile(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({t:e},r))},[e])},g=function(e){var t,r,n;return Array.isArray(e)?1===e.length?r=e[0]:e.length>1&&(t=(n=l(e,2))[0],r=n[1]):r=e,{target:t,name:r,alias:t?"".concat(t,".").concat(r):r}},w=function(e){if((void 0===e?"undefined":c(e))==="object"&&null!==e){if(Array.isArray(e)){var t=e.map(function(e){return w(e)}).filter(Boolean);return t.length>0?t:null}var r={},n=!0,o=!1,i=void 0;try{for(var a,u=Object.entries(e)[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var f=l(a.value,2),s=f[0],p=f[1];if("string"!=typeof s||0!==s.trim().length){var y=w(p);null==y||(void 0===y?"undefined":c(y))==="object"&&(Array.isArray(y)&&0===y.length||0===Object.keys(y).length)||(r[s]=y)}}}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return Object.keys(r).length>0?r:null}return"string"==typeof e&&e.startsWith("{{$nFilter.")&&e.endsWith("}}")?null:e},Y=function(e){return!e||(Array.isArray(e)?0===e.length:!!((void 0===e?"undefined":c(e))==="object"&&(0===Object.keys(e).length||Array.isArray(e.$and)&&0===e.$and.length||Array.isArray(e.$or)&&0===e.$or.length))||!1)}},9488:function(e,t,r){r.d(t,{MZ:function(){return a},kj:function(){return u},vV:function(){return l}});var n=r(7694),o=r(5953),i="@nocobase/plugin-data-visualization";function a(e){return(0,n.tExpr)(e,{ns:[i,"client"]})}function u(){return(0,o.useTranslation)([i,"client"],{nsMode:"fallback"})[0]}function l(e){return"{{t(".concat(JSON.stringify(e),", { ns: ['").concat(i,"', 'client'], nsMode: 'fallback' })}}")}},7375:function(e){e.exports=l},5230:function(e){e.exports=a},7992:function(e){e.exports=n},3485:function(e){e.exports=t},7694:function(e){e.exports=u},7768:function(e){e.exports=c},2059:function(e){e.exports=i},9185:function(e){e.exports=r},6773:function(e){e.exports=f},9155:function(e){e.exports=o},5953:function(t){t.exports=e}},v={};function b(e){var t=v[e];if(void 0!==t)return t.exports;var r=v[e]={id:e,loaded:!1,exports:{}};return d[e](r,r.exports,b),r.loaded=!0,r.exports}b.m=d,b.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return b.d(t,{a:t}),t},b.d=function(e,t){for(var r in t)b.o(t,r)&&!b.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},b.f={},b.e=function(e){return Promise.all(Object.keys(b.f).reduce(function(t,r){return b.f[r](e,t),t},[]))},b.u=function(e){return""+e+"."+({174:"dba50627bca0d5e3",176:"8068b95175599050",214:"a999212f348c0092",542:"16e56a96bbebf9b3",680:"a2c2838809485d36"})[e]+".js"},b.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),b.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},m={},b.l=function(e,t,r,n){if(m[e])return void m[e].push(t);if(void 0!==r)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var l=a[u];if(l.getAttribute("src")==e||l.getAttribute("data-rspack")=="@nocobase/plugin-data-visualization/client-v2:"+r){o=l;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,b.nc&&o.setAttribute("nonce",b.nc),o.setAttribute("data-rspack","@nocobase/plugin-data-visualization/client-v2:"+r),o.src=e),m[e]=[t];var c=function(t,r){o.onerror=o.onload=null,clearTimeout(f);var n=m[e];if(delete m[e],o.parentNode&&o.parentNode.removeChild(o),n&&n.forEach(function(e){return e(r)}),t)return t(r)},f=setTimeout(c.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=c.bind(null,o.onerror),o.onload=c.bind(null,o.onload),i&&document.head.appendChild(o)},b.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},b.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},b.g.importScripts&&(h=b.g.location+"");var m,h,g=b.g.document;if(!h&&g&&(g.currentScript&&"SCRIPT"===g.currentScript.tagName.toUpperCase()&&(h=g.currentScript.src),!h)){var w=g.getElementsByTagName("script");if(w.length)for(var Y=w.length-1;Y>-1&&(!h||!/^http(s?):/.test(h));)h=w[Y--].src}if(!h)throw Error("Automatic publicPath is not supported in this browser");b.p=h.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s={889:0},b.f.j=function(e,t){var r=b.o(s,e)?s[e]:void 0;if(0!==r)if(r)t.push(r[2]);else{var n=new Promise(function(t,n){r=s[e]=[t,n]});t.push(r[2]=n);var o=b.p+b.u(e),i=Error();b.l(o,function(t){if(b.o(s,e)&&(0!==(r=s[e])&&(s[e]=void 0),r)){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",i.name="ChunkLoadError",i.type=n,i.request=o,r[1](i)}},"chunk-"+e,e)}},p=function(e,t){var r,n,o=t[0],i=t[1],a=t[2],u=0;if(o.some(function(e){return 0!==s[e]})){for(r in i)b.o(i,r)&&(b.m[r]=i[r]);a&&a(b)}for(e&&e(t);u<o.length;u++)n=o[u],b.o(s,n)&&s[n]&&s[n][0](),s[n]=0},(y=self.webpackChunk_nocobase_plugin_data_visualization_client_v2=self.webpackChunk_nocobase_plugin_data_visualization_client_v2||[]).forEach(p.bind(null,0)),y.push=p.bind(null,y.push.bind(y));var O={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-data-visualization/dist/client-v2/")}if(!e){if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var n=window.location.pathname||"/",o=n.indexOf("/v2/");e=o>=0?n.slice(0,o+1):"/"}e&&(e=e.replace(/\/v2\/?$/,"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-data-visualization/dist/client-v2/"}b.p=e}(),!function(){b.r(O),b.d(O,{default:function(){return e.Ay},PluginDataVisualizationClient:function(){return e.VS},useCharts:function(){return t.Tp},useChartTypes:function(){return t.Dl},useDefaultChartType:function(){return t.xD},ChartGroup:function(){return t.EK},Chart:function(){return t.t1},useChart:function(){return t.uy},useSetChartSize:function(){return o},PluginDataVisualiztionClient:function(){return e.Gm}});var e=b(9667),t=b(7663),r=b(9155);function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var o=function(){var e,t,o,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0,u=function(e){if(Array.isArray(e))return e}(e=(0,r.useState)(a||i.fixed||0))||function(e){var t,r,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(t=n.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,r=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw r}}return o}}(e)||function(e){if(e){if("string"==typeof e)return n(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return n(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),l=u[0],c=u[1],f=(0,r.useRef)(null);return(0,r.useEffect)(function(){var e,t,r=f.current;if(r&&!a&&"fixed"!==i.type){var n="ratio"===i.type&&(null==(e=i.ratio)?void 0:e.width)&&(null==(t=i.ratio)?void 0:t.height)?i.ratio.height/i.ratio.width:0,o=new ResizeObserver(function(e){e.forEach(function(e){c(n?e.contentRect.width*n:Math.max(e.contentRect.height,400))})});return o.observe(r),function(){return o.disconnect()}}},[a,null==(t=i.ratio)?void 0:t.height,null==(o=i.ratio)?void 0:o.width,i.type]),{chartRef:f,chartHeight:a||l||i.fixed||400}}}(),O}()});
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@nocobase/client-v2"),require("dayjs"),require("react"),require("antd"),require("@nocobase/flow-engine"),require("@ant-design/icons"),require("@nocobase/utils/client"),require("lodash")):"function"==typeof define&&define.amd?define("@nocobase/plugin-data-visualization/client-v2",["react-i18next","@nocobase/client-v2","dayjs","react","antd","@nocobase/flow-engine","@ant-design/icons","@nocobase/utils/client","lodash"],t):"object"==typeof exports?exports["@nocobase/plugin-data-visualization/client-v2"]=t(require("react-i18next"),require("@nocobase/client-v2"),require("dayjs"),require("react"),require("antd"),require("@nocobase/flow-engine"),require("@ant-design/icons"),require("@nocobase/utils/client"),require("lodash")):e["@nocobase/plugin-data-visualization/client-v2"]=t(e["react-i18next"],e["@nocobase/client-v2"],e.dayjs,e.react,e.antd,e["@nocobase/flow-engine"],e["@ant-design/icons"],e["@nocobase/utils/client"],e.lodash)}(self,function(e,t,r,n,o,i,a,u,l){return function(){"use strict";var c,f,s,p={9667:function(e,t,r){r.d(t,{Gm:function(){return y},VS:function(){return y}});var n=r(3485),o=r(7663),i=r(9488);function a(e,t,r,n,o,i,a){try{var u=e[i](a),l=u.value}catch(e){r(e);return}u.done?t(l):Promise.resolve(l).then(n,o)}function u(e,t,r){return(u=p()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&f(o,r.prototype),o}).apply(null,arguments)}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e){var t="function"==typeof Map?new Map:void 0;return(s=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return u(e,arguments,c(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),f(r,e)})(e)}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}var d=function(e,t,r){var n,o,a,u=(null==e||null==(n=e.uiSchema)?void 0:n.enum)||(null==e||null==(a=e.options)||null==(o=a.uiSchema)?void 0:o.enum),l=function(e,t){if(Array.isArray(t))return t.map(function(t){return l(e,t)});var n=e.find(function(e){var r;return e.value===((null==t||null==(r=t.toString)?void 0:r.call(t))||t)});return(0,i.OJ)((null==n?void 0:n.label)||t,(null==r?void 0:r.t)||function(e){return e})};return u&&Array.isArray(u)?l(u,t):t},y=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,r;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,r=arguments,t=c(t),l(e=function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,p()?Reflect.construct(t,r||[],c(this).constructor):t.apply(this,r)),"charts",new o.EK),l(e,"fieldInterfaceConfigs",{select:{valueFormatter:d},multipleSelect:{valueFormatter:d},radioGroup:{valueFormatter:d},checkboxGroup:{valueFormatter:d}}),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&f(n,e),t=[{key:"registerFieldInterfaceConfig",value:function(e,t){this.fieldInterfaceConfigs[e]=t}},{key:"load",value:function(){var e;return(e=function(){return function(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,n=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(e){return this.flowEngine.registerModelLoaders({ChartBlockModel:{loader:function(){return Promise.all([r.e("468"),r.e("568")]).then(r.bind(r,7603))}}}),[2]})},function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function u(e){a(i,n,o,u,l,"next",e)}function l(e){a(i,n,o,u,l,"throw",e)}u(void 0)})}).call(this)}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(n.prototype,t),n}(s(n.Plugin));t.Ay=y},7663:function(e,t,r){r.d(t,{t1:function(){return x},uy:function(){return y},Dl:function(){return s},Tp:function(){return d},xD:function(){return p},EK:function(){return f}});var n=r(3485),o=r(9667);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,t)||c(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.")}()}function l(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c(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 c(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}}var f=function(){var e;function t(){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");a(this,"charts",new Map)}return e=[{key:"addGroup",value:function(e,t){if(this.charts.has(e))throw Error('[data-visualization] Chart group "'.concat(e,'" already exists'));this.charts.set(e,t)}},{key:"add",value:function(e,t){var r=this.charts.get(e);if(r){var n,o,i=Array.isArray(t)?t:[t];this.charts.set(e,(n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){a(e,t,r[t])})}return e}({},r),o=o={charts:l(r.charts).concat(l(i))},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n))}}},{key:"getChartTypes",value:function(){return Array.from(this.charts.entries()).sort(function(e,t){var r=u(e,2)[1],n=u(t,2)[1];return(r.sort||0)-(n.sort||0)}).map(function(e){var t=u(e,2),r=t[0],n=t[1];return{label:n.title,value:r,children:n.charts.map(function(e){return{key:"".concat(r,".").concat(e.name),label:e.title,value:e.name}})}})}},{key:"getCharts",value:function(){var e={};return this.charts.forEach(function(t,r){t.charts.forEach(function(t){e["".concat(r,".").concat(t.name)]=t})}),e}},{key:"getChart",value:function(e){if(e)return this.getCharts()[e]}},{key:"getDefaultChartType",value:function(){var e,t=this.getChartTypes()[0],r=null==t||null==(e=t.children)?void 0:e[0];return t&&r?"".concat(t.value,".").concat(r.value):void 0}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}(),s=function(){var e,t=v();return(null==t||null==(e=t.charts)?void 0:e.getChartTypes())||[]},p=function(){var e=v();return b(null==e?void 0:e.charts)},d=function(){var e,t=v();return(null==t||null==(e=t.charts)?void 0:e.getCharts())||{}},y=function(e){var t,r=v();return null==r||null==(t=r.charts)?void 0:t.getChart(e)},v=function(){return(0,n.useApp)().pm.get(o.Ay)},b=function(e){if(e){if("function"==typeof e.getDefaultChartType)return e.getDefaultChartType();var t,r,n,o=null==(t=e.getChartTypes)?void 0:t.call(e)[0];return null==o||null==(n=o.children)||null==(r=n[0])?void 0:r.value}},h=r(9155),m=r(8376),g=r(9488);function w(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Y={field:function(e){var t=e.name,r=e.title,n=e.required,o=e.defaultValue,i=e.description;return w({},t,{title:(0,g.vV)(r),type:"string","x-decorator":"FormItem","x-component":"Select","x-reactions":"{{ useChartFields }}",required:n,description:i,default:o})},input:function(e){var t=e.name,r=e.title,n=e.required,o=e.defaultValue,i=e.description;return w({},t,{title:(0,g.vV)(r),type:"string","x-decorator":"FormItem","x-component":"Input",required:n,default:o,description:i})},boolean:function(e){var t=e.name,r=e.title,n=e.defaultValue,o=e.description;return w({},t,{"x-content":(0,g.vV)(r),type:"boolean","x-decorator":"FormItem","x-component":"Checkbox",default:void 0!==n&&n,description:o})},select:function(e){var t=e.name,r=e.title,n=e.required,o=e.defaultValue,i=e.options,a=e.description;return w({},t,{title:(0,g.vV)(r),type:"string","x-decorator":"FormItem","x-component":"Select",required:n,default:o,description:a,enum:i})},radio:function(e){var t=e.name,r=e.title,n=e.defaultValue,o=e.options,i=e.description,a=e.componentProps;return w({},t,{title:(0,g.vV)(r),type:"string","x-decorator":"FormItem","x-component":"Radio.Group","x-component-props":function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){w(e,t,r[t])})}return e}({},a),default:n,description:i,enum:o})},percent:function(e){return w({},e.name,{title:e.title,type:"number","x-decorator":"FormItem","x-component":"InputNumber",default:e.defaultValue,description:e.description,"x-component-props":{suffix:"%"}})},xField:{configType:"field",name:"xField",title:"xField",required:!0},yField:{configType:"field",name:"yField",title:"yField",required:!0},seriesField:{configType:"field",name:"seriesField",title:"seriesField"},colorField:{configType:"field",name:"colorField",title:"colorField",required:!0},isStack:{configType:"boolean",name:"isStack",title:"isStack"},smooth:{configType:"boolean",name:"smooth",title:"smooth"},isPercent:{configType:"boolean",name:"isPercent",title:"isPercent"},isGroup:{configType:"boolean",name:"isGroup",title:"isGroup"},size:function(){return{size:{title:(0,g.vV)("Size"),type:"object","x-decorator":"FormItem","x-component":"Space",properties:{type:{"x-component":"Select","x-component-props":{allowClear:!1},default:"ratio",enum:[{label:(0,g.vV)("Aspect ratio"),value:"ratio"},{label:(0,g.vV)("Fixed height"),value:"fixed"}]},fixed:{type:"number","x-component":"InputNumber","x-component-props":{min:0,addonAfter:"px"},"x-reactions":[{dependencies:[".type"],fulfill:{state:{visible:"{{$deps[0] === 'fixed'}}"}}}]},ratio:{type:"object","x-component":"Space","x-reactions":[{dependencies:[".type"],fulfill:{state:{visible:"{{$deps[0] === 'ratio'}}"}}}],properties:{width:{type:"number","x-component":"InputNumber","x-component-props":{placeholder:(0,g.vV)("Width"),min:1}},colon:{type:"void","x-component":"Text","x-component-props":{children:":"}},height:{type:"number","x-component":"InputNumber","x-component-props":{placeholder:(0,g.vV)("Height"),min:1}}}}}}}}};function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function j(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var x=function(){var e;function t(e){var r=e.name,n=e.title,o=e.enableAdvancedConfig,i=e.Component,a=e.config;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");j(this,"name",void 0),j(this,"title",void 0),j(this,"enableAdvancedConfig",!1),j(this,"Component",void 0),j(this,"config",void 0),j(this,"configTypes",new Map),this.name=r,this.title=n,this.Component=(0,h.memo)(i,function(e,t){return JSON.stringify(e)===JSON.stringify(t)}),this.config=a,this.enableAdvancedConfig=o||!1,this.addConfigTypes(Y)}return e=[{key:"schema",get:function(){var e=this;return this.config?{type:"object",properties:this.config.reduce(function(t,r){var n={};if("string"==typeof r&&(r=e.configTypes.get(r)),"function"==typeof r)n=r();else if(r.configType){var o=e.configTypes.get(r.configType);n=(null==o?void 0:o(r))||{}}else n=r;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){j(e,t,r[t])})}return e}({},t,n)},{})}:{}}},{key:"addConfigTypes",value:function(e){var t=this;Object.entries(e).forEach(function(e){var r=function(e){if(Array.isArray(e))return e}(e)||function(e){var t,r,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(t=n.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,r=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw r}}return o}}(e)||function(e){if(e){if("string"==typeof e)return O(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return O(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=r[0],o=r[1];t.configTypes.set(n,o)})}},{key:"infer",value:function(e,t){var r=t.measures,n=t.dimensions,o=[],i=function(e,t){if(t.alias)return e.find(function(e){return e.value===t.alias});var r=(0,m.cn)(t.field).alias;return e.find(function(e){return e.value===r})};if((null==r?void 0:r.length)&&(a=i(e,r[0]),o=r.map(function(t){return i(e,t)})),n){if(1===n.length)f=i(e,n[0]);else if(n.length>1){n.forEach(function(t,r){var n=i(e,t);["date","time","datetime"].includes(null==n?void 0:n.type)&&(f=n,c=r)}),c=c||0;var a,u,l,c,f=f||i(e,n[c]),s=n.filter(function(e,t){return t!==c}).map(function(t){return i(e,t)});1===s.length?(u=s[0],l=s[0]):s.length>1&&(l=s[0],u=s[1])}}return{xField:f,yField:a,seriesField:u,colorField:l,yFields:o}}},{key:"getProps",value:function(e){return e}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}()},8376:function(e,t,r){r.d(t,{A5:function(){return g},JR:function(){return s},Nj:function(){return w},OK:function(){return y},_A:function(){return f},_J:function(){return p},cY:function(){return b},cn:function(){return m},lu:function(){return h},yy:function(){return d}});var n=r(9155),o=r.n(n),i=r(9488);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,t)||c(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.")}()}function l(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function c(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}}function f(e){if(!Array.isArray(e)||0===e.length)return{objects:[],rows:[],columns:[]};var t=Object.keys(e[0]),r=t[0],n=t.slice(1),o=[t];e.forEach(function(e){o.push(t.map(function(t){return e[t]}))});var i=[e.map(function(e){return e[r]})];return n.forEach(function(t){i.push(e.map(function(e){return e[t]}))}),{dimensions:t,objects:e,rows:o,columns:i}}function s(e){if(!e)return e;var t,r,n,o=e.dataset,i=Array.isArray(o)?null==(t=o[0])?void 0:t.source:null==o?void 0:o.source,a=e.series,u=Array.isArray(a)?a:a?[a]:[];if(!Array.isArray(i)||0===i.length)return e;var c=i[0];if(!c||(void 0===c?"undefined":l(c))!=="object"||Array.isArray(c))return e;var f=u.filter(function(e){return(null==e?void 0:e.type)==="pie"});if(0===f.length)return e;var s=null==(n=f[0])||null==(r=n.encode)?void 0:r.value,p=Array.isArray(s)?s[0]:s;if(("string"!=typeof p||!p)&&Object.prototype.hasOwnProperty.call(c,"value")&&(p="value"),"string"!=typeof p||!p)return e;var d=function(e){return e.includes("{c}")?e.replace(/\{c\}/g,"{@"+p+"}"):e};return f.forEach(function(e){(null==e?void 0:e.label)&&"string"==typeof e.label.formatter&&(e.label.formatter=d(e.label.formatter)),(null==e?void 0:e.tooltip)&&"string"==typeof e.tooltip.formatter&&(e.tooltip.formatter=d(e.tooltip.formatter))}),e.tooltip&&"string"==typeof e.tooltip.formatter&&(e.tooltip.formatter=d(e.tooltip.formatter)),e}var p={datetime:[{label:(0,i.MZ)("YYYY"),value:"YYYY"},{label:(0,i.MZ)("MM"),value:"MM"},{label:(0,i.MZ)("DD"),value:"DD"},{label:(0,i.MZ)("HH:mm"),value:"HH:mm"},{label:(0,i.MZ)("YYYY-MM"),value:"YYYY-MM"},{label:(0,i.MZ)("YYYY-MM-DD"),value:"YYYY-MM-DD"},{label:(0,i.MZ)("YYYY-MM-DD HH:mm"),value:"YYYY-MM-DD HH:mm"},{label:(0,i.MZ)("YYYY-MM-DD HH:mm:ss"),value:"YYYY-MM-DD HH:mm:ss"},{label:(0,i.MZ)("MM/DD/YYYY"),value:"MM/DD/YYYY"},{label:(0,i.MZ)("MM/DD/YYYY HH:mm"),value:"MM/DD/YYYY HH:mm"},{label:(0,i.MZ)("MM/DD/YYYY HH:mm:ss"),value:"MM/DD/YYYY HH:mm:ss"}],date:[{label:(0,i.MZ)("YYYY"),value:"YYYY"},{label:(0,i.MZ)("MM"),value:"MM"},{label:(0,i.MZ)("DD"),value:"DD"},{label:(0,i.MZ)("YYYY-MM"),value:"YYYY-MM"},{label:(0,i.MZ)("YYYY-MM-DD"),value:"YYYY-MM-DD"},{label:(0,i.MZ)("MM/DD/YYYY"),value:"MM/DD/YYYY"}],time:[{label:(0,i.MZ)("HH"),value:"HH"},{label:(0,i.MZ)("HH:mm"),value:"HH:mm"},{label:(0,i.MZ)("HH:mm:ss"),value:"HH:mm:ss"}]};function d(e){return new Promise(function(t){setTimeout(t,e)})}function y(e,t){if("string"!=typeof e)return"";var r=e.trim();if(!r)return"";var n=r.replace(RegExp("[::]\\s*$","u"),""),o="string"==typeof t&&/^zh([-_]|$)/i.test(t);return"".concat(n).concat(o?":":":")}var v=function(){if("u"<typeof window)return!1;try{var e,t=new URLSearchParams(window.location.search||"").get("_debug");if("true"===t||"1"===t)return!0;var r=null==(e=window.localStorage)?void 0:e.getItem("nocobase.debug");if("true"===r||"1"===r)return!0}catch(e){}return!1},b=function(){for(var e,t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];v()&&(e=console).log.apply(e,function(e){if(Array.isArray(e))return a(e)}(r)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||c(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())},h=function(){var e=(0,i.kj)();return o().useCallback(function(t){return(0,i.OJ)(t,e)},[e])},m=function(e){var t,r,n;return Array.isArray(e)?1===e.length?r=e[0]:e.length>1&&(t=(n=u(e,2))[0],r=n[1]):r=e,{target:t,name:r,alias:t?"".concat(t,".").concat(r):r}},g=function(e){if((void 0===e?"undefined":l(e))==="object"&&null!==e){if(Array.isArray(e)){var t=e.map(function(e){return g(e)}).filter(Boolean);return t.length>0?t:null}var r={},n=!0,o=!1,i=void 0;try{for(var a,c=Object.entries(e)[Symbol.iterator]();!(n=(a=c.next()).done);n=!0){var f=u(a.value,2),s=f[0],p=f[1];if("string"!=typeof s||0!==s.trim().length){var d=g(p);null==d||(void 0===d?"undefined":l(d))==="object"&&(Array.isArray(d)&&0===d.length||0===Object.keys(d).length)||(r[s]=d)}}}catch(e){o=!0,i=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return Object.keys(r).length>0?r:null}return"string"==typeof e&&e.startsWith("{{$nFilter.")&&e.endsWith("}}")?null:e},w=function(e){return!e||(Array.isArray(e)?0===e.length:!!((void 0===e?"undefined":l(e))==="object"&&(0===Object.keys(e).length||Array.isArray(e.$and)&&0===e.$and.length||Array.isArray(e.$or)&&0===e.$or.length))||!1)}},9488:function(e,t,r){r.d(t,{MZ:function(){return a},OJ:function(){return u},kj:function(){return l},vV:function(){return c}});var n=r(7694),o=r(5953),i="@nocobase/plugin-data-visualization";function a(e){return(0,n.tExpr)(e,{ns:[i,"client"]})}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e};return"string"==typeof e?e.replace(/\{\{\s*t\((['"])(.*?)\1(?:\s*,\s*\{[^}]*\})?\)\s*\}\}/g,function(e,r,n){return t(n)}):e}function l(){return(0,o.useTranslation)([i,"client"],{nsMode:"fallback"})[0]}function c(e){return"{{t(".concat(JSON.stringify(e),", { ns: ['").concat(i,"', 'client'], nsMode: 'fallback' })}}")}},7375:function(e){e.exports=a},3485:function(e){e.exports=t},7694:function(e){e.exports=i},7768:function(e){e.exports=u},2059:function(e){e.exports=o},9185:function(e){e.exports=r},6773:function(e){e.exports=l},9155:function(e){e.exports=n},5953:function(t){t.exports=e}},d={};function y(e){var t=d[e];if(void 0!==t)return t.exports;var r=d[e]={id:e,loaded:!1,exports:{}};return p[e](r,r.exports,y),r.loaded=!0,r.exports}y.m=p,y.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return y.d(t,{a:t}),t},y.d=function(e,t){for(var r in t)y.o(t,r)&&!y.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},y.f={},y.e=function(e){return Promise.all(Object.keys(y.f).reduce(function(t,r){return y.f[r](e,t),t},[]))},y.u=function(e){return""+e+"."+({176:"8068b95175599050",214:"a999212f348c0092",468:"95cb9025bce70a9c",568:"5b6cd8eb09c264ba",680:"a2c2838809485d36"})[e]+".js"},y.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),y.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},v={},y.l=function(e,t,r,n){if(v[e])return void v[e].push(t);if(void 0!==r)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var l=a[u];if(l.getAttribute("src")==e||l.getAttribute("data-rspack")=="@nocobase/plugin-data-visualization/client-v2:"+r){o=l;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,y.nc&&o.setAttribute("nonce",y.nc),o.setAttribute("data-rspack","@nocobase/plugin-data-visualization/client-v2:"+r),o.src=e),v[e]=[t];var c=function(t,r){o.onerror=o.onload=null,clearTimeout(f);var n=v[e];if(delete v[e],o.parentNode&&o.parentNode.removeChild(o),n&&n.forEach(function(e){return e(r)}),t)return t(r)},f=setTimeout(c.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=c.bind(null,o.onerror),o.onload=c.bind(null,o.onload),i&&document.head.appendChild(o)},y.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},y.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},y.nc=void 0,y.g.importScripts&&(b=y.g.location+"");var v,b,h=y.g.document;if(!b&&h&&(h.currentScript&&"SCRIPT"===h.currentScript.tagName.toUpperCase()&&(b=h.currentScript.src),!b)){var m=h.getElementsByTagName("script");if(m.length)for(var g=m.length-1;g>-1&&(!b||!/^http(s?):/.test(b));)b=m[g--].src}if(!b)throw Error("Automatic publicPath is not supported in this browser");y.p=b.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),c={889:0},y.f.j=function(e,t){var r=y.o(c,e)?c[e]:void 0;if(0!==r)if(r)t.push(r[2]);else{var n=new Promise(function(t,n){r=c[e]=[t,n]});t.push(r[2]=n);var o=y.p+y.u(e),i=Error();y.l(o,function(t){if(y.o(c,e)&&(0!==(r=c[e])&&(c[e]=void 0),r)){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",i.name="ChunkLoadError",i.type=n,i.request=o,r[1](i)}},"chunk-"+e,e)}},f=function(e,t){var r,n,o=t[0],i=t[1],a=t[2],u=0;if(o.some(function(e){return 0!==c[e]})){for(r in i)y.o(i,r)&&(y.m[r]=i[r]);a&&a(y)}for(e&&e(t);u<o.length;u++)n=o[u],y.o(c,n)&&c[n]&&c[n][0](),c[n]=0},(s=self.webpackChunk_nocobase_plugin_data_visualization_client_v2=self.webpackChunk_nocobase_plugin_data_visualization_client_v2||[]).forEach(f.bind(null,0)),s.push=f.bind(null,s.push.bind(s));var w={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-data-visualization/dist/client-v2/")}if(!e){if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var n=window.location.pathname||"/",o=n.indexOf("/v2/");e=o>=0?n.slice(0,o+1):"/"}e&&(e=e.replace(/\/v2\/?$/,"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-data-visualization/dist/client-v2/"}y.p=e}(),!function(){y.r(w),y.d(w,{default:function(){return e.Ay},PluginDataVisualizationClient:function(){return e.VS},useCharts:function(){return t.Tp},useChartTypes:function(){return t.Dl},useDefaultChartType:function(){return t.xD},ChartGroup:function(){return t.EK},Chart:function(){return t.t1},useChart:function(){return t.uy},useSetChartSize:function(){return o},PluginDataVisualiztionClient:function(){return e.Gm}});var e=y(9667),t=y(7663),r=y(9155);function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var o=function(){var e,t,o,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0,u=function(e){if(Array.isArray(e))return e}(e=(0,r.useState)(a||i.fixed||0))||function(e){var t,r,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(t=n.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,r=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw r}}return o}}(e)||function(e){if(e){if("string"==typeof e)return n(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return n(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),l=u[0],c=u[1],f=(0,r.useRef)(null);return(0,r.useEffect)(function(){var e,t,r=f.current;if(r&&!a&&"fixed"!==i.type){var n="ratio"===i.type&&(null==(e=i.ratio)?void 0:e.width)&&(null==(t=i.ratio)?void 0:t.height)?i.ratio.height/i.ratio.width:0,o=new ResizeObserver(function(e){e.forEach(function(e){c(n?e.contentRect.width*n:Math.max(e.contentRect.height,400))})});return o.observe(r),function(){return o.disconnect()}}},[a,null==(t=i.ratio)?void 0:t.height,null==(o=i.ratio)?void 0:o.width,i.type]),{chartRef:f,chartHeight:a||l||i.fixed||400}}}(),w}()});
@@ -8,6 +8,7 @@
8
8
  */
9
9
  export declare const NAMESPACE = "@nocobase/plugin-data-visualization";
10
10
  export declare function tExpr(key: string): string;
11
+ export declare function translateExpr(source: any, t?: (key: string) => string): any;
11
12
  export declare function useChartsTranslation(): import("react-i18next").UseTranslationResponse<("@nocobase/plugin-data-visualization" | "client")[], undefined>;
12
13
  export declare function useT(): import("react-i18next").TFunction<("@nocobase/plugin-data-visualization" | "client")[], undefined>;
13
14
  export declare function tStr(key: string): string;
@@ -8,19 +8,19 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "2.1.0-beta.36",
11
+ "@nocobase/client": "2.1.0-beta.38",
12
12
  "@formily/react": "2.3.7",
13
- "@nocobase/plugin-ai": "2.1.0-beta.36",
14
- "@nocobase/flow-engine": "2.1.0-beta.36",
13
+ "@nocobase/plugin-ai": "2.1.0-beta.38",
14
+ "@nocobase/flow-engine": "2.1.0-beta.38",
15
15
  "react-i18next": "11.18.6",
16
16
  "dayjs": "1.11.13",
17
17
  "@formily/shared": "2.3.7",
18
18
  "lodash": "4.18.1",
19
- "@nocobase/client-v2": "2.1.0-beta.36",
20
- "@nocobase/cache": "2.1.0-beta.36",
21
- "@nocobase/server": "2.1.0-beta.36",
22
- "@nocobase/test": "2.1.0-beta.36",
23
- "@nocobase/utils": "2.1.0-beta.36",
19
+ "@nocobase/client-v2": "2.1.0-beta.38",
20
+ "@nocobase/cache": "2.1.0-beta.38",
21
+ "@nocobase/server": "2.1.0-beta.38",
22
+ "@nocobase/test": "2.1.0-beta.38",
23
+ "@nocobase/utils": "2.1.0-beta.38",
24
24
  "react": "18.2.0",
25
25
  "@emotion/css": "11.13.0",
26
26
  "@ant-design/icons": "5.6.1",
@@ -28,10 +28,9 @@ module.exports = {
28
28
  "antd": "5.24.2",
29
29
  "@formily/antd-v5": "1.2.3",
30
30
  "@formily/core": "2.3.7",
31
- "@nocobase/actions": "2.1.0-beta.36",
32
- "@nocobase/acl": "2.1.0-beta.36",
33
- "@nocobase/plugin-acl": "2.1.0-beta.36",
34
- "@nocobase/plugin-flow-engine": "2.1.0-beta.36",
35
- "@nocobase/database": "2.1.0-beta.36",
36
- "@formily/reactive": "2.3.7"
31
+ "@nocobase/actions": "2.1.0-beta.38",
32
+ "@nocobase/acl": "2.1.0-beta.38",
33
+ "@nocobase/plugin-acl": "2.1.0-beta.38",
34
+ "@nocobase/plugin-flow-engine": "2.1.0-beta.38",
35
+ "@nocobase/database": "2.1.0-beta.38"
37
36
  };
@@ -1 +1 @@
1
- {"name":"koa-compose","description":"compose Koa middleware","repository":"koajs/compose","version":"4.1.0","keywords":["koa","middleware","compose"],"files":["index.js"],"dependencies":{},"devDependencies":{"codecov":"^3.0.0","jest":"^21.0.0","matcha":"^0.7.0","standard":"^10.0.3"},"scripts":{"bench":"matcha bench/bench.js","lint":"standard --fix .","test":"jest --forceExit --coverage"},"jest":{"testEnvironment":"node"},"license":"MIT","_lastModified":"2026-05-21T16:56:26.080Z"}
1
+ {"name":"koa-compose","description":"compose Koa middleware","repository":"koajs/compose","version":"4.1.0","keywords":["koa","middleware","compose"],"files":["index.js"],"dependencies":{},"devDependencies":{"codecov":"^3.0.0","jest":"^21.0.0","matcha":"^0.7.0","standard":"^10.0.3"},"scripts":{"bench":"matcha bench/bench.js","lint":"standard --fix .","test":"jest --forceExit --coverage"},"jest":{"testEnvironment":"node"},"license":"MIT","_lastModified":"2026-05-29T02:54:21.469Z"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-data-visualization",
3
- "version": "2.1.0-beta.36",
3
+ "version": "2.1.0-beta.38",
4
4
  "displayName": "Data visualization",
5
5
  "displayName.ru-RU": "Визуализация данных",
6
6
  "displayName.zh-CN": "数据可视化",
@@ -49,7 +49,7 @@
49
49
  "@nocobase/test": "2.x",
50
50
  "@nocobase/utils": "2.x"
51
51
  },
52
- "gitHead": "397d45c744f6eb48b3a0cd785c87cbf1257c3513",
52
+ "gitHead": "d1c585108ff6e51c17b0b52bacb1a2d621d9c119",
53
53
  "keywords": [
54
54
  "Blocks"
55
55
  ],
@@ -1,22 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import React from 'react';
10
- import { CompletionSource } from '@codemirror/autocomplete';
11
- export interface CodeEditorProps {
12
- language?: string;
13
- value?: string;
14
- onChange?: (value: string) => void;
15
- completions?: CompletionSource | CompletionSource[];
16
- rightExtra?: React.ReactNode;
17
- }
18
- export type CodeEditorHandle = {
19
- insertAtCursor: (text: string) => void;
20
- focus: () => void;
21
- };
22
- export declare const CodeEditor: React.ForwardRefExoticComponent<CodeEditorProps & React.RefAttributes<CodeEditorHandle>>;
@@ -1,14 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import React from 'react';
10
- import type { FlowSettingsContext } from '@nocobase/flow-engine';
11
- export declare const DaraButton: React.FC<{
12
- ctx: FlowSettingsContext<any>;
13
- }>;
14
- export default DaraButton;
@@ -1,17 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import React from 'react';
10
- import { EChartsOption, EChartsType } from 'echarts';
11
- export interface ChartOptions {
12
- option: EChartsOption;
13
- dataSource: any;
14
- onRefReady?: (chart: EChartsType) => void;
15
- loading?: boolean;
16
- }
17
- export declare const Chart: React.ForwardRefExoticComponent<ChartOptions & React.RefAttributes<EChartsType>>;
@@ -1,65 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import { ChildPageModel, DataBlockModel } from '@nocobase/client';
10
- import { SQLResource } from '@nocobase/flow-engine';
11
- import React from 'react';
12
- import { ChartOptions } from './Chart';
13
- import { ChartResource } from '../resources/ChartResource';
14
- type ChartBlockModelStructure = {
15
- subModels: {
16
- page: ChildPageModel;
17
- };
18
- };
19
- type ChartProps = {
20
- chart: ChartOptions & {
21
- optionRaw?: string;
22
- };
23
- };
24
- export declare class ChartBlockModel extends DataBlockModel<ChartBlockModelStructure> {
25
- props: ChartProps;
26
- _previousStepParams: any;
27
- get resource(): ChartResource<any> | SQLResource<any>;
28
- private __onResourceRefresh;
29
- onActive(): void;
30
- refresh(): Promise<void>;
31
- initResource(mode?: string): void;
32
- getResourceSettingsInitParams(): any;
33
- buildQueryRequest(query: any): Promise<any>;
34
- onInit(options: any): Promise<void>;
35
- renderComponent(): React.JSX.Element;
36
- getFilterFields(): Promise<{
37
- name: string;
38
- title: string;
39
- type: string;
40
- interface: string;
41
- target?: string;
42
- filterable?: {
43
- operators: {
44
- label: string;
45
- value: string;
46
- }[];
47
- };
48
- }[]>;
49
- checkResource(query: any): void;
50
- applyQuery(query: any): void;
51
- setDataResult(): void;
52
- applyChartOptions(payload: {
53
- mode: 'basic' | 'custom';
54
- builder?: any;
55
- raw?: string;
56
- }): Promise<void>;
57
- applyEvents(raw?: string): Promise<void>;
58
- renderChart(): void;
59
- onPreview(params: {
60
- query: any;
61
- chart: any;
62
- }, needQueryData?: boolean): Promise<void>;
63
- cancelPreview(): Promise<void>;
64
- }
65
- export {};
@@ -1,18 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import React from 'react';
10
- export declare const ChartOptionsBuilder: React.FC<{
11
- columns?: string[];
12
- fieldOptions?: {
13
- label: string;
14
- value: string;
15
- }[];
16
- initialValues: any;
17
- onChange: (next: any) => void;
18
- }>;
@@ -1,58 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- export type ChartTypeKey = 'line' | 'bar' | 'barHorizontal' | 'pie' | 'doughnut' | 'scatter' | 'area' | 'funnel';
10
- export declare function getChartFormSpec(type: ChartTypeKey): ({
11
- kind: string;
12
- name: any;
13
- labelKey: any;
14
- options: any;
15
- required?: undefined;
16
- allowClear?: undefined;
17
- placeholderKey?: undefined;
18
- min?: undefined;
19
- max?: undefined;
20
- } | {
21
- kind: string;
22
- name: any;
23
- labelKey: any;
24
- required: boolean;
25
- allowClear: boolean;
26
- placeholderKey: string;
27
- options?: undefined;
28
- min?: undefined;
29
- max?: undefined;
30
- } | {
31
- kind: string;
32
- name: any;
33
- labelKey: any;
34
- options?: undefined;
35
- required?: undefined;
36
- allowClear?: undefined;
37
- placeholderKey?: undefined;
38
- min?: undefined;
39
- max?: undefined;
40
- } | {
41
- kind: string;
42
- name: any;
43
- labelKey: any;
44
- min: any;
45
- max: any;
46
- options?: undefined;
47
- required?: undefined;
48
- allowClear?: undefined;
49
- placeholderKey?: undefined;
50
- })[];
51
- export declare function buildFieldOptions(columns?: string[]): {
52
- label: string;
53
- value: string;
54
- }[];
55
- export declare function stripInvalidColumns(builder?: {}, columns?: string[]): any;
56
- export declare function normalizeBuilder(builder: any, columns?: string[]): any;
57
- export declare function applyTypeChange(builder: {}, nextType: ChartTypeKey, columns?: string[]): any;
58
- export declare function genRawByBuilder(builder: any): string;
@@ -1,16 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import React from 'react';
10
- export declare const ChartOptionsEditor: React.FC<{
11
- value?: string;
12
- onChange?: (next: string) => void;
13
- disabled?: boolean;
14
- style?: React.CSSProperties;
15
- className?: string;
16
- }>;
@@ -1,11 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import React from 'react';
10
- export declare const chartOptionDefaultValue = "return {\n dataset: { source: ctx.data.objects || [] },\n xAxis: { type: 'category' },\n yAxis: {},\n series: [\n {\n type: 'line',\n smooth: true,\n showSymbol: false,\n },\n ],\n}\n";
11
- export declare const ChartOptionsPanel: React.FC;
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import React from 'react';
10
- export declare const ConfigPanel: React.FC;
@@ -1,20 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import React from 'react';
10
- import * as echarts from 'echarts';
11
- import type { EChartsType, EChartsOption } from 'echarts';
12
- interface Props {
13
- option: EChartsOption;
14
- style?: React.CSSProperties;
15
- className?: string;
16
- theme?: string;
17
- onRefReady?: (chart: EChartsType) => void;
18
- }
19
- declare const ECharts: React.ForwardRefExoticComponent<Props & React.RefAttributes<echarts.ECharts>>;
20
- export default ECharts;
@@ -1,11 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- /// <reference types="react" />
10
- declare const EventsEditor: import("react").ForwardRefExoticComponent<Omit<Partial<import("../components/CodeEditor").CodeEditorProps & import("react").RefAttributes<import("../components/CodeEditor").CodeEditorHandle>>, "ref"> & import("react").RefAttributes<unknown>>;
11
- export default EventsEditor;
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import React from 'react';
10
- export declare const EventsPanel: React.FC;
@@ -1,13 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import React from 'react';
10
- export type QueryBuilderRef = {
11
- validate: () => Promise<any>;
12
- };
13
- export declare const QueryBuilder: React.ForwardRefExoticComponent<React.RefAttributes<QueryBuilderRef>>;
@@ -1,20 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- export declare function getFieldOptions(dm: any, compile: (v: any) => string, collectionPath?: string[]): any;
10
- export declare function aliasOf(val: any): string;
11
- export declare function buildOrderFieldOptions(fieldOptions?: any[], dimensionsValue?: any[], measuresValue?: any[]): any[];
12
- export declare function getFormatterOptionsByField(dm: any, collectionPath: string[] | undefined, dimField: any): {
13
- label: string;
14
- value: string;
15
- }[];
16
- export declare function getCollectionOptions(dm: any, compile: (v: any) => string): any;
17
- export declare function validateQuery(query: Record<string, any>): {
18
- success: boolean;
19
- message: string;
20
- };
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import React from 'react';
10
- export declare const QueryPanel: React.FC;
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import React from 'react';
10
- export declare const ResultPanel: React.FC;
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import React from 'react';
10
- export declare const SQLEditor: React.ForwardRefExoticComponent<Omit<Partial<any>, "ref"> & React.RefAttributes<unknown>>;
@@ -1,20 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- interface ConfigState {
10
- results: {
11
- [uid: string]: {
12
- result: any;
13
- error?: string;
14
- };
15
- };
16
- setResult: (uid: string, result: any) => void;
17
- setError?: (uid: string, error: string) => void;
18
- }
19
- export declare const configStore: ConfigState;
20
- export {};