@nocobase/plugin-custom-variables 2.1.0-alpha.12 → 2.1.0-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.js +1 -1
- package/dist/externalVersion.js +5 -5
- package/package.json +2 -2
package/dist/client/index.js
CHANGED
|
@@ -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("react"),require("antd"),require("@nocobase/client"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/utils/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-custom-variables",["react-i18next","react","antd","@nocobase/client","@formily/react","@ant-design/icons","@nocobase/utils/client"],t):"object"==typeof exports?exports["@nocobase/plugin-custom-variables"]=t(require("react-i18next"),require("react"),require("antd"),require("@nocobase/client"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/utils/client")):e["@nocobase/plugin-custom-variables"]=t(e["react-i18next"],e.react,e.antd,e["@nocobase/client"],e["@formily/react"],e["@ant-design/icons"],e["@nocobase/utils/client"])}(self,function(e,t,n,r,o,a,i){return function(){"use strict";var l={375:function(e){e.exports=a},230:function(e){e.exports=o},342:function(e){e.exports=r},768:function(e){e.exports=i},59:function(e){e.exports=n},155:function(e){e.exports=t},953:function(t){t.exports=e}},c={};function u(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={exports:{}};return l[e](n,n.exports,u),n.exports}u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,{a:t}),t},u.d=function(e,t){for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},u.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.g.importScripts&&(s=u.g.location+"");var s,p=u.g.document;if(!s&&p&&(p.currentScript&&"SCRIPT"===p.currentScript.tagName.toUpperCase()&&(s=p.currentScript.src),!s)){var f=p.getElementsByTagName("script");if(f.length)for(var b=f.length-1;b>-1&&(!s||!/^http(s?):/.test(s));)s=f[b--].src}if(!s)throw Error("Automatic publicPath is not supported in this browser");u.p=s.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var d={},m=window.__nocobase_public_path__||"";if(!m&&window.location&&window.location.pathname){var v=window.location.pathname||"/",y=v.indexOf("/v2/");m=y>=0?v.slice(0,y+1):"/"}return m&&(m=m.replace(/\/v2\/?$/,"/")),m||(m="/"),"/"!==m.charAt(m.length-1)&&(m+="/"),u.p=m+"static/plugins/@nocobase/plugin-custom-variables/dist/client/",!function(){u.r(d),u.d(d,{default:function(){return ee}});var e=u(342),t=u(768),n=u(155),r=u.n(n),o=(0,n.createContext)({onSuccess:function(){}}),a=function(t){var n=(0,e.useToken)().token,a=(0,e.useSchemaInitializerRender)("customVariables:addVariable").render;return r().createElement(o.Provider,{value:{onSuccess:t.onSuccess||function(){}}},a({style:{borderRadius:n.borderRadius}}))},i=u(953),l="custom-variables";function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function s(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}var p=function(t){var n=(0,e.useVariableOptions)({});return r().createElement(e.Variable.TextArea,s(c({},t),{scope:n}))},f=function(){var t,o=(0,i.useTranslation)(l).t,a=(0,e.useCurrentRoute)(),u=(0,e.useNocoBaseRoutes)().updateRoute,f=(0,n.useMemo)(function(){return{type:"object",title:o("Edit badge"),properties:{count:{title:o("Badge"),"x-decorator":"FormItem","x-decorator-props":{tooltip:o("You can enter numbers, text, variables, aggregation variables, expressions, etc.")},"x-component":p,description:r().createElement("span",null,o("Syntax references: "),r().createElement("a",{href:"https://docs.nocobase.com/handbook/calculation-engines/formula",target:"_blank",rel:"noreferrer"},"Formula.js"))},color:{title:o("Background color"),"x-decorator":"FormItem","x-component":"ColorPicker","x-component-props":{}},textColor:{title:o("Text color"),"x-decorator":"FormItem","x-component":"ColorPicker","x-component-props":{}},size:{title:o("Size"),"x-decorator":"FormItem","x-component":"Select",enum:[{label:o("Default"),value:"default"},{label:o("Small"),value:"small"}],default:"default"},overflowCount:{title:o("Max number"),"x-decorator":"FormItem","x-decorator-props":{tooltip:o("Maximum number to display when the badge is a number")},"x-component":"InputNumber",default:99},showZero:{title:o("Show zero"),"x-decorator":"FormItem","x-decorator-props":{tooltip:o("Whether to show the badge when it is a number and the number is 0")},"x-component":"Checkbox",default:!1}}}},[o]),b=(0,n.useMemo)(function(){var e;return null==(e=a.options)?void 0:e.badge},[null==(t=a.options)?void 0:t.badge]),d=(0,n.useCallback)(function(e){if(void 0!==a.id){var t;u(a.id,{options:s(c({},a.options),{badge:s(c({},null==(t=a.options)?void 0:t.badge,e),{count:null==e.count||""===e.count?void 0:e.count})})})}},[a.id,a.options,u]);return r().createElement(e.SchemaSettingsModalItem,{title:o("Edit badge"),eventKey:"edit-badge",schema:f,initialValues:b,onSubmit:d})},b=u(59),m=u(375),v=u(230);function y(){var e,t,n=(e=["\n margin-bottom: 1.5em;\n padding: 1em;\n background-color: ",";\n\n > *:last-child {\n margin-bottom: 0;\n }\n\n dl {\n display: flex;\n align-items: baseline;\n\n dt {\n color: ",";\n &:after {\n content: ':';\n margin-right: 0.5em;\n }\n }\n }\n\n p {\n color: ",";\n }\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return y=function(){return n},n}var h=(0,e.createStyles)(function(e){var t=e.css,n=e.token;return{container:t(y(),n.colorFillAlter,n.colorText,n.colorTextDescription)}});function g(t){var n=t.label,o=t.title,a=t.icon,i=t.description,l=h().styles;return r().createElement("div",{className:(0,e.cx)(l.container,t.className)},r().createElement("dl",null,r().createElement("dt",null,n),r().createElement("dd",null,r().createElement(b.Tag,{icon:a,style:{background:"none"}},o))),i?r().createElement("p",null,i):null)}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function O(e,t,n,r,o,a,i){try{var l=e[a](i),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function w(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){O(a,r,o,i,l,"next",e)}function l(e){O(a,r,o,i,l,"throw",e)}i(void 0)})}}function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j(e,t){if(null==e)return{};var n,r,o,a={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}if(a=function(e,t){if(null==e)return{};var n,r,o={},a=Object.getOwnPropertyNames(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}function E(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x(e,t)}}(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,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:c(0)}),l(i,"throw",{value:c(1)}),l(i,"return",{value:c(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function P(){var e,t,n=(e=["\n position: relative;\n width: 100%;\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return P=function(){return n},n}function I(t){var n=t.value,o=t.onChange,a=t.renderSchemaComponent;return r().createElement(e.VariableInput,{value:n,onChange:o,renderSchemaComponent:a})}function A(){return!0}function k(){return document.body}var T=(0,v.observer)(function(t){var n,o,a=t.filter,i=j(t,["filter"]),l=(0,e.useCompile)(),c=(0,e.useCollectionManager_deprecated)().getCollectionFields,u=(0,v.useForm)().values,s=E((0,e.parseCollectionName)(null==u?void 0:u.collection),2),p=s[0],f=c(s[1],p);return r().createElement(b.Select,(n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){S(e,t,n[t])})}return e}({popupMatchSelectWidth:!1},i),o=o={options:f.filter(void 0===a?A:a).map(function(e){var t;return{label:l(null==(t=e.uiSchema)?void 0:t.title),value:e.name}})},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n))},{displayName:"FieldsSelect"}),V=function(n,a){var i;return{type:"object",properties:S({},a,{"x-decorator":"Form","x-component":"Action.Drawer","x-component-props":{zIndex:9999,getContainer:k},type:"void",title:{create:'{{t("Add aggregate variable", { ns: "'.concat(l,'" })}}'),update:'{{t("Edit aggregate variable", { ns: "'.concat(l,'" })}}')}[a],properties:{description:{type:"void","x-component":g,"x-component-props":{label:'{{t("Variable type", { ns: "'.concat(l,'" })}}'),title:'{{t("Aggregate", { ns: "'.concat(l,'" })}}'),icon:r().createElement(m.BarChartOutlined,null),description:'{{t("Create an aggregate variable that performs statistical calculations (COUNT, SUM, AVG, MIN, MAX) on data from a specific collection. You can apply filters to narrow down the data scope and optionally use distinct values for counting operations.", { ns: "'.concat(l,'" })}}')}},variableTitle:{type:"string",title:'{{t("Variable name", { ns: "'.concat(l,'" })}}'),"x-decorator":"FormItem","x-component":"Input",required:!0,default:null==n?void 0:n.label},aggregator:{type:"string",title:'{{t("Aggregator function", { ns: "'.concat(l,'" })}}'),"x-decorator":"FormItem","x-component":"Radio.Group",enum:[{label:"COUNT",value:"count"},{label:"SUM",value:"sum"},{label:"AVG",value:"avg"},{label:"MIN",value:"min"},{label:"MAX",value:"max"}],required:!0,default:(null==n?void 0:n.options.aggregator)||"count"},collectionField:{type:"void","x-decorator":"SchemaComponentContext.Provider","x-decorator-props":{value:{designable:!1}},"x-component":"Grid",properties:{row:{type:"void","x-component":"Grid.Row",properties:{target:{type:"void","x-component":"Grid.Col",properties:{collection:{type:"string",required:!0,"x-decorator":"FormItem","x-component":"DataSourceCollectionCascader","x-component-props":{dataSourceFilter:function(e){return"main"===e.key||e.options.isDBInstance}},title:'{{t("Data of collection", { ns: "'.concat(l,'" })}}'),"x-reactions":[{target:"params.field",effects:["onFieldValueChange"],fulfill:{state:{value:null}}},{target:"params.filter",effects:["onFieldValueChange"],fulfill:{state:{value:null}}}],default:null==n?void 0:n.options.collection}}},field:{type:"void","x-component":"Grid.Col",properties:{"params.field":{type:"string",title:'{{t("Field to aggregate", { ns: "'.concat(l,'" })}}'),"x-decorator":"FormItem","x-component":T,"x-component-props":{filter:function(e){return!e.hidden&&e.interface&&!["belongsTo","hasOne","hasMany","belongsToMany"].includes(e.type)}},required:!0,"x-reactions":[{dependencies:["collection"],fulfill:{state:{visible:"{{!!$deps[0]}}"}}}],default:null==n?void 0:n.options.params.field}}}}}}},params:{type:"object",properties:{distinct:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Distinct", { ns: "'.concat(l,'" })}}'),"x-reactions":[{dependencies:["collection","aggregator"],fulfill:{state:{visible:'{{!!$deps[0] && ["count"].includes($deps[1])}}'}}}],default:null==n?void 0:n.options.params.distinct},filter:{type:"object",title:'{{t("Filter")}}',"x-decorator":"FormItem","x-component":"Filter","x-use-component-props":function(){var t=(0,v.useForm)().values,n=E((0,e.parseCollectionName)(null==t?void 0:t.collection),2),r=n[0],o=n[1];return{options:(0,e.useCollectionFilterOptions)(o,r),className:(0,e.css)(P())}},"x-component-props":{dynamicComponent:I},"x-reactions":[{dependencies:["collection"],fulfill:{state:{visible:"{{!!$deps[0]}}"}}}],default:null==n?void 0:n.options.params.filter}}},precision:{type:"number",title:'{{t("Result precision", { ns: "'.concat(l,'" })}}'),description:'{{t("Number of decimal places for query result.", { ns: "'.concat(l,'" })}}'),"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{min:0,max:14,step:1,precision:0},default:null!=(i=null==n?void 0:n.options.precision)?i:2},footer:{"x-component":"Action.Drawer.Footer",type:"void",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:function(){var t=(0,e.useActionContext)().setVisible,n=(0,v.useForm)();return{run:function(){return w(function(){return C(this,function(e){switch(e.label){case 0:return t(!1),[4,n.reset()];case 1:return e.sent(),[2]}})})()}}}}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:function(){var i=(0,e.useActionContext)().setVisible,l=(0,v.useForm)(),c=(0,e.useVariableScopeInfo)().getVariableScopeInfo,u=(0,e.useAPIClient)(),s=r().useContext(o).onSuccess;return{run:function(){return w(function(){var e,r,o,p;return C(this,function(f){switch(f.label){case 0:return[4,l.submit()];case 1:if(f.sent(),r=(e=l.values).variableTitle,o=j(e,["variableTitle"]),!(p=c()).scopeId)throw Error("Scope info not found");if("update"!==a)return[3,3];return[4,u.request({url:"customVariables:update",method:"POST",params:{filterByTk:n.name},data:{label:r,options:o}})];case 2:f.sent(),f.label=3;case 3:if("create"!==a)return[3,5];return[4,u.request({url:"customVariables:create",method:"POST",data:{name:(0,t.uid)(),label:r,declaredAt:p.scopeId,type:"aggregate",options:o}})];case 4:f.sent(),f.label=5;case 5:return[4,l.reset()];case 6:return f.sent(),i(!1),null==s||s(),[2]}})})()}}}}}}}}})}},F=new e.SchemaInitializer({name:"customVariables:addVariable",title:'{{t("Add variable", { ns: "'.concat(l,'" })}}'),icon:"PlusOutlined",items:[{name:"aggregateVariable",title:'{{t("Aggregate variable", { ns: "'.concat(l,'" })}}'),Component:function(){var t=E(r().useState(!1),2),n=t[0],o=t[1],a=(0,i.useTranslation)(l).t;return r().createElement(r().Fragment,null,r().createElement(e.SchemaInitializerItem,{title:a("Aggregate variable"),onClick:function(){o(!0)}}),r().createElement(e.ActionContextProvider,{value:{visible:n,setVisible:o}},r().createElement(e.SchemaComponentContext.Provider,{value:{designable:!1}},r().createElement(e.SchemaComponent,{schema:V(void 0,"create")}))))}}]}),M=function(t){var n=t.visible,o=t.setVisible,a=t.initialValues;return r().createElement(e.ActionContextProvider,{value:{visible:n,setVisible:o}},r().createElement(e.SchemaComponentContext.Provider,{value:{designable:!1}},r().createElement(e.SchemaComponent,{schema:V(a,"update")})))};function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _(e,t,n,r,o,a,i){try{var l=e[a](i),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function D(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){_(a,r,o,i,l,"next",e)}function l(e){_(a,r,o,i,l,"throw",e)}i(void 0)})}}function N(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return q(e,t)}}(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 R(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:c(0)}),l(i,"throw",{value:c(1)}),l(i,"return",{value:c(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var $=function(t){var o=N((0,n.useState)(!1),2),a=o[0],c=o[1],u=(0,i.useTranslation)(l).t,s=(0,e.useToken)().token,p=(0,n.useRef)(a);return(0,n.useEffect)(function(){!a&&p.current&&t.refresh(),p.current=a},[a,t.refresh]),r().createElement(r().Fragment,null,r().createElement("div",{onClick:function(e){c(!0)}},r().createElement(m.EditOutlined,null),r().createElement("span",{style:{marginLeft:s.marginXS}},u("Edit"))),r().createElement(M,{visible:a,setVisible:c,initialValues:t.variable}))},B=function(t){var n=(0,e.useAPIClient)(),o=(0,i.useTranslation)(l).t,a=[{key:"edit",label:r().createElement($,{variable:t.variable,refresh:t.refresh})},{key:"delete",label:o("Delete"),icon:r().createElement(m.DeleteOutlined,null),onClick:function(e){return e.domEvent,D(function(){return R(this,function(e){return b.Modal.confirm({title:o("Delete Variable"),content:o('Are you sure you want to delete "{{label}}" variable?',{label:t.variable.label}),okText:o("Yes"),cancelText:o("No"),onOk:function(){return D(function(){return R(this,function(e){switch(e.label){case 0:return[4,n.request({url:"customVariables:destroy",method:"POST",params:{filterByTk:t.variable.name}})];case 1:return e.sent(),t.refresh(),[2]}})})()}}),[2]})})()}}];return r().createElement("div",{style:{paddingLeft:"8px",cursor:"pointer",opacity:+!t.hidden},onClick:function(e){e.stopPropagation()}},r().createElement(b.Dropdown,{menu:{items:a}},r().createElement(m.EllipsisOutlined,null)))},z=function(t){var o=N((0,n.useState)(!1),2),a=o[0],i=o[1];return(0,e.useFlag)().isInXButton?r().createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},onMouseEnter:function(){return i(!0)},onMouseLeave:function(){return i(!1)}},r().createElement("span",null,t.value),r().createElement(B,{variable:t.variable,hidden:!a,refresh:t.refresh})):r().createElement(r().Fragment,null,t.value)},G=function(){var t=N((0,n.useState)([]),2),o=t[0],a=t[1],i=(0,e.useAPIClient)(),l=(0,e.useVariableScopeInfo)().getVariableScopeInfo,c=N((0,n.useState)(!1),2),u=c[0],s=c[1],p=(0,n.useCallback)(function(){var e=l().scopeId;e&&(s(!0),i.request({url:"customVariables:list",method:"GET",skipNotify:!0,skipAuth:!0,params:{filter:{declaredAt:e}}}).then(function(e){a(e.data.data.map(function(e){return{label:r().createElement(z,{value:e.label,variable:e,refresh:p}),value:e.name}})),s(!1)}).catch(function(e){console.error("Error fetching custom variables:",e),a([]),s(!1)}))},[l]);return(0,n.useEffect)(function(){p()},[p]),{options:o,loading:u,refresh:p}};function U(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function L(e,t,n,r,o,a,i){try{var l=e[a](i),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function W(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){L(a,r,o,i,l,"next",e)}function l(e){L(a,r,o,i,l,"throw",e)}i(void 0)})}}function X(e,t,n){return(X=J()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&Y(o,n.prototype),o}).apply(null,arguments)}function K(e){return(K=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Y(e,t){return(Y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Z(e,t){if(e){if("string"==typeof e)return U(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return U(e,t)}}function H(e){var t="function"==typeof Map?new Map:void 0;return(H=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,n)}function n(){return X(e,arguments,K(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Y(n,e)})(e)}function J(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(J=function(){return!!e})()}function Q(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:c(0)}),l(i,"throw",{value:c(1)}),l(i,"return",{value:c(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var ee=function(o){var c;if("function"!=typeof o&&null!==o)throw TypeError("Super expression must either be null or a function");function u(){var e,t;if(!(this instanceof u))throw TypeError("Cannot call a class as a function");return e=u,t=arguments,e=K(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,J()?Reflect.construct(e,t||[],K(this).constructor):e.apply(this,t))}return u.prototype=Object.create(o&&o.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),o&&Y(u,o),c=[{key:"load",value:function(){return W(function(){var o;return Q(this,function(c){return o=this,this.app.schemaInitializerManager.add(F),this.app.schemaSettingsManager.addItem("menuSettings:menuItem","badge",{Component:f,sort:401}),this.app.schemaSettingsManager.addItem("PageTabSettings","badge",{Component:f,sort:201}),this.app.apiClient.axios.interceptors.response.use(function(e){var t=e.config.url.split("?")[0];return o.app.eventBus.dispatchEvent(new CustomEvent("collection:".concat(t))),e}),this.app.registerVariable({name:"$customVariables",useOption:function(){var e=G(),t=e.options,o=e.refresh,c=e.loading,u=(0,i.useTranslation)(l).t,s=(0,n.useMemo)(function(){return{label:u("Custom Variables"),value:"$customVariables",children:((function(e){if(Array.isArray(e))return U(e)})(t)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||Z(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([{label:r().createElement(a,{onSuccess:o}),disabled:!0,value:"none"}])}},[t,o]);return(0,n.useMemo)(function(){return{option:s,visible:!c}},[s,c])},useCtx:function(){var o,a=(0,e.useAPIClient)(),i=(0,e.useApp)(),l=(0,e.useLocalVariablesWithoutCustomVariable)(),c=(0,e.useVariables)(),u=function(e){if(Array.isArray(e))return e}(o=r().useState(0))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(o.push(t.value),2!==o.length);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw n}}return o}}(o)||Z(o,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),s=u[0],p=u[1],f=r().useRef(new Set),b=(0,n.useCallback)(function(){p(function(e){return e+1})},[]),d=(0,n.useCallback)(function(n){return W(function(){var r,o;return Q(this,function(a){switch(a.label){case 0:return r={},(0,t.flatten)(n,{breakOn:function(e){var t=e.key;return t.startsWith("$")&&"$and"!==t&&"$or"!==t},transformValue:function(t){if(!(0,e.isVariable)(t))return t;var n=null==c?void 0:c.parseVariable(t,l).then(function(e){return e.value});return r[t]=n,n}}),[4,Promise.all((o=Object.keys(r)).map(function(e){return r[e]}))];case 1:return a.sent().forEach(function(e,t){r[o[t]]=e}),[2,r]}})})()},[l,null==c?void 0:c.parseVariable]);return(0,n.useEffect)(function(){return function(){f.current.forEach(function(e){i.eventBus.removeEventListener(e,b)})}},[]),(0,n.useMemo)(function(){return function(e){var t=e.variableName;return W(function(){var e,n,r,o,l,c,u;return Q(this,function(s){switch(s.label){case 0:return n=t.replace("$customVariables.",""),[4,a.request({url:"customVariables:get?filter[name]=".concat(n),method:"GET"})];case 1:if(!(null==(r=s.sent())||null==(e=r.data)?void 0:e.data))throw Error('Custom variable "'.concat(n,'" not found. It may have been deleted.'));return[4,d((o=r.data.data).options.params.filter)];case 2:return l=s.sent(),c=["collection:".concat(o.options.collection,":create"),"collection:".concat(o.options.collection,":update"),"collection:".concat(o.options.collection,":destroy")],f.current.forEach(function(e){i.eventBus.removeEventListener(e,b)}),c.forEach(function(e){f.current.add(e),i.eventBus.addEventListener(e,b)}),[4,a.request({url:"customVariables:parse?name=".concat(n),method:"POST",data:{filterCtx:l}})];case 3:return[2,null==(u=s.sent().data)?void 0:u.data]}})})()}},[s])}}),[2]})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(u.prototype,c),u}(H(e.Plugin))}(),d}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("react"),require("antd"),require("@nocobase/client"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/utils/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-custom-variables",["react-i18next","react","antd","@nocobase/client","@formily/react","@ant-design/icons","@nocobase/utils/client"],t):"object"==typeof exports?exports["@nocobase/plugin-custom-variables"]=t(require("react-i18next"),require("react"),require("antd"),require("@nocobase/client"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/utils/client")):e["@nocobase/plugin-custom-variables"]=t(e["react-i18next"],e.react,e.antd,e["@nocobase/client"],e["@formily/react"],e["@ant-design/icons"],e["@nocobase/utils/client"])}(self,function(e,t,n,r,o,a,i){return function(){"use strict";var l={375:function(e){e.exports=a},230:function(e){e.exports=o},342:function(e){e.exports=r},768:function(e){e.exports=i},59:function(e){e.exports=n},155:function(e){e.exports=t},953:function(t){t.exports=e}},c={};function u(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={exports:{}};return l[e](n,n.exports,u),n.exports}u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,{a:t}),t},u.d=function(e,t){for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},u.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.g.importScripts&&(s=u.g.location+"");var s,p=u.g.document;if(!s&&p&&(p.currentScript&&"SCRIPT"===p.currentScript.tagName.toUpperCase()&&(s=p.currentScript.src),!s)){var f=p.getElementsByTagName("script");if(f.length)for(var b=f.length-1;b>-1&&(!s||!/^http(s?):/.test(s));)s=f[b--].src}if(!s)throw Error("Automatic publicPath is not supported in this browser");u.p=s.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var d={};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 n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/@nocobase/plugin-custom-variables/dist/client/")}if(!e){if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var r=window.location.pathname||"/",o=r.indexOf("/v2/");e=o>=0?r.slice(0,o+1):"/"}e&&(e=e.replace(/\/v2\/?$/,"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-custom-variables/dist/client/"}u.p=e}(),!function(){u.r(d),u.d(d,{default:function(){return ee}});var e=u(342),t=u(768),n=u(155),r=u.n(n),o=(0,n.createContext)({onSuccess:function(){}}),a=function(t){var n=(0,e.useToken)().token,a=(0,e.useSchemaInitializerRender)("customVariables:addVariable").render;return r().createElement(o.Provider,{value:{onSuccess:t.onSuccess||function(){}}},a({style:{borderRadius:n.borderRadius}}))},i=u(953),l="custom-variables";function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function s(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}var p=function(t){var n=(0,e.useVariableOptions)({});return r().createElement(e.Variable.TextArea,s(c({},t),{scope:n}))},f=function(){var t,o=(0,i.useTranslation)(l).t,a=(0,e.useCurrentRoute)(),u=(0,e.useNocoBaseRoutes)().updateRoute,f=(0,n.useMemo)(function(){return{type:"object",title:o("Edit badge"),properties:{count:{title:o("Badge"),"x-decorator":"FormItem","x-decorator-props":{tooltip:o("You can enter numbers, text, variables, aggregation variables, expressions, etc.")},"x-component":p,description:r().createElement("span",null,o("Syntax references: "),r().createElement("a",{href:"https://docs.nocobase.com/handbook/calculation-engines/formula",target:"_blank",rel:"noreferrer"},"Formula.js"))},color:{title:o("Background color"),"x-decorator":"FormItem","x-component":"ColorPicker","x-component-props":{}},textColor:{title:o("Text color"),"x-decorator":"FormItem","x-component":"ColorPicker","x-component-props":{}},size:{title:o("Size"),"x-decorator":"FormItem","x-component":"Select",enum:[{label:o("Default"),value:"default"},{label:o("Small"),value:"small"}],default:"default"},overflowCount:{title:o("Max number"),"x-decorator":"FormItem","x-decorator-props":{tooltip:o("Maximum number to display when the badge is a number")},"x-component":"InputNumber",default:99},showZero:{title:o("Show zero"),"x-decorator":"FormItem","x-decorator-props":{tooltip:o("Whether to show the badge when it is a number and the number is 0")},"x-component":"Checkbox",default:!1}}}},[o]),b=(0,n.useMemo)(function(){var e;return null==(e=a.options)?void 0:e.badge},[null==(t=a.options)?void 0:t.badge]),d=(0,n.useCallback)(function(e){if(void 0!==a.id){var t;u(a.id,{options:s(c({},a.options),{badge:s(c({},null==(t=a.options)?void 0:t.badge,e),{count:null==e.count||""===e.count?void 0:e.count})})})}},[a.id,a.options,u]);return r().createElement(e.SchemaSettingsModalItem,{title:o("Edit badge"),eventKey:"edit-badge",schema:f,initialValues:b,onSubmit:d})},b=u(59),m=u(375),v=u(230);function y(){var e,t,n=(e=["\n margin-bottom: 1.5em;\n padding: 1em;\n background-color: ",";\n\n > *:last-child {\n margin-bottom: 0;\n }\n\n dl {\n display: flex;\n align-items: baseline;\n\n dt {\n color: ",";\n &:after {\n content: ':';\n margin-right: 0.5em;\n }\n }\n }\n\n p {\n color: ",";\n }\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return y=function(){return n},n}var h=(0,e.createStyles)(function(e){var t=e.css,n=e.token;return{container:t(y(),n.colorFillAlter,n.colorText,n.colorTextDescription)}});function g(t){var n=t.label,o=t.title,a=t.icon,i=t.description,l=h().styles;return r().createElement("div",{className:(0,e.cx)(l.container,t.className)},r().createElement("dl",null,r().createElement("dt",null,n),r().createElement("dd",null,r().createElement(b.Tag,{icon:a,style:{background:"none"}},o))),i?r().createElement("p",null,i):null)}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function O(e,t,n,r,o,a,i){try{var l=e[a](i),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function w(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){O(a,r,o,i,l,"next",e)}function l(e){O(a,r,o,i,l,"throw",e)}i(void 0)})}}function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j(e,t){if(null==e)return{};var n,r,o,a={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}if(a=function(e,t){if(null==e)return{};var n,r,o={},a=Object.getOwnPropertyNames(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}function E(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x(e,t)}}(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,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:c(0)}),l(i,"throw",{value:c(1)}),l(i,"return",{value:c(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function P(){var e,t,n=(e=["\n position: relative;\n width: 100%;\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return P=function(){return n},n}function I(t){var n=t.value,o=t.onChange,a=t.renderSchemaComponent;return r().createElement(e.VariableInput,{value:n,onChange:o,renderSchemaComponent:a})}function A(){return!0}function k(){return document.body}var T=(0,v.observer)(function(t){var n,o,a=t.filter,i=j(t,["filter"]),l=(0,e.useCompile)(),c=(0,e.useCollectionManager_deprecated)().getCollectionFields,u=(0,v.useForm)().values,s=E((0,e.parseCollectionName)(null==u?void 0:u.collection),2),p=s[0],f=c(s[1],p);return r().createElement(b.Select,(n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){S(e,t,n[t])})}return e}({popupMatchSelectWidth:!1},i),o=o={options:f.filter(void 0===a?A:a).map(function(e){var t;return{label:l(null==(t=e.uiSchema)?void 0:t.title),value:e.name}})},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n))},{displayName:"FieldsSelect"}),V=function(n,a){var i;return{type:"object",properties:S({},a,{"x-decorator":"Form","x-component":"Action.Drawer","x-component-props":{zIndex:9999,getContainer:k},type:"void",title:{create:'{{t("Add aggregate variable", { ns: "'.concat(l,'" })}}'),update:'{{t("Edit aggregate variable", { ns: "'.concat(l,'" })}}')}[a],properties:{description:{type:"void","x-component":g,"x-component-props":{label:'{{t("Variable type", { ns: "'.concat(l,'" })}}'),title:'{{t("Aggregate", { ns: "'.concat(l,'" })}}'),icon:r().createElement(m.BarChartOutlined,null),description:'{{t("Create an aggregate variable that performs statistical calculations (COUNT, SUM, AVG, MIN, MAX) on data from a specific collection. You can apply filters to narrow down the data scope and optionally use distinct values for counting operations.", { ns: "'.concat(l,'" })}}')}},variableTitle:{type:"string",title:'{{t("Variable name", { ns: "'.concat(l,'" })}}'),"x-decorator":"FormItem","x-component":"Input",required:!0,default:null==n?void 0:n.label},aggregator:{type:"string",title:'{{t("Aggregator function", { ns: "'.concat(l,'" })}}'),"x-decorator":"FormItem","x-component":"Radio.Group",enum:[{label:"COUNT",value:"count"},{label:"SUM",value:"sum"},{label:"AVG",value:"avg"},{label:"MIN",value:"min"},{label:"MAX",value:"max"}],required:!0,default:(null==n?void 0:n.options.aggregator)||"count"},collectionField:{type:"void","x-decorator":"SchemaComponentContext.Provider","x-decorator-props":{value:{designable:!1}},"x-component":"Grid",properties:{row:{type:"void","x-component":"Grid.Row",properties:{target:{type:"void","x-component":"Grid.Col",properties:{collection:{type:"string",required:!0,"x-decorator":"FormItem","x-component":"DataSourceCollectionCascader","x-component-props":{dataSourceFilter:function(e){return"main"===e.key||e.options.isDBInstance}},title:'{{t("Data of collection", { ns: "'.concat(l,'" })}}'),"x-reactions":[{target:"params.field",effects:["onFieldValueChange"],fulfill:{state:{value:null}}},{target:"params.filter",effects:["onFieldValueChange"],fulfill:{state:{value:null}}}],default:null==n?void 0:n.options.collection}}},field:{type:"void","x-component":"Grid.Col",properties:{"params.field":{type:"string",title:'{{t("Field to aggregate", { ns: "'.concat(l,'" })}}'),"x-decorator":"FormItem","x-component":T,"x-component-props":{filter:function(e){return!e.hidden&&e.interface&&!["belongsTo","hasOne","hasMany","belongsToMany"].includes(e.type)}},required:!0,"x-reactions":[{dependencies:["collection"],fulfill:{state:{visible:"{{!!$deps[0]}}"}}}],default:null==n?void 0:n.options.params.field}}}}}}},params:{type:"object",properties:{distinct:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Distinct", { ns: "'.concat(l,'" })}}'),"x-reactions":[{dependencies:["collection","aggregator"],fulfill:{state:{visible:'{{!!$deps[0] && ["count"].includes($deps[1])}}'}}}],default:null==n?void 0:n.options.params.distinct},filter:{type:"object",title:'{{t("Filter")}}',"x-decorator":"FormItem","x-component":"Filter","x-use-component-props":function(){var t=(0,v.useForm)().values,n=E((0,e.parseCollectionName)(null==t?void 0:t.collection),2),r=n[0],o=n[1];return{options:(0,e.useCollectionFilterOptions)(o,r),className:(0,e.css)(P())}},"x-component-props":{dynamicComponent:I},"x-reactions":[{dependencies:["collection"],fulfill:{state:{visible:"{{!!$deps[0]}}"}}}],default:null==n?void 0:n.options.params.filter}}},precision:{type:"number",title:'{{t("Result precision", { ns: "'.concat(l,'" })}}'),description:'{{t("Number of decimal places for query result.", { ns: "'.concat(l,'" })}}'),"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{min:0,max:14,step:1,precision:0},default:null!=(i=null==n?void 0:n.options.precision)?i:2},footer:{"x-component":"Action.Drawer.Footer",type:"void",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:function(){var t=(0,e.useActionContext)().setVisible,n=(0,v.useForm)();return{run:function(){return w(function(){return C(this,function(e){switch(e.label){case 0:return t(!1),[4,n.reset()];case 1:return e.sent(),[2]}})})()}}}}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:function(){var i=(0,e.useActionContext)().setVisible,l=(0,v.useForm)(),c=(0,e.useVariableScopeInfo)().getVariableScopeInfo,u=(0,e.useAPIClient)(),s=r().useContext(o).onSuccess;return{run:function(){return w(function(){var e,r,o,p;return C(this,function(f){switch(f.label){case 0:return[4,l.submit()];case 1:if(f.sent(),r=(e=l.values).variableTitle,o=j(e,["variableTitle"]),!(p=c()).scopeId)throw Error("Scope info not found");if("update"!==a)return[3,3];return[4,u.request({url:"customVariables:update",method:"POST",params:{filterByTk:n.name},data:{label:r,options:o}})];case 2:f.sent(),f.label=3;case 3:if("create"!==a)return[3,5];return[4,u.request({url:"customVariables:create",method:"POST",data:{name:(0,t.uid)(),label:r,declaredAt:p.scopeId,type:"aggregate",options:o}})];case 4:f.sent(),f.label=5;case 5:return[4,l.reset()];case 6:return f.sent(),i(!1),null==s||s(),[2]}})})()}}}}}}}}})}},F=new e.SchemaInitializer({name:"customVariables:addVariable",title:'{{t("Add variable", { ns: "'.concat(l,'" })}}'),icon:"PlusOutlined",items:[{name:"aggregateVariable",title:'{{t("Aggregate variable", { ns: "'.concat(l,'" })}}'),Component:function(){var t=E(r().useState(!1),2),n=t[0],o=t[1],a=(0,i.useTranslation)(l).t;return r().createElement(r().Fragment,null,r().createElement(e.SchemaInitializerItem,{title:a("Aggregate variable"),onClick:function(){o(!0)}}),r().createElement(e.ActionContextProvider,{value:{visible:n,setVisible:o}},r().createElement(e.SchemaComponentContext.Provider,{value:{designable:!1}},r().createElement(e.SchemaComponent,{schema:V(void 0,"create")}))))}}]}),M=function(t){var n=t.visible,o=t.setVisible,a=t.initialValues;return r().createElement(e.ActionContextProvider,{value:{visible:n,setVisible:o}},r().createElement(e.SchemaComponentContext.Provider,{value:{designable:!1}},r().createElement(e.SchemaComponent,{schema:V(a,"update")})))};function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function q(e,t,n,r,o,a,i){try{var l=e[a](i),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function D(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){q(a,r,o,i,l,"next",e)}function l(e){q(a,r,o,i,l,"throw",e)}i(void 0)})}}function N(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _(e,t)}}(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 $(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:c(0)}),l(i,"throw",{value:c(1)}),l(i,"return",{value:c(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var R=function(t){var o=N((0,n.useState)(!1),2),a=o[0],c=o[1],u=(0,i.useTranslation)(l).t,s=(0,e.useToken)().token,p=(0,n.useRef)(a);return(0,n.useEffect)(function(){!a&&p.current&&t.refresh(),p.current=a},[a,t.refresh]),r().createElement(r().Fragment,null,r().createElement("div",{onClick:function(e){c(!0)}},r().createElement(m.EditOutlined,null),r().createElement("span",{style:{marginLeft:s.marginXS}},u("Edit"))),r().createElement(M,{visible:a,setVisible:c,initialValues:t.variable}))},B=function(t){var n=(0,e.useAPIClient)(),o=(0,i.useTranslation)(l).t,a=[{key:"edit",label:r().createElement(R,{variable:t.variable,refresh:t.refresh})},{key:"delete",label:o("Delete"),icon:r().createElement(m.DeleteOutlined,null),onClick:function(e){return e.domEvent,D(function(){return $(this,function(e){return b.Modal.confirm({title:o("Delete Variable"),content:o('Are you sure you want to delete "{{label}}" variable?',{label:t.variable.label}),okText:o("Yes"),cancelText:o("No"),onOk:function(){return D(function(){return $(this,function(e){switch(e.label){case 0:return[4,n.request({url:"customVariables:destroy",method:"POST",params:{filterByTk:t.variable.name}})];case 1:return e.sent(),t.refresh(),[2]}})})()}}),[2]})})()}}];return r().createElement("div",{style:{paddingLeft:"8px",cursor:"pointer",opacity:+!t.hidden},onClick:function(e){e.stopPropagation()}},r().createElement(b.Dropdown,{menu:{items:a}},r().createElement(m.EllipsisOutlined,null)))},z=function(t){var o=N((0,n.useState)(!1),2),a=o[0],i=o[1];return(0,e.useFlag)().isInXButton?r().createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},onMouseEnter:function(){return i(!0)},onMouseLeave:function(){return i(!1)}},r().createElement("span",null,t.value),r().createElement(B,{variable:t.variable,hidden:!a,refresh:t.refresh})):r().createElement(r().Fragment,null,t.value)},G=function(){var t=N((0,n.useState)([]),2),o=t[0],a=t[1],i=(0,e.useAPIClient)(),l=(0,e.useVariableScopeInfo)().getVariableScopeInfo,c=N((0,n.useState)(!1),2),u=c[0],s=c[1],p=(0,n.useCallback)(function(){var e=l().scopeId;e&&(s(!0),i.request({url:"customVariables:list",method:"GET",skipNotify:!0,skipAuth:!0,params:{filter:{declaredAt:e}}}).then(function(e){a(e.data.data.map(function(e){return{label:r().createElement(z,{value:e.label,variable:e,refresh:p}),value:e.name}})),s(!1)}).catch(function(e){console.error("Error fetching custom variables:",e),a([]),s(!1)}))},[l]);return(0,n.useEffect)(function(){p()},[p]),{options:o,loading:u,refresh:p}};function U(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function L(e,t,n,r,o,a,i){try{var l=e[a](i),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function W(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){L(a,r,o,i,l,"next",e)}function l(e){L(a,r,o,i,l,"throw",e)}i(void 0)})}}function X(e,t,n){return(X=J()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&Y(o,n.prototype),o}).apply(null,arguments)}function K(e){return(K=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Y(e,t){return(Y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Z(e,t){if(e){if("string"==typeof e)return U(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return U(e,t)}}function H(e){var t="function"==typeof Map?new Map:void 0;return(H=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,n)}function n(){return X(e,arguments,K(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Y(n,e)})(e)}function J(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(J=function(){return!!e})()}function Q(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:c(0)}),l(i,"throw",{value:c(1)}),l(i,"return",{value:c(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var ee=function(o){var c;if("function"!=typeof o&&null!==o)throw TypeError("Super expression must either be null or a function");function u(){var e,t;if(!(this instanceof u))throw TypeError("Cannot call a class as a function");return e=u,t=arguments,e=K(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,J()?Reflect.construct(e,t||[],K(this).constructor):e.apply(this,t))}return u.prototype=Object.create(o&&o.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),o&&Y(u,o),c=[{key:"load",value:function(){return W(function(){var o;return Q(this,function(c){return o=this,this.app.schemaInitializerManager.add(F),this.app.schemaSettingsManager.addItem("menuSettings:menuItem","badge",{Component:f,sort:401}),this.app.schemaSettingsManager.addItem("PageTabSettings","badge",{Component:f,sort:201}),this.app.apiClient.axios.interceptors.response.use(function(e){var t=e.config.url.split("?")[0];return o.app.eventBus.dispatchEvent(new CustomEvent("collection:".concat(t))),e}),this.app.registerVariable({name:"$customVariables",useOption:function(){var e=G(),t=e.options,o=e.refresh,c=e.loading,u=(0,i.useTranslation)(l).t,s=(0,n.useMemo)(function(){return{label:u("Custom Variables"),value:"$customVariables",children:((function(e){if(Array.isArray(e))return U(e)})(t)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||Z(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([{label:r().createElement(a,{onSuccess:o}),disabled:!0,value:"none"}])}},[t,o]);return(0,n.useMemo)(function(){return{option:s,visible:!c}},[s,c])},useCtx:function(){var o,a=(0,e.useAPIClient)(),i=(0,e.useApp)(),l=(0,e.useLocalVariablesWithoutCustomVariable)(),c=(0,e.useVariables)(),u=function(e){if(Array.isArray(e))return e}(o=r().useState(0))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(o.push(t.value),2!==o.length);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw n}}return o}}(o)||Z(o,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),s=u[0],p=u[1],f=r().useRef(new Set),b=(0,n.useCallback)(function(){p(function(e){return e+1})},[]),d=(0,n.useCallback)(function(n){return W(function(){var r,o;return Q(this,function(a){switch(a.label){case 0:return r={},(0,t.flatten)(n,{breakOn:function(e){var t=e.key;return t.startsWith("$")&&"$and"!==t&&"$or"!==t},transformValue:function(t){if(!(0,e.isVariable)(t))return t;var n=null==c?void 0:c.parseVariable(t,l).then(function(e){return e.value});return r[t]=n,n}}),[4,Promise.all((o=Object.keys(r)).map(function(e){return r[e]}))];case 1:return a.sent().forEach(function(e,t){r[o[t]]=e}),[2,r]}})})()},[l,null==c?void 0:c.parseVariable]);return(0,n.useEffect)(function(){return function(){f.current.forEach(function(e){i.eventBus.removeEventListener(e,b)})}},[]),(0,n.useMemo)(function(){return function(e){var t=e.variableName;return W(function(){var e,n,r,o,l,c,u;return Q(this,function(s){switch(s.label){case 0:return n=t.replace("$customVariables.",""),[4,a.request({url:"customVariables:get?filter[name]=".concat(n),method:"GET"})];case 1:if(!(null==(r=s.sent())||null==(e=r.data)?void 0:e.data))throw Error('Custom variable "'.concat(n,'" not found. It may have been deleted.'));return[4,d((o=r.data.data).options.params.filter)];case 2:return l=s.sent(),c=["collection:".concat(o.options.collection,":create"),"collection:".concat(o.options.collection,":update"),"collection:".concat(o.options.collection,":destroy")],f.current.forEach(function(e){i.eventBus.removeEventListener(e,b)}),c.forEach(function(e){f.current.add(e),i.eventBus.addEventListener(e,b)}),[4,a.request({url:"customVariables:parse?name=".concat(n),method:"POST",data:{filterCtx:l}})];case 3:return[2,null==(u=s.sent().data)?void 0:u.data]}})})()}},[s])}}),[2]})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(u.prototype,c),u}(H(e.Plugin))}(),d}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
11
|
"react": "18.2.0",
|
|
12
|
-
"@nocobase/client": "2.1.0-alpha.
|
|
12
|
+
"@nocobase/client": "2.1.0-alpha.14",
|
|
13
13
|
"antd": "5.24.2",
|
|
14
14
|
"@formily/react": "2.3.7",
|
|
15
15
|
"react-i18next": "11.18.6",
|
|
16
|
-
"@nocobase/utils": "2.1.0-alpha.
|
|
16
|
+
"@nocobase/utils": "2.1.0-alpha.14",
|
|
17
17
|
"@ant-design/icons": "5.6.1",
|
|
18
|
-
"@nocobase/server": "2.1.0-alpha.
|
|
18
|
+
"@nocobase/server": "2.1.0-alpha.14",
|
|
19
19
|
"mathjs": "15.1.0",
|
|
20
|
-
"@nocobase/data-source-manager": "2.1.0-alpha.
|
|
21
|
-
"@nocobase/database": "2.1.0-alpha.
|
|
20
|
+
"@nocobase/data-source-manager": "2.1.0-alpha.14",
|
|
21
|
+
"@nocobase/database": "2.1.0-alpha.14"
|
|
22
22
|
};
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "自定义变量",
|
|
5
5
|
"description": "Support for adding and using custom variables",
|
|
6
6
|
"description.zh-CN": "支持新增和使用自定义变量",
|
|
7
|
-
"version": "2.1.0-alpha.
|
|
7
|
+
"version": "2.1.0-alpha.14",
|
|
8
8
|
"main": "./dist/server/index.js",
|
|
9
9
|
"homepage": "https://docs.nocobase.com/handbook/custom-variables",
|
|
10
10
|
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/custom-variables",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@nocobase/test": "2.x",
|
|
22
22
|
"antd-style": "3.x"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "d8735b541de0ff9557bba704de49c799b4962672",
|
|
25
25
|
"keywords": [
|
|
26
26
|
"Custom variables"
|
|
27
27
|
],
|