@nocobase/plugin-action-import 2.1.0-alpha.1 → 2.1.0-alpha.11

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/README.md CHANGED
@@ -1,17 +1,24 @@
1
1
  # NocoBase
2
2
 
3
3
  <video width="100%" controls>
4
- <source src="https://static-docs.nocobase.com/NocoBase0510.mp4" type="video/mp4">
4
+ <source src="https://github.com/user-attachments/assets/4d11a87b-00e2-48f3-9bf7-389d21072d13" type="video/mp4">
5
5
  </video>
6
6
 
7
+ <p align="center">
8
+ <a href="https://trendshift.io/repositories/4112" target="_blank"><img src="https://trendshift.io/api/badge/repositories/4112" alt="nocobase%2Fnocobase | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
9
+ <a href="https://www.producthunt.com/posts/nocobase?embed=true&utm_source=badge-top-post-topic-badge&utm_medium=badge&utm_souce=badge-nocobase" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/top-post-topic-badge.svg?post_id=456520&theme=light&period=weekly&topic_id=267" alt="NocoBase - Scalability&#0045;first&#0044;&#0032;open&#0045;source&#0032;no&#0045;code&#0032;platform | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
10
+ </p>
7
11
 
8
12
  ## What is NocoBase
9
13
 
10
- NocoBase is a scalability-first, open-source no-code development platform.
11
- Instead of investing years of time and millions of dollars in research and development, deploy NocoBase in a few minutes and you'll have a private, controllable, and extremely scalable no-code development platform!
14
+ NocoBase is the most extensible AI-powered no-code platform.
15
+ Total control. Infinite extensibility. AI collaboration.
16
+ Enable your team to adapt quickly and cut costs dramatically.
17
+ No years of development. No millions wasted.
18
+ Deploy NocoBase in minutes — and take control of everything.
12
19
 
13
20
  Homepage:
14
- https://www.nocobase.com/
21
+ https://www.nocobase.com/
15
22
 
16
23
  Online Demo:
17
24
  https://demo.nocobase.com/new
@@ -19,12 +26,74 @@ https://demo.nocobase.com/new
19
26
  Documents:
20
27
  https://docs.nocobase.com/
21
28
 
22
- Commericial license & plugins:
23
- https://www.nocobase.com/en/commercial
29
+ Forum:
30
+ https://forum.nocobase.com/
24
31
 
25
- License agreement:
26
- https://www.nocobase.com/en/agreement
32
+ Use Cases:
33
+ https://www.nocobase.com/en/blog/tags/customer-stories
27
34
 
35
+ ## Release Notes
28
36
 
29
- ## Contact Us:
30
- hello@nocobase.com
37
+ Our [blog](https://www.nocobase.com/en/blog/timeline) is regularly updated with release notes and provides a weekly summary.
38
+
39
+ ## Distinctive features
40
+
41
+ ### 1. Data model-driven, not form/table–driven
42
+
43
+ Instead of being constrained by forms or tables, NocoBase adopts a data model–driven approach, separating data structure from user interface to unlock unlimited possibilities.
44
+
45
+ - UI and data structure are fully decoupled
46
+ - Multiple blocks and actions can be created for the same table or record in any quantity or form
47
+ - Supports the main database, external databases, and third-party APIs as data sources
48
+
49
+ ![model](https://static-docs.nocobase.com/model.png)
50
+
51
+ ### 2. AI employees, integrated into your business systems
52
+ Unlike standalone AI demos, NocoBase allows you to embed AI capabilities seamlessly into your interfaces, workflows, and data context, making AI truly useful in real business scenarios.
53
+
54
+ - Define AI employees for roles such as translator, analyst, researcher, or assistant
55
+ - Seamless AI–human collaboration in interfaces and workflows
56
+ - Ensure AI usage is secure, transparent, and customizable for your business needs
57
+
58
+ ![AI-employee](https://static-docs.nocobase.com/ai-employee-home.png)
59
+
60
+ ### 3. What you see is what you get, incredibly easy to use
61
+
62
+ While enabling the development of complex business systems, NocoBase keeps the experience simple and intuitive.
63
+
64
+ - One-click switch between usage mode and configuration mode
65
+ - Pages serve as a canvas to arrange blocks and actions, similar to Notion
66
+ - Configuration mode is designed for ordinary users, not just programmers
67
+
68
+ ![wysiwyg](https://static-docs.nocobase.com/wysiwyg.gif)
69
+
70
+ ### 4. Everything is a plugin, designed for extension
71
+ Adding more no-code features will never cover every business case. NocoBase is built for extension through its plugin-based microkernel architecture.
72
+
73
+ - All functionalities are plugins, similar to WordPress
74
+ - Plugins are ready to use upon installation
75
+ - Pages, blocks, actions, APIs, and data sources can all be extended through custom plugins
76
+
77
+ ![plugins](https://static-docs.nocobase.com/plugins.png)
78
+
79
+ ## Installation
80
+
81
+ NocoBase supports three installation methods:
82
+
83
+ - <a target="_blank" href="https://docs.nocobase.com/welcome/getting-started/installation/docker-compose">Installing With Docker (👍Recommended)</a>
84
+
85
+ Suitable for no-code scenarios, no code to write. When upgrading, just download the latest image and reboot.
86
+
87
+ - <a target="_blank" href="https://docs.nocobase.com/welcome/getting-started/installation/create-nocobase-app">Installing from create-nocobase-app CLI</a>
88
+
89
+ The business code of the project is completely independent and supports low-code development.
90
+
91
+ - <a target="_blank" href="https://docs.nocobase.com/welcome/getting-started/installation/git-clone">Installing from Git source code</a>
92
+
93
+ If you want to experience the latest unreleased version, or want to participate in the contribution, you need to make changes and debug on the source code, it is recommended to choose this installation method, which requires a high level of development skills, and if the code has been updated, you can git pull the latest code.
94
+
95
+ ## How NocoBase works
96
+
97
+ <video width="100%" controls>
98
+ <source src="https://github.com/user-attachments/assets/8d183b44-9bb5-4792-b08f-bc08fe8dfaaf" type="video/mp4">
99
+ </video>
@@ -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("@formily/core"),require("react-dom"),require("react"),require("@formily/antd-v5"),require("@emotion/css"),require("@nocobase/flow-engine"),require("lodash"),require("file-saver"),require("@formily/shared"),require("@nocobase/client"),require("@formily/reactive"),require("@formily/react"),require("@nocobase/utils/client"),require("@ant-design/icons"),require("antd"),require("react-i18next")):"function"==typeof define&&define.amd?define("@nocobase/plugin-action-import",["@formily/core","react-dom","react","@formily/antd-v5","@emotion/css","@nocobase/flow-engine","lodash","file-saver","@formily/shared","@nocobase/client","@formily/reactive","@formily/react","@nocobase/utils/client","@ant-design/icons","antd","react-i18next"],t):"object"==typeof exports?exports["@nocobase/plugin-action-import"]=t(require("@formily/core"),require("react-dom"),require("react"),require("@formily/antd-v5"),require("@emotion/css"),require("@nocobase/flow-engine"),require("lodash"),require("file-saver"),require("@formily/shared"),require("@nocobase/client"),require("@formily/reactive"),require("@formily/react"),require("@nocobase/utils/client"),require("@ant-design/icons"),require("antd"),require("react-i18next")):e["@nocobase/plugin-action-import"]=t(e["@formily/core"],e["react-dom"],e.react,e["@formily/antd-v5"],e["@emotion/css"],e["@nocobase/flow-engine"],e.lodash,e["file-saver"],e["@formily/shared"],e["@nocobase/client"],e["@formily/reactive"],e["@formily/react"],e["@nocobase/utils/client"],e["@ant-design/icons"],e.antd,e["react-i18next"])}(self,function(e,t,n,r,o,i,a,l,c,u,s,p,f,m,d,y){return function(){"use strict";var v={482:function(e){e.exports=m},964:function(e){e.exports=o},632:function(e){e.exports=r},563:function(t){t.exports=e},505:function(e){e.exports=p},229:function(e){e.exports=s},875:function(e){e.exports=c},772:function(e){e.exports=u},667:function(e){e.exports=i},584:function(e){e.exports=f},721:function(e){e.exports=d},346:function(e){e.exports=l},467:function(e){e.exports=a},156:function(e){e.exports=n},111:function(e){e.exports=t},238:function(e){e.exports=y}},b={};function h(e){var t=b[e];if(void 0!==t)return t.exports;var n=b[e]={exports:{}};return v[e](n,n.exports,h),n.exports}h.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return h.d(t,{a:t}),t},h.d=function(e,t){for(var n in t)h.o(t,n)&&!h.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},h.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},h.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var g={};return!function(){h.r(g),h.d(g,{PluginActionImportClient:function(){return eU},ImportActionInitializer:function(){return m},useImportStartAction:function(){return H},DownloadTips:function(){return y},initImportSettings:function(){return f},ImportContextProvider:function(){return eo},ImportWarning:function(){return d},ImportDesigner:function(){return T},default:function(){return e_},useDownloadXlsxTemplateAction:function(){return $},ImportPluginProvider:function(){return er}});var e,t=h(875),n=h(772),r=h(156),o=h.n(r),i=h(238);function a(){return(0,i.useTranslation)(["action-import","client"],{nsMode:"fallback"})}function l(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}var c=["createdAt","createdBy","updatedAt","updatedBy"],u=function(e){var t=(0,n.useCollectionManager_deprecated)().getCollectionFields,r=t(e),o=(0,n.useCompile)(),i=function(e,n){if(!(!e.interface||c.includes(e.interface))){var r={name:e.name,title:o(null==e||null==(i=e.uiSchema)?void 0:i.title)||e.name,schema:null==e?void 0:e.uiSchema};if(!e.target||n>=2)return r;if(e.target&&["hasOne","hasMany","belongsTo","belongsToMany","belongsToArray"].includes(e.type)){var i,u,s=a(t(e.target),n+1).filter(Boolean);r.children=r.children||[],(u=r.children).push.apply(u,function(e){if(Array.isArray(e))return l(e)}(s)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(s)||function(e,t){if(e){if("string"==typeof e)return l(e,void 0);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 l(e,t)}}(s)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}return r}},a=function(e,t){var n=[];return e.forEach(function(e){var r=i(e,t);r&&n.push(r)}),n};return a(r,1)},s=h(721),p=h(584),f=function(e){return{importColumns:null==e?void 0:e.filter(function(e){return!e.children}).map(function(e){return{dataIndex:[e.name]}}),explain:""}},m=function(){var e=(0,n.useSchemaInitializerItem)(),r=(0,n.useSchemaInitializer)().insert,i=u((0,n.useCollection_deprecated)().name),a={type:"void",title:'{{ t("Import") }}',"x-component":"ImportAction","x-action":"importXlsx","x-settings":"actionSettings:import","x-toolbar":"ActionSchemaToolbar"};return o().createElement(n.SchemaInitializerItem,{title:e.title,onClick:function(){p.lodash.set(a,"x-action-settings.importSettings",f(i));var n,o=(0,t.merge)(a||{},e.schema||{});null==e||null==(n=e.schemaInitialize)||n.call(e,o),r(o)}})},d=function(){var e=a().t;return o().createElement(s.Alert,{type:"warning",style:{marginBottom:"10px"},message:e("Import warnings",{limit:2e3})})},y=function(){var e=a().t;return o().createElement(s.Alert,{type:"info",style:{marginBottom:"10px",whiteSpace:"pre-line"},message:e("Download tips")})},v=h(632),b=h(505),x="action-import";function S(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 I(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function O(){var e=I(["\n width: 100%;\n & .ant-space-item:nth-child(2) {\n flex: 1;\n }\n "]);return O=function(){return e},e}function w(){var e=I(["\n border-color: var(--colorSettings);\n color: var(--colorSettings);\n &.ant-btn-dashed:hover {\n border-color: var(--colorSettings);\n color: var(--colorSettings);\n }\n "]);return w=function(){return e},e}var A=["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel","application/wps-office.xlsx"],j=function(){var e=(0,i.useTranslation)(x).t,t=u((0,n.useCollection_deprecated)().name),r=(0,n.useCompile)();return{importSettingsSchema:{type:"void","x-component":"Grid",properties:{explain:{type:"string",title:'{{ t("Import explain", {ns: "'.concat(x,'"}) }}'),"x-decorator":"FormItem","x-component":"Input.TextArea"},importColumns:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{className:(0,n.css)(O())},properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},dataIndex:{type:"array","x-decorator":"FormItem","x-component":n.Cascader,required:!0,"x-use-component-props":function(){return{options:r(t)}},"x-component-props":{fieldNames:{label:"title",value:"name",children:"children"},changeOnSelect:!1}},title:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{ t("Custom column title") }}'}},description:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{ t("Field description placeholder", {ns: "'.concat(x,'"}) }}')}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:'{{ t("Add importable field", {ns: "'.concat(x,'"}) }}'),"x-component":"ArrayItems.Addition","x-component-props":{className:(0,n.css)(w())}}}}}},beforeUploadHandler:function(){return!1},uploadValidator:function(t,n){if(t.length>1)return{type:"error",message:e("Only one file is allowed to be uploaded")};var r,o=null!=(r=t[0])?r:{};return A.includes(o.type)?"":{type:"error",message:e("Please upload the file of Excel")}},validateUpload:function(e,t,n){var r,o,i,a=(function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(n,1)||function(e,t){if(e){if("string"==typeof e)return S(e,1);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 S(e,t)}}(n,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];t.disabled=(null==a?void 0:a.length)===0,r=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){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}({},t.componentProps),o=o={disabled:(null==a?void 0:a.length)===0||(null==(i=e.errors)?void 0:i.length)>0},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}),t.componentProps=r}}};function P(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 C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(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){C(e,t,n[t])})}return e}var T=function(){var e,t,a,l,c,u,s,p=(0,b.useField)(),f=(0,b.useFieldSchema)(),m=(0,i.useTranslation)().t,d=(0,n.useDesignable)().dn,y=(e=(0,r.useState)(),function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return P(e,2);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 P(e,t)}}(e,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.")}()),h=y[0],g=y[1],x=j().importSettingsSchema;return(0,r.useEffect)(function(){g(x)},[p.address,null==f||null==(t=f["x-action-settings"])?void 0:t.importSettings]),o().createElement(n.GeneralSchemaDesigner,{disableInitializer:!0},o().createElement(n.SchemaSettingsModalItem,{title:m("Edit button"),schema:{type:"object",title:m("Edit button"),properties:{title:{"x-decorator":"FormItem","x-component":"Input",title:m("Button title"),default:f.title,"x-component-props":{}},icon:{"x-decorator":"FormItem","x-component":"IconPicker",title:m("Button icon"),default:null==f||null==(a=f["x-component-props"])?void 0:a.icon,"x-component-props":{}},type:{"x-decorator":"FormItem","x-component":"Radio.Group",title:m("Button background color"),default:(null==f||null==(l=f["x-component-props"])?void 0:l.danger)?"danger":(null==f||null==(c=f["x-component-props"])?void 0:c.type)==="primary"?"primary":"default",enum:[{value:"default",label:'{{t("Default")}}'},{value:"primary",label:'{{t("Highlight")}}'},{value:"danger",label:'{{t("Danger red")}}'}]}}},onSubmit:function(e){var t,n=e.title,r=e.icon,o=e.type;f.title=n,p.title=n,p.componentProps.icon=r,p.componentProps.danger="danger"===o,p.componentProps.type=o,f["x-component-props"]=f["x-component-props"]||{},f["x-component-props"].icon=r,f["x-component-props"].danger="danger"===o,f["x-component-props"].type=o,d.emit("patch",{schema:(C(t={},"x-uid",f["x-uid"]),C(t,"title",n),C(t,"x-component-props",E({},f["x-component-props"])),t)}),d.refresh()}}),o().createElement(n.SchemaSettingsActionModalItem,{title:m("Importable fields"),schema:h,initialValues:E({},null!=(s=null==f||null==(u=f["x-action-settings"])?void 0:u.importSettings)?s:{}),components:{ArrayItems:v.ArrayItems},onSubmit:function(e){var t,n=e.importColumns,r=e.explain,o=null==n?void 0:n.filter(function(e){var t;return null==e||null==(t=e.dataIndex)?void 0:t.length}).map(function(e){return{dataIndex:e.dataIndex.map(function(e){var t;return null!=(t=e.name)?t:e}),title:e.title}});f["x-action-settings"].importSettings={importColumns:o,explain:r},d.emit("patch",{schema:(C(t={},"x-uid",f["x-uid"]),C(t,"x-action-settings",f["x-action-settings"]),t)}),d.refresh()}}),o().createElement(n.SchemaSettingsDivider,null),o().createElement(n.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:function(e){return"Space"===e["x-component"]||e["x-component"].endsWith("ActionBar")},confirm:{title:m("Delete action")}}))},F=h(111),k=(0,r.createContext)(null);k.displayName="ImportContext";var D=function(){return(0,r.useContext)(k)},M=h(482),B=h(346);function q(){var e,t,n=(e=["\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return q=function(){return n},n}var R={IMPORTING:1,IMPORTED:2},U=function(e){var t=(0,i.useTranslation)(x).t,r=D(),a=r.importModalVisible,l=r.importStatus,c=r.importResult,u=r.setImportModalVisible,p=null!=c?c:{},f=p.data,m=p.meta,d=function(){u(!1)};return o().createElement(s.Modal,{title:t("Import Data"),width:"50%",styles:{body:{height:"calc(80vh - 200px)"}},open:a,footer:null,closable:l===R.IMPORTED,onCancel:d},o().createElement("div",{className:(0,n.css)(q())},l===R.IMPORTING&&o().createElement(s.Spin,{indicator:o().createElement(M.LoadingOutlined,{style:{fontSize:24},spin:!0}),tip:t("Excel data importing")}),l===R.IMPORTED&&o().createElement(s.Space,{direction:"vertical",align:"center"},o().createElement(M.ExclamationCircleFilled,{style:{fontSize:72,color:"#1890ff"}}),o().createElement("p",null,function(e){if(!e)return null;var n=e.data,r=e.meta;if(r)return t("{{successCount}} records have been successfully imported",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){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}({},null!=r?r:{}));var o=["".concat(t("Total records"),": ").concat(n.total||0),"".concat(t("Successfully imported"),": ").concat(n.success||0)];return n.skipped>0&&o.push("".concat(t("Skipped"),": ").concat(n.skipped)),n.updated>0&&o.push("".concat(t("Updated"),": ").concat(n.updated)),o.join(", ")}(c)),o().createElement(s.Space,null,(null==m?void 0:m.failureCount)>0&&o().createElement(s.Button,{onClick:function(){var e=new Blob([new Int8Array(null==f?void 0:f.data)],{type:"application/x-xls"});(0,B.saveAs)(e,"fail.xlsx")}},t("To download the failure data")),o().createElement(s.Button,{type:"primary",onClick:d},t("Done"))))))},_=h(467),z=h.n(_);function N(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function V(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){N(i,r,o,a,l,"next",e)}function l(e){N(i,r,o,a,l,"throw",e)}a(void 0)})}}function X(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){var c=[i,l];if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var G=function(){for(var e=(0,n.useActionContext)().fieldSchema,t=(0,b.useFieldSchema)(),r=e||t;r&&"importXlsx"!==r["x-action"];)console.log("schema",r=r.parent);return{schema:r}},L=function(e){return e&&Array.isArray(e)?e:[]},$=function(){var e=(0,n.useBlockRequestContext)().resource,t=(0,n.useCompile)(),r=(0,n.useCollectionManager_deprecated)(),o=r.getCollectionJoinField,i=r.getCollectionField,a=(0,n.useCollection_deprecated)(),l=a.name,c=a.title,u=G().schema;return{run:function(){return V(function(){var n,r,a,s,p,f,m;return X(this,function(d){switch(d.label){case 0:return s=(a=z().cloneDeep(null!=(r=null==u||null==(n=u["x-action-settings"])?void 0:n.importSettings)?r:{})).importColumns,p=a.explain,f=L(s).map(function(e){var n=i("".concat(l,".").concat(e.dataIndex[0]));if(n){if(e.defaultTitle=t(null==n||null==(r=n.uiSchema)?void 0:r.title)||n.name,e.dataIndex.length>1){var r,a,c=o("".concat(l,".").concat(e.dataIndex.join(".")));if(!c)return;e.defaultTitle=e.defaultTitle+"/"+t(null==c||null==(a=c.uiSchema)?void 0:a.title)||c.name}return"chinaRegion"===n.interface&&e.dataIndex.push("name"),e}}).filter(Boolean),[4,e.downloadXlsxTemplate({values:{title:t(c),explain:p,columns:t(f)}},{method:"post",responseType:"blob"})];case 1:return m=new Blob([d.sent().data],{type:"application/x-xls"}),(0,B.saveAs)(m,"".concat(t(c),".xlsx")),[2]}})})()}}},H=function(){var e,t=(0,n.useBlockRequestContext)().service,o=(0,n.useCompile)(),i=(0,n.useCollectionManager_deprecated)(),a=i.getCollectionJoinField,l=i.getCollectionField,c=(0,n.useCollection_deprecated)().name,u=G().schema,s=(0,b.useForm)(),p=(0,n.useActionContext)().setVisible,f=D(),m=f.setImportModalVisible,d=f.setImportStatus,y=f.setImportResult,v=s.values.upload,h=(0,n.useDataBlockResource)();return(0,r.useEffect)(function(){s.reset()},[]),{run:function(){return V(function(){var e,n,r,i,f,v,b,g,x,S,I,O,w,A;return X(this,function(j){switch(j.label){case 0:v=(f=z().cloneDeep(null!=(i=null==u||null==(e=u["x-action-settings"])?void 0:e.importSettings)?i:{})).importColumns,b=f.explain,g=L(v).map(function(e){var t=l("".concat(c,".").concat(e.dataIndex[0]));if(t){if(e.defaultTitle=o(null==t||null==(n=t.uiSchema)?void 0:n.title)||t.name,e.dataIndex.length>1){var n,r,i=a("".concat(c,".").concat(e.dataIndex.join(".")));if(!i)return;e.defaultTitle=e.defaultTitle+"/"+o(null==i||null==(r=i.uiSchema)?void 0:r.title)||i.name}return"chinaRegion"===t.interface&&e.dataIndex.push("name"),e}}).filter(Boolean),x=new FormData,S=s.values.upload.map(function(e){return e.originFileObj}),x.append("file",S[0]),x.append("columns",JSON.stringify(g)),x.append("explain",b),I=(null==u||null==(n=u["x-action-settings"])?void 0:n.importMode)||"auto",O=(null==u||null==(r=u["x-action-settings"])?void 0:r.timeout)||6e5,p(!1),m(!0),d(R.IMPORTING),j.label=1;case 1:return j.trys.push([1,6,,7]),[4,h.importXlsx({values:x,mode:I,timeout:O})];case 2:if(w=j.sent().data,s.reset(),w.data.taskId)return[3,4];return y(w),[4,null==t||null==(A=t.refresh)?void 0:A.call(t)];case 3:return j.sent(),d(R.IMPORTED),[3,5];case 4:m(!1),p(!1),j.label=5;case 5:return[3,7];case 6:return j.sent(),m(!1),p(!0),[3,7];case 7:return[2]}})})()},disabled:(null==v?void 0:v.length)===0||(null==(e=s.errors)?void 0:e.length)>0}},W=h(964);function J(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 K(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Q(){var e=K(["\n .ant-formily-item-label {\n height: var(--controlHeightLG);\n }\n "]);return Q=function(){return e},e}function Y(){var e=K(["\n margin-top: 5px;\n "]);return Y=function(){return e},e}var Z={type:"void",name:"import-modal",title:'{{ t("Import Data", {ns: "'.concat(x,'" }) }}'),"x-component":"Action.Modal","x-decorator":"Form","x-component-props":{width:"100%",style:{maxWidth:"750px"},className:(0,W.css)(Q())},properties:{formLayout:{type:"void","x-component":"FormLayout",properties:{warning:{type:"void","x-component":"ImportWarning"},download:{type:"void",title:'{{ t("Step 1: Download template", {ns: "'.concat(x,'" }) }}'),"x-component":"FormItem","x-acl-ignore":!0,properties:{tip:{type:"void","x-component":"DownloadTips"},downloadAction:{type:"void",title:'{{ t("Download template", {ns: "'.concat(x,'" }) }}'),"x-component":"Action","x-component-props":{className:(0,W.css)(Y()),useAction:"{{ useDownloadXlsxTemplateAction }}"}}}},upload:{type:"array",title:'{{ t("Step 2: Upload Excel", {ns: "'.concat(x,'" }) }}'),"x-decorator":"FormItem","x-acl-ignore":!0,"x-component":"Upload.Dragger","x-validator":"{{ uploadValidator }}","x-component-props":{action:"",height:"150px",tipContent:'{{ t("Upload placeholder", {ns: "'.concat(x,'" }) }}'),beforeUpload:"{{ beforeUploadHandler }}"}}}},footer:{"x-component":"Action.Modal.Footer","x-component-props":{},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{},properties:{cancel:{type:"void",title:'{{ t("Cancel") }}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},startImport:{type:"void",title:'{{ t("Start import", {ns: "'.concat(x,'" }) }}'),"x-component":"Action","x-component-props":{type:"primary",htmlType:"submit",useAction:"{{ useImportStartAction }}"},"x-reactions":{dependencies:["upload"],fulfill:{run:"validateUpload($form, $self, $deps)"}}}}}}}}},ee=function(e){var t,i,a,l=(t=(0,r.useState)(!1),function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return J(e,2);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 J(e,t)}}(t,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.")}()),c=l[0],u=l[1],s=(0,n.useCompile)(),p=(0,b.useFieldSchema)();return o().createElement(n.ActionContextProvider,{value:{visible:c,setVisible:u,fieldSchema:p}},o().createElement(n.Action,(i=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){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}({icon:e.icon||"uploadoutlined",title:s((null==p?void 0:p.title)||"t('Import')")},e),a=a={onClick:function(){return u(!0)}},Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(a)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(a,e))}),i)),o().createElement(n.SchemaComponent,{schema:Z}))};function et(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 en(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return et(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 et(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.")}()}var er=function(e){var t=j(),r=t.uploadValidator,i=t.beforeUploadHandler,a=t.validateUpload;return o().createElement(n.SchemaComponentOptions,{components:{ImportActionInitializer:m,ImportDesigner:T,ImportWarning:d,DownloadTips:y,ImportAction:ee},scope:{uploadValidator:r,validateUpload:a,beforeUploadHandler:i,useDownloadXlsxTemplateAction:$,useImportStartAction:H}},o().createElement(eo,null,e.children))},eo=function(e){var t=en((0,r.useState)(!1),2),n=t[0],i=t[1],a=en((0,r.useState)(R.IMPORTING),2),l=a[0],c=a[1],u=en((0,r.useState)(null),2),s=u[0],p=u[1];return o().createElement(k.Provider,{value:{importModalVisible:n,setImportModalVisible:i,importStatus:l,setImportStatus:c,importResult:s,setImportResult:p}},(0,F.createPortal)(o().createElement(U,null),document.body),e.children)};function ei(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 ea(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function el(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){ea(e,t,n[t])})}return e}var ec=new n.SchemaSettings({name:"actionSettings:import",items:[{name:"editButton",Component:n.ButtonEditor,useComponentProps:function(){return(0,n.useSchemaToolbar)().buttonEditorProps}},{name:"linkageRules",Component:n.SchemaSettingsLinkageRules,useComponentProps:function(){return el({},(0,n.useSchemaToolbar)().linkageRulesProps)}},{name:"importableFields",type:"actionModal",useComponentProps:function(){var e,t,o,a,l=(0,b.useField)(),c=(0,b.useFieldSchema)(),u=(0,i.useTranslation)().t,s=(0,n.useDesignable)().dn,p=(e=(0,r.useState)(),function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return ei(e,2);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 ei(e,t)}}(e,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.")}()),f=p[0],m=p[1],d=j().importSettingsSchema;return(0,r.useEffect)(function(){m(d)},[l.address,null==c||null==(t=c["x-action-settings"])?void 0:t.importSettings]),{title:u("Importable fields"),schema:el({},f),initialValues:el({},null!=(a=null==c||null==(o=c["x-action-settings"])?void 0:o.importSettings)?a:{}),components:{ArrayItems:v.ArrayItems},onSubmit:function(e){var t,n=e.importColumns,r=e.explain,o=null==n?void 0:n.filter(function(e){var t;return null==e||null==(t=e.dataIndex)?void 0:t.length}).map(function(e){return{dataIndex:e.dataIndex.map(function(e){var t;return null!=(t=e.name)?t:e}),title:e.title,description:e.description}});c["x-action-settings"].importSettings={importColumns:o,explain:r},s.emit("patch",{schema:(ea(t={},"x-uid",c["x-uid"]),ea(t,"x-action-settings",c["x-action-settings"]),t)}),s.refresh()}}}},{name:"divider",type:"divider"},{name:"delete",type:"remove",useComponentProps:function(){return{removeParentsIfNoChildren:!0,breakRemoveOn:function(e){return"Space"===e["x-component"]||e["x-component"].endsWith("ActionBar")},confirm:{title:(0,(0,i.useTranslation)().t)("Delete action")}}}}]}),eu=h(563),es=h(229),ep=h(667);function ef(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}var em=["createdAt","createdBy","updatedAt","updatedBy"],ed=function(e,t){var n=function(e,n){if(!(!e.interface||em.includes(e.interface))){var o={name:e.name,title:t(null==e||null==(i=e.uiSchema)?void 0:i.title)||e.name,schema:null==e?void 0:e.uiSchema};if(!e.target||n>=2)return o;if(e.target&&["hasOne","hasMany","belongsTo","belongsToMany","belongsToArray"].includes(e.type)){var i,a,l=r(e.targetCollection&&e.targetCollection.getFields()||[],n+1).filter(Boolean);o.children=o.children||[],(a=o.children).push.apply(a,function(e){if(Array.isArray(e))return ef(e)}(l)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(l)||function(e,t){if(e){if("string"==typeof e)return ef(e,void 0);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 ef(e,t)}}(l)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}return o}},r=function(e,t){var r=[];return e.forEach(function(e){var o=n(e,t);o&&r.push(o)}),r};return r(e,1)};function ey(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 ev(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function eb(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ev(i,r,o,a,l,"next",e)}function l(e){ev(i,r,o,a,l,"throw",e)}a(void 0)})}}function eh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eg(e){return(eg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ex(e,t){return(ex=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eS(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function eI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(eI=function(){return!!e})()}function eO(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){var c=[i,l];if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function ew(){var e=eS(["\n margin-top: 5px;\n "]);return ew=function(){return e},e}function eA(){var e=eS(["\n width: 100%;\n & .ant-space-item:nth-child(2) {\n flex: 1;\n }\n "]);return eA=function(){return e},e}function ej(){var e=eS(["\n border-color: var(--colorSettings);\n color: var(--colorSettings);\n &.ant-btn-dashed:hover {\n border-color: var(--colorSettings);\n color: var(--colorSettings);\n }\n "]);return ej=function(){return e},e}var eP=["id","createdAt","createdBy","updatedAt","updatedBy"],eC=["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel","application/wps-office.xlsx"],eE={type:"object",properties:{warning:{type:"void","x-component":"ImportWarning"},download:{type:"void",title:(0,ep.escapeT)("Step 1: Download template",{ns:"".concat(x)}),"x-component":"FormItem",properties:{tip:{type:"void","x-component":"DownloadTips"},downloadAction:{type:"void",title:(0,ep.escapeT)("Download template",{ns:"".concat(x)}),"x-component":"Button","x-component-props":{className:(0,W.css)(ew()),children:(0,ep.escapeT)("Download template",{ns:"".concat(x)}),onClick:"{{ handelDownloadXlsxTemplateAction }}"}}}},upload:{type:"array",title:(0,ep.escapeT)("Step 2: Upload Excel",{ns:"".concat(x)}),"x-decorator":"FormItem","x-acl-ignore":!0,"x-component":"Upload.Dragger","x-validator":function(e,t){var n,r=e.fileList;if(r.length>1)return{type:"error",message:(0,ep.escapeT)("Only one file is allowed to be uploaded")};var o=null!=(n=r[0])?n:{};return eC.includes(o.type)?"":{type:"error",message:(0,ep.escapeT)("Please upload the file of Excel")}},"x-component-props":{action:"",height:"150px",maxCount:1,children:(0,ep.escapeT)("Upload placeholder",{ns:"".concat(x)}),beforeUpload:function(){return!1}}}}},eT=(0,b.createSchemaField)({components:{ImportWarning:d,DownloadTips:y,Upload:s.Upload,FormItem:v.FormItem,Button:s.Button}}),eF=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=eg(t),eh(e=function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=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,eI()?Reflect.construct(t,r||[],eg(this).constructor):t.apply(this,r)),"defaultProps",{title:(0,ep.escapeT)("Import"),type:"default",icon:"uploadoutlined"}),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&ex(n,e),t=[{key:"getAclActionName",value:function(){return"importXlsx"}}],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)}}(n.prototype,t),n}(n.ActionModel);function ek(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function eD(e,t,n){return(eD=eR()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&eB(o,n.prototype),o}).apply(null,arguments)}eh(eF,"scene",n.ActionSceneEnum.collection),eF.define({label:(0,ep.escapeT)("Import")}),eF.registerFlow({key:"importSettings",title:(0,ep.escapeT)("Import settings"),on:"click",steps:{import:{handler:(e=eb(function(e,t){var n,r,i,a,l,c,u,p,f,m,d,y;return eO(this,function(t){switch(t.label){case 0:var h,g,S;return n=(0,es.observable)({status:"",result:null}),r=(0,eu.createForm)(),a=(i=e.model.context.blockModel).resource,c=(l=i.collection).title,u=l.name,f=(p=e.model.getProps().importSettings).explain,m=(!(h=p.importColumns)||!Array.isArray(h)?[]:h).map(function(t){var n=e.model.context.dataSourceManager.getCollectionField("".concat(i.collection.dataSourceKey,".").concat(u,".").concat(t.dataIndex[0]));if(n){if(t.defaultTitle=e.t(null==n||null==(r=n.uiSchema)?void 0:r.title)||n.name,t.dataIndex.length>1){var r,o,a=e.model.context.dataSourceManager.getCollectionField("".concat(e.model.context.collection.dataSourceKey,".").concat(u,".").concat(t.dataIndex.join(".")));if(!a)return;t.defaultTitle=t.defaultTitle+"/"+e.t(null==a||null==(o=a.uiSchema)?void 0:o.title)||a.name}return t}}).filter(Boolean),g=eb(function(){var t;return eO(this,function(n){switch(n.label){case 0:return[4,a.runAction("downloadXlsxTemplate",{data:{title:e.t(c),explain:f,columns:function(e){if(Array.isArray(e))return ey(e)}(m)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(m)||function(e,t){if(e){if("string"==typeof e)return ey(e,void 0);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 ey(e,t)}}(m)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},responseType:"blob",method:"post"})];case 1:return t=new Blob([n.sent()],{type:"application/x-xls"}),(0,B.saveAs)(t,"".concat(e.t(c),".xlsx")),[2]}})}),d=function(){return g.apply(this,arguments)},S=eb(function(t){var o,i,l,c,u,s,p,d;return eO(this,function(y){switch(y.label){case 0:o=r.values.upload.fileList,i=new FormData,l=o.map(function(e){return e.originFileObj}),i.append("file",l[0]),i.append("columns",JSON.stringify(m)),i.append("explain",f),c=e.model.getProps().importMode,n.status="importing",y.label=1;case 1:return y.trys.push([1,6,,7]),[4,a.runAction("importXlsx",{data:i,mode:c,timeout:6e5})];case 2:if(null==(s=y.sent().data)||null==(u=s.data)?void 0:u.taskId)return[3,4];return n.result=s,n.status="imported",[4,null==a||null==(p=a.refresh)?void 0:p.call(a)];case 3:return y.sent(),r.reset(),[3,5];case 4:t.close(),r.reset(),y.label=5;case 5:return[3,7];case 6:return d=y.sent(),n.status="",console.error(d),[3,7];case 7:return[2]}})}),y=(0,ep.observer)(function(t){var i=t.popover,a=e.t;if("importing"===n.status)return o().createElement("div",{style:{display:"flex",justifyContent:"center",padding:40}},o().createElement(s.Spin,{tip:a("Excel data importing"),indicator:o().createElement(M.LoadingOutlined,{spin:!0,style:{fontSize:24}})}));if("imported"===n.status){var l,c,u,p=null==(u=n.result)?void 0:u.meta;return o().createElement(s.Space,{direction:"vertical",align:"center",style:{width:"100%",padding:24}},o().createElement(M.ExclamationCircleFilled,{style:{fontSize:72,color:"#1890ff"}}),o().createElement("p",null,function(e){if(!e)return null;var t=e.successCount;if(e.meta,t)return a("{{successCount}} records have been successfully imported",{successCount:t},{ns:x})}(n.result)),o().createElement(s.Space,null,(null==p?void 0:p.failureCount)>0&&o().createElement(s.Button,{onClick:function(){var e,t,r=new Blob([new Int8Array(null==(t=n.result)||null==(e=t.data)?void 0:e.data)],{type:"application/x-xls"});(0,B.saveAs)(r,"fail.xlsx")}},a("To download the failure data")),o().createElement(s.Button,{type:"primary",onClick:function(){i.close(),n.status="",n.result=null}},a("Done"))))}return o().createElement(b.FormProvider,{form:r},o().createElement(v.FormLayout,{layout:"vertical"},o().createElement(eT,{schema:eE,scope:{t:e.t,handelDownloadXlsxTemplateAction:d}})),o().createElement(v.FormButtonGroup,{align:"right"},o().createElement(s.Button,{onClick:function(){return i.close()}},a("Cancel")),o().createElement(s.Button,{type:"primary",onClick:function(){return function(e){return S.apply(this,arguments)}(i)},disabled:!(null==(c=r.values.upload)||null==(l=c.fileList)?void 0:l.length)},a("Start import",{ns:"".concat(x)}))))}),[4,e.viewer.open({type:"dialog",placement:"center",width:800,title:e.t("Import Data",{ns:"".concat(x)}),content:function(e){return o().createElement(y,{popover:e})}})];case 1:return t.sent(),[2]}})}),function(t,n){return e.apply(this,arguments)})}}}),eF.registerFlow({key:"importActionSetting",title:(0,ep.escapeT)("Import action settings",{ns:x}),steps:{importSetting:{title:(0,ep.escapeT)("Importable fields"),uiSchema:function(e){var t=ed(e.model.context.blockModel.collection.getFields(),e.t);return{explain:{type:"string",title:'{{ t("Import explain", {ns: "'.concat(x,'"}) }}'),"x-decorator":"FormItem","x-component":"Input.TextArea"},importColumns:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{className:(0,W.css)(eA())},properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},dataIndex:{type:"array","x-decorator":"FormItem","x-component":n.Cascader,required:!0,"x-component-props":{fieldNames:{label:"title",value:"name",children:"children"},changeOnSelect:!1,options:t}},title:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{ t("Custom column title") }}'}},description:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{ t("Field description placeholder", {ns: "'.concat(x,'"}) }}')}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:'{{ t("Add importable field", {ns: "'.concat(x,'"}) }}'),"x-component":"ArrayItems.Addition","x-component-props":{className:(0,W.css)(ej())}}}}}},defaultParams:function(e){var t;return 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){eh(e,t,n[t])})}return e}({},{importColumns:null==(t=e.model.context.blockModel.collection.getFields())?void 0:t.filter(function(e){return!e.isAssociationField()&&!(eP.includes(e.interface)||!e.options.interface)}).map(function(e){return{dataIndex:[e.name]}}),explain:""})},handler:function(e,t){var n=t.importColumns,r=t.explain,o=null==n?void 0:n.filter(function(e){var t;return null==e||null==(t=e.dataIndex)?void 0:t.length}).map(function(e){return{dataIndex:e.dataIndex.map(function(e){var t;return null!=(t=e.name)?t:e}),title:e.title,description:e.description}});e.model.setProps("importSettings",{importColumns:o,explain:r})}}}});function eM(e){return(eM=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eB(e,t){return(eB=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eq(e){var t="function"==typeof Map?new Map:void 0;return(eq=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 eD(e,arguments,eM(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),eB(n,e)})(e)}function eR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(eR=function(){return!!e})()}var eU=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=eM(e),function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=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,eR()?Reflect.construct(e,t||[],eM(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&eB(r,e),t=[{key:"load",value:function(){var e,t=this;return(e=function(){var e,r;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){var c=[i,l];if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(o){return t.app.use(er),e={title:"{{t('Import')}}",Component:"ImportActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action":"importXlsx","x-acl-action-props":{skipScopeCheck:!0}},useVisible:function(){return(0,n.useActionAvailable)("importXlsx")}},null==(r=t.app.schemaInitializerManager.get("table:configureActions"))||r.add("enableActions.import",e),t.app.schemaInitializerManager.addItem("gantt:configureActions","enableActions.import",e),t.app.schemaSettingsManager.add(ec),t.app.flowEngine.registerModels({ImportActionModel:eF}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ek(i,r,o,a,l,"next",e)}function l(e){ek(i,r,o,a,l,"throw",e)}a(void 0)})})()}}],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)}}(r.prototype,t),r}(eq(n.Plugin)),e_=eU}(),g}()});
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@emotion/css"),require("react-dom"),require("@formily/antd-v5"),require("@formily/reactive"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("file-saver"),require("@formily/shared"),require("@formily/core"),require("react"),require("antd"),require("@nocobase/client"),require("@nocobase/utils/client"),require("lodash")):"function"==typeof define&&define.amd?define("@nocobase/plugin-action-import",["react-i18next","@emotion/css","react-dom","@formily/antd-v5","@formily/reactive","@formily/react","@ant-design/icons","@nocobase/flow-engine","file-saver","@formily/shared","@formily/core","react","antd","@nocobase/client","@nocobase/utils/client","lodash"],t):"object"==typeof exports?exports["@nocobase/plugin-action-import"]=t(require("react-i18next"),require("@emotion/css"),require("react-dom"),require("@formily/antd-v5"),require("@formily/reactive"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("file-saver"),require("@formily/shared"),require("@formily/core"),require("react"),require("antd"),require("@nocobase/client"),require("@nocobase/utils/client"),require("lodash")):e["@nocobase/plugin-action-import"]=t(e["react-i18next"],e["@emotion/css"],e["react-dom"],e["@formily/antd-v5"],e["@formily/reactive"],e["@formily/react"],e["@ant-design/icons"],e["@nocobase/flow-engine"],e["file-saver"],e["@formily/shared"],e["@formily/core"],e.react,e.antd,e["@nocobase/client"],e["@nocobase/utils/client"],e.lodash)}(self,function(e,t,n,r,o,i,a,l,c,u,s,p,f,m,d,y){return function(){"use strict";var v={375:function(e){e.exports=a},477:function(e){e.exports=t},418:function(e){e.exports=r},452:function(e){e.exports=s},230:function(e){e.exports=i},992:function(e){e.exports=o},166:function(e){e.exports=u},342:function(e){e.exports=m},694:function(e){e.exports=l},768:function(e){e.exports=d},59:function(e){e.exports=f},506:function(e){e.exports=c},773:function(e){e.exports=y},155:function(e){e.exports=p},514:function(e){e.exports=n},953:function(t){t.exports=e}},b={};function h(e){var t=b[e];if(void 0!==t)return t.exports;var n=b[e]={exports:{}};return v[e](n,n.exports,h),n.exports}h.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return h.d(t,{a:t}),t},h.d=function(e,t){for(var n in t)h.o(t,n)&&!h.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},h.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),h.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},h.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},h.g.importScripts&&(g=h.g.location+"");var g,x=h.g.document;if(!g&&x&&(x.currentScript&&"SCRIPT"===x.currentScript.tagName.toUpperCase()&&(g=x.currentScript.src),!g)){var S=x.getElementsByTagName("script");if(S.length)for(var w=S.length-1;w>-1&&(!g||!/^http(s?):/.test(g));)g=S[w--].src}if(!g)throw Error("Automatic publicPath is not supported in this browser");h.p=g.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var I={},O=window.__nocobase_public_path__||"";if(!O&&window.location&&window.location.pathname){var A=window.location.pathname||"/",j=A.indexOf("/v2/");O=j>=0?A.slice(0,j+1):"/"}return O&&(O=O.replace(/\/v2\/?$/,"/")),O||(O="/"),"/"!==O.charAt(O.length-1)&&(O+="/"),h.p=O+"static/plugins/@nocobase/plugin-action-import/dist/client/",!function(){h.r(I),h.d(I,{default:function(){return e_},ImportActionInitializer:function(){return f},DownloadTips:function(){return d},ImportContextProvider:function(){return en},ImportPluginProvider:function(){return et},ImportDesigner:function(){return E},ImportWarning:function(){return m},PluginActionImportClient:function(){return eq},initImportSettings:function(){return p},useImportStartAction:function(){return L},useDownloadXlsxTemplateAction:function(){return X}});var e=h(166),t=h(342),n=h(155),r=h.n(n),o=h(953);function i(){return(0,o.useTranslation)(["action-import","client"],{nsMode:"fallback"})}function a(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}var l=["createdAt","createdBy","updatedAt","updatedBy"],c=function(e){var n=(0,t.useCollectionManager_deprecated)().getCollectionFields,r=n(e),o=(0,t.useCompile)(),i=function(e,t){if(!(!e.interface||l.includes(e.interface))){var r={name:e.name,title:o(null==e||null==(i=e.uiSchema)?void 0:i.title)||e.name,schema:null==e?void 0:e.uiSchema};if(!e.target||t>=2)return r;if(e.target&&["hasOne","hasMany","belongsTo","belongsToMany","belongsToArray"].includes(e.type)){var i,u,s=c(n(e.target),t+1).filter(Boolean);r.children=r.children||[],(u=r.children).push.apply(u,function(e){if(Array.isArray(e))return a(e)}(s)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(s)||function(e){if(e){if("string"==typeof e)return a(e,void 0);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 a(e,void 0)}}(s)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}return r}},c=function(e,t){var n=[];return e.forEach(function(e){var r=i(e,t);r&&n.push(r)}),n};return c(r,1)},u=h(59),s=h(768),p=function(e){return{importColumns:null==e?void 0:e.filter(function(e){return!e.children}).map(function(e){return{dataIndex:[e.name]}}),explain:""}},f=function(){var n=(0,t.useSchemaInitializerItem)(),o=(0,t.useSchemaInitializer)().insert,i=c((0,t.useCollection_deprecated)().name),a={type:"void",title:'{{ t("Import") }}',"x-component":"ImportAction","x-action":"importXlsx","x-settings":"actionSettings:import","x-toolbar":"ActionSchemaToolbar"};return r().createElement(t.SchemaInitializerItem,{title:n.title,onClick:function(){s.lodash.set(a,"x-action-settings.importSettings",p(i));var t,r=(0,e.merge)(a||{},n.schema||{});null==n||null==(t=n.schemaInitialize)||t.call(n,r),o(r)}})},m=function(){var e=i().t;return r().createElement(u.Alert,{type:"warning",style:{marginBottom:"10px"},message:e("Import warnings",{limit:2e3})})},d=function(){var e=i().t;return r().createElement(u.Alert,{type:"info",style:{marginBottom:"10px",whiteSpace:"pre-line"},message:e("Download tips")})},y=h(418),v=h(230),b="action-import";function g(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 x(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function S(){var e=x(["\n width: 100%;\n & .ant-space-item:nth-child(2) {\n flex: 1;\n }\n "]);return S=function(){return e},e}function w(){var e=x(["\n border-color: var(--colorSettings);\n color: var(--colorSettings);\n &.ant-btn-dashed:hover {\n border-color: var(--colorSettings);\n color: var(--colorSettings);\n }\n "]);return w=function(){return e},e}var O=["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel","application/wps-office.xlsx"],A=function(){var e=(0,o.useTranslation)(b).t,n=c((0,t.useCollection_deprecated)().name),r=(0,t.useCompile)();return{importSettingsSchema:{type:"void","x-component":"Grid",properties:{explain:{type:"string",title:'{{ t("Import explain", {ns: "'.concat(b,'"}) }}'),"x-decorator":"FormItem","x-component":"Input.TextArea"},importColumns:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{className:(0,t.css)(S())},properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},dataIndex:{type:"array","x-decorator":"FormItem","x-component":t.Cascader,required:!0,"x-use-component-props":function(){return{options:r(n)}},"x-component-props":{fieldNames:{label:"title",value:"name",children:"children"},changeOnSelect:!1}},title:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{ t("Custom column title") }}'}},description:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{ t("Field description placeholder", {ns: "'.concat(b,'"}) }}')}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:'{{ t("Add importable field", {ns: "'.concat(b,'"}) }}'),"x-component":"ArrayItems.Addition","x-component-props":{className:(0,t.css)(w())}}}}}},beforeUploadHandler:function(){return!1},uploadValidator:function(t,n){if(t.length>1)return{type:"error",message:e("Only one file is allowed to be uploaded")};var r,o=null!=(r=t[0])?r:{};return O.includes(o.type)?"":{type:"error",message:e("Please upload the file of Excel")}},validateUpload:function(e,t,n){var r,o,i,a=(function(e){if(Array.isArray(e))return e}(n)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),1!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(n)||function(e){if(e){if("string"==typeof e)return g(e,1);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 g(e,1)}}(n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];t.disabled=(null==a?void 0:a.length)===0,r=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){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}({},t.componentProps),o=o={disabled:(null==a?void 0:a.length)===0||(null==(i=e.errors)?void 0:i.length)>0},Object.getOwnPropertyDescriptors?Object.defineProperties(r,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(r,e,Object.getOwnPropertyDescriptor(o,e))}),t.componentProps=r}}};function j(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 P(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}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){P(e,t,n[t])})}return e}var E=function(){var e,i,a,l,c,u,s,p=(0,v.useField)(),f=(0,v.useFieldSchema)(),m=(0,o.useTranslation)().t,d=(0,t.useDesignable)().dn,b=function(e){if(Array.isArray(e))return e}(e=(0,n.useState)())||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return j(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 j(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.")}(),h=b[0],g=b[1],x=A().importSettingsSchema;return(0,n.useEffect)(function(){g(x)},[p.address,null==f||null==(a=f["x-action-settings"])?void 0:a.importSettings]),r().createElement(t.GeneralSchemaDesigner,{disableInitializer:!0},r().createElement(t.SchemaSettingsModalItem,{title:m("Edit button"),schema:{type:"object",title:m("Edit button"),properties:{title:{"x-decorator":"FormItem","x-component":"Input",title:m("Button title"),default:f.title,"x-component-props":{}},icon:{"x-decorator":"FormItem","x-component":"IconPicker",title:m("Button icon"),default:null==f||null==(l=f["x-component-props"])?void 0:l.icon,"x-component-props":{}},type:{"x-decorator":"FormItem","x-component":"Radio.Group",title:m("Button background color"),default:(null==f||null==(c=f["x-component-props"])?void 0:c.danger)?"danger":(null==f||null==(u=f["x-component-props"])?void 0:u.type)==="primary"?"primary":"default",enum:[{value:"default",label:'{{t("Default")}}'},{value:"primary",label:'{{t("Highlight")}}'},{value:"danger",label:'{{t("Danger red")}}'}]}}},onSubmit:function(e){var t,n=e.title,r=e.icon,o=e.type;f.title=n,p.title=n,p.componentProps.icon=r,p.componentProps.danger="danger"===o,p.componentProps.type=o,f["x-component-props"]=f["x-component-props"]||{},f["x-component-props"].icon=r,f["x-component-props"].danger="danger"===o,f["x-component-props"].type=o,d.emit("patch",{schema:(P(t={},"x-uid",f["x-uid"]),P(t,"title",n),P(t,"x-component-props",C({},f["x-component-props"])),t)}),d.refresh()}}),r().createElement(t.SchemaSettingsActionModalItem,{title:m("Importable fields"),schema:h,initialValues:C({},null!=(i=null==f||null==(s=f["x-action-settings"])?void 0:s.importSettings)?i:{}),components:{ArrayItems:y.ArrayItems},onSubmit:function(e){var t,n=e.importColumns,r=e.explain,o=null==n?void 0:n.filter(function(e){var t;return null==e||null==(t=e.dataIndex)?void 0:t.length}).map(function(e){return{dataIndex:e.dataIndex.map(function(e){var t;return null!=(t=e.name)?t:e}),title:e.title}});f["x-action-settings"].importSettings={importColumns:o,explain:r},d.emit("patch",{schema:(P(t={},"x-uid",f["x-uid"]),P(t,"x-action-settings",f["x-action-settings"]),t)}),d.refresh()}}),r().createElement(t.SchemaSettingsDivider,null),r().createElement(t.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:function(e){return"Space"===e["x-component"]||e["x-component"].endsWith("ActionBar")},confirm:{title:m("Delete action")}}))},T=h(514),F=(0,n.createContext)(null);F.displayName="ImportContext";var k=function(){return(0,n.useContext)(F)},D=h(375),M=h(506);function B(){var e,t,n=(e=["\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return B=function(){return n},n}var q=function(e){var n=(0,o.useTranslation)(b).t,i=k(),a=i.importModalVisible,l=i.importStatus,c=i.importResult,s=i.setImportModalVisible,p=null!=c?c:{},f=p.data,m=p.meta,d=function(){s(!1)};return r().createElement(u.Modal,{title:n("Import Data"),width:"50%",styles:{body:{height:"calc(80vh - 200px)"}},open:a,footer:null,closable:2===l,onCancel:d},r().createElement("div",{className:(0,t.css)(B())},1===l&&r().createElement(u.Spin,{indicator:r().createElement(D.LoadingOutlined,{style:{fontSize:24},spin:!0}),tip:n("Excel data importing")}),2===l&&r().createElement(u.Space,{direction:"vertical",align:"center"},r().createElement(D.ExclamationCircleFilled,{style:{fontSize:72,color:"#1890ff"}}),r().createElement("p",null,function(e){if(!e)return null;var t=e.data,r=e.meta;if(r)return n("{{successCount}} records have been successfully imported",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){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}({},null!=r?r:{}));var o=["".concat(n("Total records"),": ").concat(t.total||0),"".concat(n("Successfully imported"),": ").concat(t.success||0)];return t.skipped>0&&o.push("".concat(n("Skipped"),": ").concat(t.skipped)),t.updated>0&&o.push("".concat(n("Updated"),": ").concat(t.updated)),o.join(", ")}(c)),r().createElement(u.Space,null,(null==m?void 0:m.failureCount)>0&&r().createElement(u.Button,{onClick:function(){var e=new Blob([new Int8Array(null==f?void 0:f.data)],{type:"application/x-xls"});(0,M.saveAs)(e,"fail.xlsx")}},n("To download the failure data")),r().createElement(u.Button,{type:"primary",onClick:d},n("Done"))))))},_=h(773),U=h.n(_);function R(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function z(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){R(i,r,o,a,l,"next",e)}function l(e){R(i,r,o,a,l,"throw",e)}a(void 0)})}}function N(e,t){var n,r,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),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)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 i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}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(){for(var e=(0,t.useActionContext)().fieldSchema,n=(0,v.useFieldSchema)(),r=e||n;r&&"importXlsx"!==r["x-action"];)console.log("schema",r=r.parent);return{schema:r}},V=function(e){return e&&Array.isArray(e)?e:[]},X=function(){var e=(0,t.useBlockRequestContext)().resource,n=(0,t.useCompile)(),r=(0,t.useCollectionManager_deprecated)(),o=r.getCollectionJoinField,i=r.getCollectionField,a=(0,t.useCollection_deprecated)(),l=a.name,c=a.title,u=$().schema;return{run:function(){return z(function(){var t,r,a,s,p,f,m;return N(this,function(d){switch(d.label){case 0:return s=(a=U().cloneDeep(null!=(t=null==u||null==(r=u["x-action-settings"])?void 0:r.importSettings)?t:{})).importColumns,p=a.explain,f=V(s).map(function(e){var t=i("".concat(l,".").concat(e.dataIndex[0]));if(t){if(e.defaultTitle=n(null==t||null==(r=t.uiSchema)?void 0:r.title)||t.name,e.dataIndex.length>1){var r,a,c=o("".concat(l,".").concat(e.dataIndex.join(".")));if(!c)return;e.defaultTitle=e.defaultTitle+"/"+n(null==c||null==(a=c.uiSchema)?void 0:a.title)||c.name}return"chinaRegion"===t.interface&&e.dataIndex.push("name"),e}}).filter(Boolean),[4,e.downloadXlsxTemplate({values:{title:n(c),explain:p,columns:n(f)}},{method:"post",responseType:"blob"})];case 1:return m=new Blob([d.sent().data],{type:"application/x-xls"}),(0,M.saveAs)(m,"".concat(n(c),".xlsx")),[2]}})})()}}},L=function(){var e,r=(0,t.useBlockRequestContext)().service,o=(0,t.useCompile)(),i=(0,t.useCollectionManager_deprecated)(),a=i.getCollectionJoinField,l=i.getCollectionField,c=(0,t.useCollection_deprecated)().name,u=$().schema,s=(0,v.useForm)(),p=(0,t.useActionContext)().setVisible,f=k(),m=f.setImportModalVisible,d=f.setImportStatus,y=f.setImportResult,b=s.values.upload,h=(0,t.useDataBlockResource)();return(0,n.useEffect)(function(){s.reset()},[]),{run:function(){return z(function(){var e,t,n,i,f,v,b,g,x,S,w,I,O,A;return N(this,function(j){switch(j.label){case 0:v=(f=U().cloneDeep(null!=(e=null==u||null==(t=u["x-action-settings"])?void 0:t.importSettings)?e:{})).importColumns,b=f.explain,g=V(v).map(function(e){var t=l("".concat(c,".").concat(e.dataIndex[0]));if(t){if(e.defaultTitle=o(null==t||null==(n=t.uiSchema)?void 0:n.title)||t.name,e.dataIndex.length>1){var n,r,i=a("".concat(c,".").concat(e.dataIndex.join(".")));if(!i)return;e.defaultTitle=e.defaultTitle+"/"+o(null==i||null==(r=i.uiSchema)?void 0:r.title)||i.name}return"chinaRegion"===t.interface&&e.dataIndex.push("name"),e}}).filter(Boolean),x=new FormData,S=s.values.upload.map(function(e){return e.originFileObj}),x.append("file",S[0]),x.append("columns",JSON.stringify(g)),x.append("explain",b),w=(null==u||null==(n=u["x-action-settings"])?void 0:n.importMode)||"auto",I=(null==u||null==(i=u["x-action-settings"])?void 0:i.timeout)||6e5,p(!1),m(!0),d(1),j.label=1;case 1:return j.trys.push([1,6,,7]),[4,h.importXlsx({values:x,mode:w,timeout:I})];case 2:if(O=j.sent().data,s.reset(),O.data.taskId)return[3,4];return y(O),[4,null==r||null==(A=r.refresh)?void 0:A.call(r)];case 3:return j.sent(),d(2),[3,5];case 4:m(!1),p(!1),j.label=5;case 5:return[3,7];case 6:return j.sent(),m(!1),p(!0),[3,7];case 7:return[2]}})})()},disabled:(null==b?void 0:b.length)===0||(null==(e=s.errors)?void 0:e.length)>0}},G=h(477);function H(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 W(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function J(){var e=W(["\n .ant-formily-item-label {\n height: var(--controlHeightLG);\n }\n "]);return J=function(){return e},e}function K(){var e=W(["\n margin-top: 5px;\n "]);return K=function(){return e},e}var Q={type:"void",name:"import-modal",title:'{{ t("Import Data", {ns: "'.concat(b,'" }) }}'),"x-component":"Action.Modal","x-decorator":"Form","x-component-props":{width:"100%",style:{maxWidth:"750px"},className:(0,G.css)(J())},properties:{formLayout:{type:"void","x-component":"FormLayout",properties:{warning:{type:"void","x-component":"ImportWarning"},download:{type:"void",title:'{{ t("Step 1: Download template", {ns: "'.concat(b,'" }) }}'),"x-component":"FormItem","x-acl-ignore":!0,properties:{tip:{type:"void","x-component":"DownloadTips"},downloadAction:{type:"void",title:'{{ t("Download template", {ns: "'.concat(b,'" }) }}'),"x-component":"Action","x-component-props":{className:(0,G.css)(K()),useAction:"{{ useDownloadXlsxTemplateAction }}"}}}},upload:{type:"array",title:'{{ t("Step 2: Upload Excel", {ns: "'.concat(b,'" }) }}'),"x-decorator":"FormItem","x-acl-ignore":!0,"x-component":"Upload.Dragger","x-validator":"{{ uploadValidator }}","x-component-props":{action:"",height:"150px",tipContent:'{{ t("Upload placeholder", {ns: "'.concat(b,'" }) }}'),beforeUpload:"{{ beforeUploadHandler }}"}}}},footer:{"x-component":"Action.Modal.Footer","x-component-props":{},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{},properties:{cancel:{type:"void",title:'{{ t("Cancel") }}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},startImport:{type:"void",title:'{{ t("Start import", {ns: "'.concat(b,'" }) }}'),"x-component":"Action","x-component-props":{type:"primary",htmlType:"submit",useAction:"{{ useImportStartAction }}"},"x-reactions":{dependencies:["upload"],fulfill:{run:"validateUpload($form, $self, $deps)"}}}}}}}}},Y=function(e){var o,i,a,l=function(e){if(Array.isArray(e))return e}(o=(0,n.useState)(!1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(o)||function(e){if(e){if("string"==typeof e)return H(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 H(e,2)}}(o)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),c=l[0],u=l[1],s=(0,t.useCompile)(),p=(0,v.useFieldSchema)();return r().createElement(t.ActionContextProvider,{value:{visible:c,setVisible:u,fieldSchema:p}},r().createElement(t.Action,(i=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){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}({icon:e.icon||"uploadoutlined",title:s((null==p?void 0:p.title)||"t('Import')")},e),a=a={onClick:function(){return u(!0)}},Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(a)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(a,e))}),i)),r().createElement(t.SchemaComponent,{schema:Q}))};function Z(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 ee(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 i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Z(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 Z(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.")}()}var et=function(e){var n=A(),o=n.uploadValidator,i=n.beforeUploadHandler,a=n.validateUpload;return r().createElement(t.SchemaComponentOptions,{components:{ImportActionInitializer:f,ImportDesigner:E,ImportWarning:m,DownloadTips:d,ImportAction:Y},scope:{uploadValidator:o,validateUpload:a,beforeUploadHandler:i,useDownloadXlsxTemplateAction:X,useImportStartAction:L}},r().createElement(en,null,e.children))},en=function(e){var t=ee((0,n.useState)(!1),2),o=t[0],i=t[1],a=ee((0,n.useState)(1),2),l=a[0],c=a[1],u=ee((0,n.useState)(null),2),s=u[0],p=u[1];return r().createElement(F.Provider,{value:{importModalVisible:o,setImportModalVisible:i,importStatus:l,setImportStatus:c,importResult:s,setImportResult:p}},(0,T.createPortal)(r().createElement(q,null),document.body),e.children)};function er(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 eo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ei(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){eo(e,t,n[t])})}return e}var ea=new t.SchemaSettings({name:"actionSettings:import",items:[{name:"editButton",Component:t.ButtonEditor,useComponentProps:function(){return(0,t.useSchemaToolbar)().buttonEditorProps}},{name:"linkageRules",Component:t.SchemaSettingsLinkageRules,useComponentProps:function(){return ei({},(0,t.useSchemaToolbar)().linkageRulesProps)}},{name:"importableFields",type:"actionModal",useComponentProps:function(){var e,r,i,a,l=(0,v.useField)(),c=(0,v.useFieldSchema)(),u=(0,o.useTranslation)().t,s=(0,t.useDesignable)().dn,p=function(e){if(Array.isArray(e))return e}(e=(0,n.useState)())||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return er(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 er(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.")}(),f=p[0],m=p[1],d=A().importSettingsSchema;return(0,n.useEffect)(function(){m(d)},[l.address,null==c||null==(i=c["x-action-settings"])?void 0:i.importSettings]),{title:u("Importable fields"),schema:ei({},f),initialValues:ei({},null!=(r=null==c||null==(a=c["x-action-settings"])?void 0:a.importSettings)?r:{}),components:{ArrayItems:y.ArrayItems},onSubmit:function(e){var t,n=e.importColumns,r=e.explain,o=null==n?void 0:n.filter(function(e){var t;return null==e||null==(t=e.dataIndex)?void 0:t.length}).map(function(e){return{dataIndex:e.dataIndex.map(function(e){var t;return null!=(t=e.name)?t:e}),title:e.title,description:e.description}});c["x-action-settings"].importSettings={importColumns:o,explain:r},s.emit("patch",{schema:(eo(t={},"x-uid",c["x-uid"]),eo(t,"x-action-settings",c["x-action-settings"]),t)}),s.refresh()}}}},{name:"divider",type:"divider"},{name:"delete",type:"remove",useComponentProps:function(){return{removeParentsIfNoChildren:!0,breakRemoveOn:function(e){return"Space"===e["x-component"]||e["x-component"].endsWith("ActionBar")},confirm:{title:(0,(0,o.useTranslation)().t)("Delete action")}}}}]}),el=h(452),ec=h(992),eu=h(694);function es(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}var ep=["createdAt","createdBy","updatedAt","updatedBy"],ef=function(e,t){var n=function(e,n){if(!(!e.interface||ep.includes(e.interface))){var o={name:e.name,title:t(null==e||null==(i=e.uiSchema)?void 0:i.title)||e.name,schema:null==e?void 0:e.uiSchema};if(!e.target||n>=2)return o;if(e.target&&["hasOne","hasMany","belongsTo","belongsToMany","belongsToArray"].includes(e.type)){var i,a,l=r(e.targetCollection&&e.targetCollection.getFields()||[],n+1).filter(Boolean);o.children=o.children||[],(a=o.children).push.apply(a,function(e){if(Array.isArray(e))return es(e)}(l)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(l)||function(e){if(e){if("string"==typeof e)return es(e,void 0);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 es(e,void 0)}}(l)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}return o}},r=function(e,t){var r=[];return e.forEach(function(e){var o=n(e,t);o&&r.push(o)}),r};return r(e,1)};function em(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 ed(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function ey(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ed(i,r,o,a,l,"next",e)}function l(e){ed(i,r,o,a,l,"throw",e)}a(void 0)})}}function ev(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eb(e){return(eb=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eh(e,t){return(eh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eg(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ex(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ex=function(){return!!e})()}function eS(e,t){var n,r,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),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)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 i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}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 ew(){var e=eg(["\n margin-top: 5px;\n "]);return ew=function(){return e},e}function eI(){var e=eg(["\n width: 100%;\n & .ant-space-item:nth-child(2) {\n flex: 1;\n }\n "]);return eI=function(){return e},e}function eO(){var e=eg(["\n border-color: var(--colorSettings);\n color: var(--colorSettings);\n &.ant-btn-dashed:hover {\n border-color: var(--colorSettings);\n color: var(--colorSettings);\n }\n "]);return eO=function(){return e},e}var eA=["id","createdAt","createdBy","updatedAt","updatedBy"],ej=["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel","application/wps-office.xlsx"],eP={type:"object",properties:{warning:{type:"void","x-component":"ImportWarning"},download:{type:"void",title:(0,eu.escapeT)("Step 1: Download template",{ns:"".concat(b)}),"x-component":"FormItem",properties:{tip:{type:"void","x-component":"DownloadTips"},downloadAction:{type:"void",title:(0,eu.escapeT)("Download template",{ns:"".concat(b)}),"x-component":"Button","x-component-props":{className:(0,G.css)(ew()),children:(0,eu.escapeT)("Download template",{ns:"".concat(b)}),onClick:"{{ handelDownloadXlsxTemplateAction }}"}}}},upload:{type:"array",title:(0,eu.escapeT)("Step 2: Upload Excel",{ns:"".concat(b)}),"x-decorator":"FormItem","x-acl-ignore":!0,"x-component":"Upload.Dragger","x-validator":function(e,t){var n,r=e.fileList;if(r.length>1)return{type:"error",message:(0,eu.escapeT)("Only one file is allowed to be uploaded")};var o=null!=(n=r[0])?n:{};return ej.includes(o.type)?"":{type:"error",message:(0,eu.escapeT)("Please upload the file of Excel")}},"x-component-props":{action:"",height:"150px",maxCount:1,children:(0,eu.escapeT)("Upload placeholder",{ns:"".concat(b)}),beforeUpload:function(){return!1}}}}},eC=(0,v.createSchemaField)({components:{ImportWarning:m,DownloadTips:d,Upload:u.Upload,FormItem:y.FormItem,Button:u.Button}}),eE=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=eb(t),ev(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,ex()?Reflect.construct(t,r||[],eb(this).constructor):t.apply(this,r)),"defaultProps",{title:(0,eu.escapeT)("Import"),type:"default",icon:"uploadoutlined"}),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&eh(n,e),t=[{key:"getAclActionName",value:function(){return"importXlsx"}}],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)}}(n.prototype,t),n}(t.ActionModel);function eT(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function eF(e,t,n){return(eF=eB()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&eD(o,n.prototype),o}).apply(null,arguments)}ev(eE,"scene",t.ActionSceneEnum.collection),eE.define({label:(0,eu.escapeT)("Import")}),eE.registerFlow({key:"importSettings",title:(0,eu.escapeT)("Import settings"),on:"click",steps:{import:{handler:function(e,t){return ey(function(){var t,n,o,i,a,l,c,s,p,f,m,d;return eS(this,function(h){switch(h.label){case 0:var g;return t=(0,ec.observable)({status:"",result:null}),n=(0,el.createForm)(),i=(o=e.model.context.blockModel).resource,l=(a=o.collection).title,c=a.name,p=(s=e.model.getProps().importSettings).explain,f=(!(g=s.importColumns)||!Array.isArray(g)?[]:g).map(function(t){var n=e.model.context.dataSourceManager.getCollectionField("".concat(o.collection.dataSourceKey,".").concat(c,".").concat(t.dataIndex[0]));if(n){if(t.defaultTitle=e.t(null==n||null==(r=n.uiSchema)?void 0:r.title)||n.name,t.dataIndex.length>1){var r,i,a=e.model.context.dataSourceManager.getCollectionField("".concat(e.model.context.collection.dataSourceKey,".").concat(c,".").concat(t.dataIndex.join(".")));if(!a)return;t.defaultTitle=t.defaultTitle+"/"+e.t(null==a||null==(i=a.uiSchema)?void 0:i.title)||a.name}return t}}).filter(Boolean),m=function(){return ey(function(){var t;return eS(this,function(n){switch(n.label){case 0:return[4,i.runAction("downloadXlsxTemplate",{data:{title:e.t(l),explain:p,columns:function(e){if(Array.isArray(e))return em(e)}(f)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(f)||function(e){if(e){if("string"==typeof e)return em(e,void 0);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 em(e,void 0)}}(f)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},responseType:"blob",method:"post"})];case 1:return t=new Blob([n.sent()],{type:"application/x-xls"}),(0,M.saveAs)(t,"".concat(e.t(l),".xlsx")),[2]}})})()},d=(0,eu.observer)(function(o){var a=o.popover,l=e.t;if("importing"===t.status)return r().createElement("div",{style:{display:"flex",justifyContent:"center",padding:40}},r().createElement(u.Spin,{tip:l("Excel data importing"),indicator:r().createElement(D.LoadingOutlined,{spin:!0,style:{fontSize:24}})}));if("imported"===t.status){var c,s,d,h=null==(d=t.result)?void 0:d.meta;return r().createElement(u.Space,{direction:"vertical",align:"center",style:{width:"100%",padding:24}},r().createElement(D.ExclamationCircleFilled,{style:{fontSize:72,color:"#1890ff"}}),r().createElement("p",null,function(e){if(!e)return null;var t=e.successCount;if(e.meta,t)return l("{{successCount}} records have been successfully imported",{successCount:t},{ns:b})}(t.result)),r().createElement(u.Space,null,(null==h?void 0:h.failureCount)>0&&r().createElement(u.Button,{onClick:function(){var e,n,r=new Blob([new Int8Array(null==(n=t.result)||null==(e=n.data)?void 0:e.data)],{type:"application/x-xls"});(0,M.saveAs)(r,"fail.xlsx")}},l("To download the failure data")),r().createElement(u.Button,{type:"primary",onClick:function(){a.close(),t.status="",t.result=null}},l("Done"))))}return r().createElement(v.FormProvider,{form:n},r().createElement(y.FormLayout,{layout:"vertical"},r().createElement(eC,{schema:eP,scope:{t:e.t,handelDownloadXlsxTemplateAction:m}})),r().createElement(y.FormButtonGroup,{align:"right"},r().createElement(u.Button,{onClick:function(){return a.close()}},l("Cancel")),r().createElement(u.Button,{type:"primary",onClick:function(){return ey(function(){var r,o,l,c,u,s,m,d;return eS(this,function(y){switch(y.label){case 0:r=n.values.upload.fileList,o=new FormData,l=r.map(function(e){return e.originFileObj}),o.append("file",l[0]),o.append("columns",JSON.stringify(f)),o.append("explain",p),c=e.model.getProps().importMode,t.status="importing",y.label=1;case 1:return y.trys.push([1,6,,7]),[4,i.runAction("importXlsx",{data:o,mode:c,timeout:6e5})];case 2:if(null==(s=y.sent().data)||null==(u=s.data)?void 0:u.taskId)return[3,4];return t.result=s,t.status="imported",[4,null==i||null==(m=i.refresh)?void 0:m.call(i)];case 3:return y.sent(),n.reset(),[3,5];case 4:a.close(),n.reset(),y.label=5;case 5:return[3,7];case 6:return d=y.sent(),t.status="",console.error(d),[3,7];case 7:return[2]}})})()},disabled:!(null==(s=n.values.upload)||null==(c=s.fileList)?void 0:c.length)},l("Start import",{ns:"".concat(b)}))))}),[4,e.viewer.open({type:"dialog",placement:"center",width:800,title:e.t("Import Data",{ns:"".concat(b)}),content:function(e){return r().createElement(d,{popover:e})}})];case 1:return h.sent(),[2]}})})()}}}}),eE.registerFlow({key:"importActionSetting",title:(0,eu.escapeT)("Import action settings",{ns:b}),steps:{importSetting:{title:(0,eu.escapeT)("Importable fields"),uiSchema:function(e){var n=ef(e.model.context.blockModel.collection.getFields(),e.t);return{explain:{type:"string",title:'{{ t("Import explain", {ns: "'.concat(b,'"}) }}'),"x-decorator":"FormItem","x-component":"Input.TextArea"},importColumns:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{className:(0,G.css)(eI())},properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},dataIndex:{type:"array","x-decorator":"FormItem","x-component":t.Cascader,required:!0,"x-component-props":{fieldNames:{label:"title",value:"name",children:"children"},changeOnSelect:!1,options:n}},title:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{ t("Custom column title") }}'}},description:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{ t("Field description placeholder", {ns: "'.concat(b,'"}) }}')}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:'{{ t("Add importable field", {ns: "'.concat(b,'"}) }}'),"x-component":"ArrayItems.Addition","x-component-props":{className:(0,G.css)(eO())}}}}}},defaultParams:function(e){var t;return 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){ev(e,t,n[t])})}return e}({},{importColumns:null==(t=e.model.context.blockModel.collection.getFields())?void 0:t.filter(function(e){return!e.isAssociationField()&&!(eA.includes(e.interface)||!e.options.interface)}).map(function(e){return{dataIndex:[e.name]}}),explain:""})},handler:function(e,t){var n=t.importColumns,r=t.explain,o=null==n?void 0:n.filter(function(e){var t;return null==e||null==(t=e.dataIndex)?void 0:t.length}).map(function(e){return{dataIndex:e.dataIndex.map(function(e){var t;return null!=(t=e.name)?t:e}),title:e.title,description:e.description}});e.model.setProps("importSettings",{importColumns:o,explain:r})}}}});function ek(e){return(ek=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eD(e,t){return(eD=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eM(e){var t="function"==typeof Map?new Map:void 0;return(eM=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 eF(e,arguments,ek(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),eD(n,e)})(e)}function eB(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(eB=function(){return!!e})()}var eq=function(e){var n;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=ek(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,eB()?Reflect.construct(e,t||[],ek(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&eD(r,e),n=[{key:"load",value:function(){var e;return(e=function(){var e,n;return function(e,t){var n,r,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),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)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 i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}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}}}}(this,function(r){return this.app.use(et),e={title:"{{t('Import')}}",Component:"ImportActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action":"importXlsx","x-acl-action-props":{skipScopeCheck:!0}},useVisible:function(){return(0,t.useActionAvailable)("importXlsx")}},null==(n=this.app.schemaInitializerManager.get("table:configureActions"))||n.add("enableActions.import",e),this.app.schemaInitializerManager.addItem("gantt:configureActions","enableActions.import",e),this.app.schemaSettingsManager.add(ea),this.app.flowEngine.registerModels({ImportActionModel:eE}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){eT(i,r,o,a,l,"next",e)}function l(e){eT(i,r,o,a,l,"throw",e)}a(void 0)})}).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)}}(r.prototype,n),r}(eM(t.Plugin)),e_=eq}(),I}()});
@@ -10,26 +10,26 @@
10
10
  module.exports = {
11
11
  "@emotion/css": "11.13.0",
12
12
  "@formily/react": "2.3.7",
13
- "@nocobase/client": "2.1.0-alpha.1",
13
+ "@nocobase/client": "2.1.0-alpha.11",
14
14
  "react": "18.2.0",
15
15
  "react-i18next": "11.18.6",
16
16
  "@ant-design/icons": "5.6.1",
17
17
  "@formily/shared": "2.3.7",
18
18
  "antd": "5.24.2",
19
- "@nocobase/utils": "2.1.0-alpha.1",
19
+ "@nocobase/utils": "2.1.0-alpha.11",
20
20
  "@formily/antd-v5": "1.2.3",
21
21
  "file-saver": "2.0.5",
22
22
  "react-dom": "18.2.0",
23
23
  "lodash": "4.17.21",
24
24
  "@formily/core": "2.3.7",
25
- "@nocobase/server": "2.1.0-alpha.1",
25
+ "@nocobase/flow-engine": "2.1.0-alpha.11",
26
+ "@nocobase/server": "2.1.0-alpha.11",
26
27
  "@formily/reactive": "2.3.7",
27
- "@nocobase/flow-engine": "2.1.0-alpha.1",
28
- "@nocobase/actions": "2.1.0-alpha.1",
29
- "@nocobase/database": "2.1.0-alpha.1",
28
+ "@nocobase/actions": "2.1.0-alpha.11",
29
+ "@nocobase/database": "2.1.0-alpha.11",
30
30
  "async-mutex": "0.5.0",
31
- "@nocobase/data-source-manager": "2.1.0-alpha.1",
31
+ "@nocobase/data-source-manager": "2.1.0-alpha.11",
32
32
  "sequelize": "6.35.2",
33
- "@nocobase/logger": "2.1.0-alpha.1",
34
- "mathjs": "10.6.4"
33
+ "@nocobase/logger": "2.1.0-alpha.11",
34
+ "mathjs": "15.1.0"
35
35
  };
@@ -1 +1 @@
1
- {"name":"exceljs","version":"4.4.0","description":"Excel Workbook Manager - Read and Write xlsx and csv Files.","private":false,"license":"MIT","author":{"name":"Guyon Roche","email":"guyon@live.com"},"repository":{"type":"git","url":"https://github.com/exceljs/exceljs.git"},"engines":{"node":">=8.3.0"},"main":"./excel.js","browser":"./dist/exceljs.min.js","types":"./index.d.ts","files":["dist","lib","excel.js","LICENSE","README.md","README_zh.md","index.ts","index.d.ts"],"scripts":{"test":"npm run test:full","test:es5":"export EXCEL_BUILD=es5 && npm run test:full","test:full":"npm run build && npm run test:unit && npm run test:integration && npm run test:end-to-end && npm run test:jasmine","test:version":"npm run build && npm run test:unit && npm run test:integration && npm run test:end-to-end && npm run test:browser && npm run test:dist","test:all":"npm run test:native && npm run test:es5","test:native":"npm run test:full","test:unit":"mocha --require spec/config/setup --require spec/config/setup-unit spec/unit --recursive","test:integration":"mocha --require spec/config/setup spec/integration --recursive","test:end-to-end":"mocha --require spec/config/setup spec/end-to-end --recursive","test:browser":"if [ ! -f .disable-test-browser ]; then npm run build && npm run test:jasmine; fi","test:jasmine":"grunt jasmine","test:unit:es5":"export EXCEL_BUILD=es5 && npm run test:unit","test:integration:es5":"export EXCEL_BUILD=es5 && npm run test:integration","test:end-to-end:es5":"export EXCEL_BUILD=es5 && npm run test:end-to-end","test:dist":"mocha --require spec/config/setup spec/dist --recursive","test:manual":"node spec/manual/app.js","test:typescript":"mocha -r ts-node/register spec/typescript/**/*.spec.ts","clean-build":"npm run clean && npm run build","lint":"eslint --format node_modules/eslint-friendly-formatter .","lint:fix":"prettier-eslint --write $(pwd)'/**/*.js'","lint:staged":"lint-staged","clean":"rm -rf build/ && rm -rf dist","benchmark":"node --expose-gc benchmark","benchmark:debug":"node --expose-gc --inspect-brk --trace-deopt benchmark","build":"grunt build","install-build":"npm install && grunt build","preversion":"npm run clean && npm run build && npm run test:version","postversion":"git push --no-verify && git push --tags --no-verify"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.js":["prettier-eslint --write","eslint --format node_modules/eslint-friendly-formatter","git add"]},"keywords":["xlsx","json","csv","excel","font","border","fill","number","format","number format","alignment","office","spreadsheet","workbook","defined names","data validations","rich text","in-cell format","outlineLevel","views","frozen","split","pageSetup"],"dependencies":{"archiver":"^5.0.0","dayjs":"^1.8.34","fast-csv":"^4.3.1","jszip":"^3.10.1","readable-stream":"^3.6.0","saxes":"^5.0.1","tmp":"^0.2.0","unzipper":"^0.10.11","uuid":"^8.3.0"},"devDependencies":{"@babel/cli":"^7.10.5","@babel/core":"^7.11.4","@babel/preset-env":"^7.11.0","@types/chai":"^4.2.12","@types/mocha":"^8.0.3","@types/node":"^14.11.2","babelify":"^10.0.0","browserify":"^16.5.2","chai":"^4.2.0","chai-datetime":"^1.7.0","chai-xml":"^0.3.2","core-js":"^3.6.5","dirty-chai":"^2.0.1","eslint":"^6.5.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.12.0","eslint-friendly-formatter":"^4.0.1","eslint-plugin-import":"^2.22.0","eslint-plugin-node":"^11.1.0","express":"^4.16.4","got":"^9.0.0","grunt":"^1.3.0","grunt-babel":"^8.0.0","grunt-browserify":"^5.3.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-jasmine":"^2.2.0","grunt-contrib-watch":"^1.1.0","grunt-exorcise":"^2.1.1","grunt-terser":"^1.0.0","husky":"^4.3.0","lint-staged":"^10.2.13","mocha":"^7.2.0","prettier-eslint":"^11.0.0","prettier-eslint-cli":"^5.0.0","regenerator-runtime":"^0.13.7","sax":"^1.2.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"_lastModified":"2025-12-31T16:43:37.826Z"}
1
+ {"name":"exceljs","version":"4.4.0","description":"Excel Workbook Manager - Read and Write xlsx and csv Files.","private":false,"license":"MIT","author":{"name":"Guyon Roche","email":"guyon@live.com"},"repository":{"type":"git","url":"https://github.com/exceljs/exceljs.git"},"engines":{"node":">=8.3.0"},"main":"./excel.js","browser":"./dist/exceljs.min.js","types":"./index.d.ts","files":["dist","lib","excel.js","LICENSE","README.md","README_zh.md","index.ts","index.d.ts"],"scripts":{"test":"npm run test:full","test:es5":"export EXCEL_BUILD=es5 && npm run test:full","test:full":"npm run build && npm run test:unit && npm run test:integration && npm run test:end-to-end && npm run test:jasmine","test:version":"npm run build && npm run test:unit && npm run test:integration && npm run test:end-to-end && npm run test:browser && npm run test:dist","test:all":"npm run test:native && npm run test:es5","test:native":"npm run test:full","test:unit":"mocha --require spec/config/setup --require spec/config/setup-unit spec/unit --recursive","test:integration":"mocha --require spec/config/setup spec/integration --recursive","test:end-to-end":"mocha --require spec/config/setup spec/end-to-end --recursive","test:browser":"if [ ! -f .disable-test-browser ]; then npm run build && npm run test:jasmine; fi","test:jasmine":"grunt jasmine","test:unit:es5":"export EXCEL_BUILD=es5 && npm run test:unit","test:integration:es5":"export EXCEL_BUILD=es5 && npm run test:integration","test:end-to-end:es5":"export EXCEL_BUILD=es5 && npm run test:end-to-end","test:dist":"mocha --require spec/config/setup spec/dist --recursive","test:manual":"node spec/manual/app.js","test:typescript":"mocha -r ts-node/register spec/typescript/**/*.spec.ts","clean-build":"npm run clean && npm run build","lint":"eslint --format node_modules/eslint-friendly-formatter .","lint:fix":"prettier-eslint --write $(pwd)'/**/*.js'","lint:staged":"lint-staged","clean":"rm -rf build/ && rm -rf dist","benchmark":"node --expose-gc benchmark","benchmark:debug":"node --expose-gc --inspect-brk --trace-deopt benchmark","build":"grunt build","install-build":"npm install && grunt build","preversion":"npm run clean && npm run build && npm run test:version","postversion":"git push --no-verify && git push --tags --no-verify"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.js":["prettier-eslint --write","eslint --format node_modules/eslint-friendly-formatter","git add"]},"keywords":["xlsx","json","csv","excel","font","border","fill","number","format","number format","alignment","office","spreadsheet","workbook","defined names","data validations","rich text","in-cell format","outlineLevel","views","frozen","split","pageSetup"],"dependencies":{"archiver":"^5.0.0","dayjs":"^1.8.34","fast-csv":"^4.3.1","jszip":"^3.10.1","readable-stream":"^3.6.0","saxes":"^5.0.1","tmp":"^0.2.0","unzipper":"^0.10.11","uuid":"^8.3.0"},"devDependencies":{"@babel/cli":"^7.10.5","@babel/core":"^7.11.4","@babel/preset-env":"^7.11.0","@types/chai":"^4.2.12","@types/mocha":"^8.0.3","@types/node":"^14.11.2","babelify":"^10.0.0","browserify":"^16.5.2","chai":"^4.2.0","chai-datetime":"^1.7.0","chai-xml":"^0.3.2","core-js":"^3.6.5","dirty-chai":"^2.0.1","eslint":"^6.5.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.12.0","eslint-friendly-formatter":"^4.0.1","eslint-plugin-import":"^2.22.0","eslint-plugin-node":"^11.1.0","express":"^4.16.4","got":"^9.0.0","grunt":"^1.3.0","grunt-babel":"^8.0.0","grunt-browserify":"^5.3.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-jasmine":"^2.2.0","grunt-contrib-watch":"^1.1.0","grunt-exorcise":"^2.1.1","grunt-terser":"^1.0.0","husky":"^4.3.0","lint-staged":"^10.2.13","mocha":"^7.2.0","prettier-eslint":"^11.0.0","prettier-eslint-cli":"^5.0.0","regenerator-runtime":"^0.13.7","sax":"^1.2.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"_lastModified":"2026-03-25T08:48:27.143Z"}
@@ -1 +1 @@
1
- {"name":"xlsx","version":"0.20.2","author":"sheetjs","description":"SheetJS Spreadsheet data parser and writer","keywords":["excel","xls","xlsx","xlsb","xlsm","ods","csv","dbf","dif","sylk","office","spreadsheet"],"bin":{"xlsx":"./bin/xlsx.njs"},"main":"xlsx.js","module":"xlsx.mjs","unpkg":"dist/xlsx.full.min.js","jsdelivr":"dist/xlsx.full.min.js","types":"types/index.d.ts","exports":{".":{"import":"./xlsx.mjs","require":"./xlsx.js","types":"./types/index.d.ts"},"./xlsx.mjs":{"import":"./xlsx.mjs","types":"./types/index.d.ts"},"./xlsx.js":{"require":"./xlsx.js","types":"./types/index.d.ts"},"./dist/xlsx.core.min":{"import":"./dist/xlsx.core.min.js","require":"./dist/xlsx.core.min.js","types":"./types/index.d.ts"},"./dist/xlsx.core.min.js":{"import":"./dist/xlsx.core.min.js","require":"./dist/xlsx.core.min.js","types":"./types/index.d.ts"},"./dist/xlsx.full.min":{"import":"./dist/xlsx.full.min.js","require":"./dist/xlsx.full.min.js","types":"./types/index.d.ts"},"./dist/xlsx.full.min.js":{"import":"./dist/xlsx.full.min.js","require":"./dist/xlsx.full.min.js","types":"./types/index.d.ts"},"./dist/xlsx.mini.min":{"import":"./dist/xlsx.mini.min.js","require":"./dist/xlsx.mini.min.js","types":"./types/index.d.ts"},"./dist/xlsx.mini.min.js":{"import":"./dist/xlsx.mini.min.js","require":"./dist/xlsx.mini.min.js","types":"./types/index.d.ts"},"./dist/xlsx.zahl":{"import":"./dist/xlsx.zahl.mjs","require":"./dist/xlsx.zahl.js","types":"./dist/zahl.d.ts"},"./dist/xlsx.zahl.mjs":{"import":"./dist/xlsx.zahl.mjs","types":"./dist/zahl.d.ts"},"./dist/xlsx.zahl.js":{"require":"./dist/xlsx.zahl.js","types":"./dist/zahl.d.ts"},"./dist/cpexcel":{"import":"./dist/cpexcel.full.mjs","require":"./dist/cpexcel.js","types":"./dist/cpexcel.d.ts"},"./dist/cpexcel.js":{"require":"./dist/cpexcel.js","types":"./dist/cpexcel.d.ts"},"./dist/cpexcel.full":{"import":"./dist/cpexcel.full.mjs","require":"./dist/cpexcel.js","types":"./dist/cpexcel.d.ts"},"./dist/cpexcel.full.mjs":{"import":"./dist/cpexcel.full.mjs","types":"./dist/cpexcel.d.ts"}},"browser":{"buffer":false,"crypto":false,"stream":false,"process":false,"fs":false},"sideEffects":false,"dependencies":{},"devDependencies":{"@sheetjs/uglify-js":"~2.7.3","@types/node":"^8.5.9","acorn":"7.4.1","adler-32":"~1.3.1","alex":"8.1.1","blanket":"~1.2.3","cfb":"~1.2.2","codepage":"~1.15.0","commander":"~2.17.1","crc-32":"~1.2.2","dtslint":"^0.1.2","eslint":"7.23.0","eslint-plugin-html":"^6.1.2","eslint-plugin-json":"^2.1.2","exit-on-epipe":"~1.0.1","fflate":"^0.7.1","jsdom":"~11.1.0","markdown-spellcheck":"^1.3.1","mocha":"~2.5.3","sinon":"^1.17.7","ssf":"~0.11.2","typescript":"2.2.0","wmf":"~1.0.1","word":"~0.3.0"},"repository":{"type":"git","url":"https://git.sheetjs.com/SheetJS/sheetjs"},"scripts":{"pretest":"npm run lint","test":"npm run tests-only","pretest-only":"git submodule init && git submodule update","tests-only":"make travis","build":"make","lint":"make fullint","dtslint":"dtslint types"},"config":{"blanket":{"pattern":"xlsx.js"}},"alex":{"allow":["chinese","special","simple","just","crash","wtf","holes"]},"homepage":"https://sheetjs.com/","files":["CHANGELOG.md","LICENSE","README.md","bower.json","package.json","xlsx.js","xlsx.mjs","xlsxworker.js","bin/xlsx.njs","dist/LICENSE","dist/*.mjs","dist/*.js","dist/*.map","dist/*.d.ts","types/index.d.ts","types/tsconfig.json"],"bugs":{"url":"https://git.sheetjs.com/SheetJS/sheetjs/issues"},"license":"Apache-2.0","engines":{"node":">=0.8"},"_lastModified":"2025-12-31T16:43:40.748Z"}
1
+ {"name":"xlsx","version":"0.20.2","author":"sheetjs","description":"SheetJS Spreadsheet data parser and writer","keywords":["excel","xls","xlsx","xlsb","xlsm","ods","csv","dbf","dif","sylk","office","spreadsheet"],"bin":{"xlsx":"./bin/xlsx.njs"},"main":"xlsx.js","module":"xlsx.mjs","unpkg":"dist/xlsx.full.min.js","jsdelivr":"dist/xlsx.full.min.js","types":"types/index.d.ts","exports":{".":{"import":"./xlsx.mjs","require":"./xlsx.js","types":"./types/index.d.ts"},"./xlsx.mjs":{"import":"./xlsx.mjs","types":"./types/index.d.ts"},"./xlsx.js":{"require":"./xlsx.js","types":"./types/index.d.ts"},"./dist/xlsx.core.min":{"import":"./dist/xlsx.core.min.js","require":"./dist/xlsx.core.min.js","types":"./types/index.d.ts"},"./dist/xlsx.core.min.js":{"import":"./dist/xlsx.core.min.js","require":"./dist/xlsx.core.min.js","types":"./types/index.d.ts"},"./dist/xlsx.full.min":{"import":"./dist/xlsx.full.min.js","require":"./dist/xlsx.full.min.js","types":"./types/index.d.ts"},"./dist/xlsx.full.min.js":{"import":"./dist/xlsx.full.min.js","require":"./dist/xlsx.full.min.js","types":"./types/index.d.ts"},"./dist/xlsx.mini.min":{"import":"./dist/xlsx.mini.min.js","require":"./dist/xlsx.mini.min.js","types":"./types/index.d.ts"},"./dist/xlsx.mini.min.js":{"import":"./dist/xlsx.mini.min.js","require":"./dist/xlsx.mini.min.js","types":"./types/index.d.ts"},"./dist/xlsx.zahl":{"import":"./dist/xlsx.zahl.mjs","require":"./dist/xlsx.zahl.js","types":"./dist/zahl.d.ts"},"./dist/xlsx.zahl.mjs":{"import":"./dist/xlsx.zahl.mjs","types":"./dist/zahl.d.ts"},"./dist/xlsx.zahl.js":{"require":"./dist/xlsx.zahl.js","types":"./dist/zahl.d.ts"},"./dist/cpexcel":{"import":"./dist/cpexcel.full.mjs","require":"./dist/cpexcel.js","types":"./dist/cpexcel.d.ts"},"./dist/cpexcel.js":{"require":"./dist/cpexcel.js","types":"./dist/cpexcel.d.ts"},"./dist/cpexcel.full":{"import":"./dist/cpexcel.full.mjs","require":"./dist/cpexcel.js","types":"./dist/cpexcel.d.ts"},"./dist/cpexcel.full.mjs":{"import":"./dist/cpexcel.full.mjs","types":"./dist/cpexcel.d.ts"}},"browser":{"buffer":false,"crypto":false,"stream":false,"process":false,"fs":false},"sideEffects":false,"dependencies":{},"devDependencies":{"@sheetjs/uglify-js":"~2.7.3","@types/node":"^8.5.9","acorn":"7.4.1","adler-32":"~1.3.1","alex":"8.1.1","blanket":"~1.2.3","cfb":"~1.2.2","codepage":"~1.15.0","commander":"~2.17.1","crc-32":"~1.2.2","dtslint":"^0.1.2","eslint":"7.23.0","eslint-plugin-html":"^6.1.2","eslint-plugin-json":"^2.1.2","exit-on-epipe":"~1.0.1","fflate":"^0.7.1","jsdom":"~11.1.0","markdown-spellcheck":"^1.3.1","mocha":"~2.5.3","sinon":"^1.17.7","ssf":"~0.11.2","typescript":"2.2.0","wmf":"~1.0.1","word":"~0.3.0"},"repository":{"type":"git","url":"https://git.sheetjs.com/SheetJS/sheetjs"},"scripts":{"pretest":"npm run lint","test":"npm run tests-only","pretest-only":"git submodule init && git submodule update","tests-only":"make travis","build":"make","lint":"make fullint","dtslint":"dtslint types"},"config":{"blanket":{"pattern":"xlsx.js"}},"alex":{"allow":["chinese","special","simple","just","crash","wtf","holes"]},"homepage":"https://sheetjs.com/","files":["CHANGELOG.md","LICENSE","README.md","bower.json","package.json","xlsx.js","xlsx.mjs","xlsxworker.js","bin/xlsx.njs","dist/LICENSE","dist/*.mjs","dist/*.js","dist/*.map","dist/*.d.ts","types/index.d.ts","types/tsconfig.json"],"bugs":{"url":"https://git.sheetjs.com/SheetJS/sheetjs/issues"},"license":"Apache-2.0","engines":{"node":">=0.8"},"_lastModified":"2026-03-25T08:48:29.764Z"}
@@ -0,0 +1,10 @@
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 type { FlowSchemaContribution } from '@nocobase/flow-engine';
10
+ export declare const flowSchemaContribution: FlowSchemaContribution;
@@ -0,0 +1,122 @@
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
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var flow_schema_contributions_exports = {};
28
+ __export(flow_schema_contributions_exports, {
29
+ flowSchemaContribution: () => flowSchemaContribution
30
+ });
31
+ module.exports = __toCommonJS(flow_schema_contributions_exports);
32
+ const importColumnSchema = {
33
+ type: "object",
34
+ properties: {
35
+ dataIndex: {
36
+ type: "array",
37
+ items: { type: "string" },
38
+ minItems: 1
39
+ },
40
+ title: { type: "string" },
41
+ description: { type: "string" }
42
+ },
43
+ required: ["dataIndex"],
44
+ additionalProperties: false
45
+ };
46
+ const importActionModelSchemaContribution = {
47
+ use: "ImportActionModel",
48
+ title: "Import action",
49
+ source: "plugin",
50
+ strict: false,
51
+ stepParamsSchema: {
52
+ type: "object",
53
+ properties: {
54
+ importActionSetting: {
55
+ type: "object",
56
+ properties: {
57
+ importSetting: {
58
+ type: "object",
59
+ properties: {
60
+ explain: { type: "string" },
61
+ importColumns: {
62
+ type: "array",
63
+ items: importColumnSchema
64
+ }
65
+ },
66
+ additionalProperties: false
67
+ }
68
+ },
69
+ additionalProperties: true
70
+ }
71
+ },
72
+ additionalProperties: true
73
+ },
74
+ skeleton: {
75
+ uid: "todo-import-action-uid",
76
+ use: "ImportActionModel",
77
+ stepParams: {
78
+ importActionSetting: {
79
+ importSetting: {
80
+ explain: "",
81
+ importColumns: []
82
+ }
83
+ }
84
+ }
85
+ },
86
+ docs: {
87
+ minimalExample: {
88
+ uid: "import-users",
89
+ use: "ImportActionModel",
90
+ stepParams: {
91
+ importActionSetting: {
92
+ importSetting: {
93
+ explain: "",
94
+ importColumns: []
95
+ }
96
+ }
97
+ }
98
+ },
99
+ dynamicHints: [
100
+ {
101
+ kind: "dynamic-ui-schema",
102
+ path: "ImportActionModel.stepParams.importActionSetting.importSetting.importColumns",
103
+ message: "Importable field options depend on the runtime collection field tree.",
104
+ "x-flow": {
105
+ contextRequirements: ["collection fields"],
106
+ unresolvedReason: "runtime-importable-fields",
107
+ recommendedFallback: []
108
+ }
109
+ }
110
+ ]
111
+ }
112
+ };
113
+ const flowSchemaContribution = {
114
+ models: [importActionModelSchemaContribution],
115
+ defaults: {
116
+ source: "plugin"
117
+ }
118
+ };
119
+ // Annotate the CommonJS export names for ESM import in node:
120
+ 0 && (module.exports = {
121
+ flowSchemaContribution
122
+ });