@nocobase/plugin-action-import 1.6.0-beta.9 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("react"),require("@formily/shared"),require("react-dom"),require("@nocobase/utils/client"),require("file-saver"),require("@nocobase/client"),require("lodash"),require("@emotion/css"),require("antd"),require("@ant-design/icons"),require("@formily/react"),require("@formily/antd-v5")):"function"==typeof define&&define.amd?define("@nocobase/plugin-action-import",["react-i18next","react","@formily/shared","react-dom","@nocobase/utils/client","file-saver","@nocobase/client","lodash","@emotion/css","antd","@ant-design/icons","@formily/react","@formily/antd-v5"],t):"object"==typeof exports?exports["@nocobase/plugin-action-import"]=t(require("react-i18next"),require("react"),require("@formily/shared"),require("react-dom"),require("@nocobase/utils/client"),require("file-saver"),require("@nocobase/client"),require("lodash"),require("@emotion/css"),require("antd"),require("@ant-design/icons"),require("@formily/react"),require("@formily/antd-v5")):e["@nocobase/plugin-action-import"]=t(e["react-i18next"],e.react,e["@formily/shared"],e["react-dom"],e["@nocobase/utils/client"],e["file-saver"],e["@nocobase/client"],e.lodash,e["@emotion/css"],e.antd,e["@ant-design/icons"],e["@formily/react"],e["@formily/antd-v5"])}(self,function(e,t,n,r,o,i,a,l,c,u,s,p,f){return function(){"use strict";var d={482:function(e){e.exports=s},964:function(e){e.exports=c},632:function(e){e.exports=f},505:function(e){e.exports=p},875:function(e){e.exports=n},772:function(e){e.exports=a},584:function(e){e.exports=o},721:function(e){e.exports=u},346:function(e){e.exports=i},467:function(e){e.exports=l},156:function(e){e.exports=t},111:function(e){e.exports=r},238:function(t){t.exports=e}},m={};function y(e){var t=m[e];if(void 0!==t)return t.exports;var n=m[e]={exports:{}};return d[e](n,n.exports,y),n.exports}y.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return y.d(t,{a:t}),t},y.d=function(e,t){for(var n in t)y.o(t,n)&&!y.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},y.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},y.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var v={};y.r(v),y.d(v,{ImportActionInitializer:function(){return E},PluginActionImportClient:function(){return eT},default:function(){return eD},useDownloadXlsxTemplateAction:function(){return ea},useImportStartAction:function(){return el},ImportDesigner:function(){return $},ImportPluginProvider:function(){return eb},ImportWarning:function(){return T},DownloadTips:function(){return D},ImportContextProvider:function(){return eh},initImportSettings:function(){return C}});var b=y("875"),h=y("772"),g=y("156"),x=y.n(g),S=y("238");function O(){return(0,S.useTranslation)(["action-import","client"],{nsMode:"fallback"})}function I(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 w=["id","createdAt","createdBy","updatedAt","updatedBy"],A=function(e){var t=(0,h.useCollectionManager_deprecated)().getCollectionFields,n=t(e),r=function(e,n){if(!(!e.interface||w.includes(e.interface))){var r={name:e.name,title:(null==e?void 0:null===(i=e.uiSchema)||void 0===i?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,a,l,c=o(t(e.target),n+1).filter(Boolean);r.children=r.children||[],(a=r.children).push.apply(a,function(e){if(Array.isArray(e))return I(e)}(l=c)||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 I(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 I(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 r}},o=function(e,t){var n=[];return e.forEach(function(e){var o=r(e,t);o&&n.push(o)}),n};return o(n,1)},j=y("721"),P=y("584"),C=function(e){return{importColumns:null==e?void 0:e.filter(function(e){return!e.children}).map(function(e){return{dataIndex:[e.name]}}),explain:""}},E=function(){var e=(0,h.useSchemaInitializerItem)(),t=(0,h.useSchemaInitializer)().insert,n=A((0,h.useCollection_deprecated)().name),r={type:"void",title:'{{ t("Import") }}',"x-component":"ImportAction","x-action":"importXlsx","x-settings":"actionSettings:import"};return x().createElement(h.SchemaInitializerItem,{title:e.title,onClick:function(){P.lodash.set(r,"x-action-settings.importSettings",C(n));var o,i=(0,b.merge)(r||{},e.schema||{});null==e||null===(o=e.schemaInitialize)||void 0===o||o.call(e,i),t(i)}})},T=function(){var e=O().t;return x().createElement(j.Alert,{type:"warning",style:{marginBottom:"10px"},message:e("Import warnings",{limit:2e3})})},D=function(){var e=O().t;return x().createElement(j.Alert,{type:"info",style:{marginBottom:"10px",whiteSpace:"pre-line"},message:e("Download tips")})},F=y("632"),M=y("505"),k="action-import";function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function R(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function B(){var e=R(["\n width: 100%;\n & .ant-space-item:nth-child(2) {\n flex: 1;\n }\n "]);return B=function(){return e},e}function z(){var e=R(["\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 z=function(){return e},e}var U=["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel","application/wps-office.xlsx"],_=function(){var e=(0,S.useTranslation)(k).t,t=A((0,h.useCollection_deprecated)().name);return{importSettingsSchema:{type:"void","x-component":"Grid",properties:{explain:{type:"string",title:'{{ t("Import explain", {ns: "'.concat(k,'"}) }}'),"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,h.css)(B())},properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},dataIndex:{type:"array","x-decorator":"FormItem","x-component":h.Cascader,required:!0,enum: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(k,'"}) }}')}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:'{{ t("Add importable field", {ns: "'.concat(k,'"}) }}'),"x-component":"ArrayItems.Addition","x-component-props":{className:(0,h.css)(z())}}}}}},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])&&void 0!==r?r:{};return o.size>0x5000000?{type:"error",message:e("File size cannot exceed 80M")}:U.includes(o.type)?"":{type:"error",message:e("Please upload the file of Excel")}},validateUpload:function(e,t,n){var r,o,i,a,l,c=(a=1,function(e){if(Array.isArray(e))return e}(i=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),!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}}(i,1)||function(e,t){if(e){if("string"==typeof e)return q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return q(e,t)}}(i,a)||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==c?void 0:c.length)===0,t.componentProps=(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,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({},t.componentProps),o=(o={disabled:(null==c?void 0:c.length)===0||(null===(l=e.errors)||void 0===l?void 0:l.length)>0},o),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))}),r)}}};function N(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 V(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G(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){V(e,t,n[t])})}return e}var $=function(){var e,t,n,r,o,i,a,l,c=(0,M.useField)(),u=(0,M.useFieldSchema)(),s=(0,S.useTranslation)().t,p=(0,h.useDesignable)().dn;var f=(e=(0,g.useState)(),t=2,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,2)||function(e,t){if(e){if("string"==typeof e)return N(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 N(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.")}()),d=f[0],m=f[1],y=_().importSettingsSchema;return(0,g.useEffect)(function(){m(y)},[c.address,null==u?void 0:null===(n=u["x-action-settings"])||void 0===n?void 0:n.importSettings]),x().createElement(h.GeneralSchemaDesigner,{disableInitializer:!0},x().createElement(h.SchemaSettingsModalItem,{title:s("Edit button"),schema:{type:"object",title:s("Edit button"),properties:{title:{"x-decorator":"FormItem","x-component":"Input",title:s("Button title"),default:u.title,"x-component-props":{}},icon:{"x-decorator":"FormItem","x-component":"IconPicker",title:s("Button icon"),default:null==u?void 0:null===(r=u["x-component-props"])||void 0===r?void 0:r.icon,"x-component-props":{}},type:{"x-decorator":"FormItem","x-component":"Radio.Group",title:s("Button background color"),default:(null==u?void 0:null===(o=u["x-component-props"])||void 0===o?void 0:o.danger)?"danger":(null==u?void 0:null===(i=u["x-component-props"])||void 0===i?void 0:i.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;u.title=n,c.title=n,c.componentProps.icon=r,c.componentProps.danger="danger"===o,c.componentProps.type=o,u["x-component-props"]=u["x-component-props"]||{},u["x-component-props"].icon=r,u["x-component-props"].danger="danger"===o,u["x-component-props"].type=o,p.emit("patch",{schema:(V(t={},"x-uid",u["x-uid"]),V(t,"title",n),V(t,"x-component-props",G({},u["x-component-props"])),t)}),p.refresh()}}),x().createElement(h.SchemaSettingsActionModalItem,{title:s("Importable fields"),schema:d,initialValues:G({},null!==(l=null==u?void 0:null===(a=u["x-action-settings"])||void 0===a?void 0:a.importSettings)&&void 0!==l?l:{}),components:{ArrayItems:F.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?void 0:null===(t=e.dataIndex)||void 0===t?void 0:t.length}).map(function(e){return{dataIndex:e.dataIndex.map(function(e){var t;return null!==(t=e.name)&&void 0!==t?t:e}),title:e.title}});u["x-action-settings"].importSettings={importColumns:o,explain:r},p.emit("patch",{schema:(V(t={},"x-uid",u["x-uid"]),V(t,"x-action-settings",u["x-action-settings"]),t)}),p.refresh()}}),x().createElement(h.SchemaSettingsDivider,null),x().createElement(h.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:function(e){return"Space"===e["x-component"]||e["x-component"].endsWith("ActionBar")},confirm:{title:s("Delete action")}}))},H=y("111"),W=(0,g.createContext)(null);W.displayName="ImportContext";var X=function(){return(0,g.useContext)(W)},J=y("482"),L=y("346");function K(){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 K=function(){return n},n}var Q={IMPORTING:1,IMPORTED:2},Y=function(e){var t=(0,S.useTranslation)(k).t,n=X(),r=n.importModalVisible,o=n.importStatus,i=n.importResult,a=n.setImportModalVisible,l=null!=i?i:{},c=l.data,u=l.meta,s=function(){a(!1)};return x().createElement(j.Modal,{title:t("Import Data"),width:"50%",styles:{body:{height:"calc(80vh - 200px)"}},open:r,footer:null,closable:o===Q.IMPORTED,onCancel:s},x().createElement("div",{className:(0,h.css)(K())},o===Q.IMPORTING&&x().createElement(j.Spin,{indicator:x().createElement(J.LoadingOutlined,{style:{fontSize:24},spin:!0}),tip:t("Excel data importing")}),o===Q.IMPORTED&&x().createElement(j.Space,{direction:"vertical",align:"center"},x().createElement(J.ExclamationCircleFilled,{style:{fontSize:72,color:"#1890ff"}}),x().createElement("p",null,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,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({},null!=u?u:{}))),x().createElement(j.Space,null,(null==u?void 0:u.failureCount)>0&&x().createElement(j.Button,{onClick:function(){var e=new Blob([new Int8Array(null==c?void 0:c.data)],{type:"application/x-xls"});(0,L.saveAs)(e,"fail.xlsx")}},t("To download the failure data")),x().createElement(j.Button,{type:"primary",onClick:s},t("Done"))))))},Z=y("467"),ee=y.n(Z);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 en(e){return 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)})}}function er(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){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}var eo=function(){for(var e=(0,h.useActionContext)().fieldSchema,t=(0,M.useFieldSchema)(),n=e||t;n&&"importXlsx"!==n["x-action"];)console.log("schema",n=n.parent);return{schema:n}},ei=function(e){return e&&Array.isArray(e)?e:[]},ea=function(){var e=(0,h.useBlockRequestContext)(),t=(e.service,e.resource);(0,h.useAPIClient)(),(0,M.useFieldSchema)();var n=(0,h.useCompile)(),r=(0,h.useCollectionManager_deprecated)(),o=r.getCollectionJoinField,i=r.getCollectionField,a=(0,h.useCollection_deprecated)(),l=a.name,c=a.title;a.getField,(0,S.useTranslation)(k).t;var u=eo().schema;return{run:function(){return en(function(){var e,r,a,s,p,f,d;return er(this,function(m){switch(m.label){case 0:return s=(a=ee().cloneDeep(null!==(r=null==u?void 0:null===(e=u["x-action-settings"])||void 0===e?void 0:e.importSettings)&&void 0!==r?r:{})).importColumns,p=a.explain,f=ei(s).map(function(e){var t=i("".concat(l,".").concat(e.dataIndex[0]));if(!!t){if(e.defaultTitle=n(null==t?void 0:null===(r=t.uiSchema)||void 0===r?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?void 0:null===(a=c.uiSchema)||void 0===a?void 0:a.title)||c.name}return"chinaRegion"===t.interface&&e.dataIndex.push("name"),e}}).filter(Boolean),[4,t.downloadXlsxTemplate({values:{title:n(c),explain:p,columns:n(f)}},{method:"post",responseType:"blob"})];case 1:return d=new Blob([m.sent().data],{type:"application/x-xls"}),(0,L.saveAs)(d,"".concat(n(c),".xlsx")),[2]}})})()}}},el=function(){var e,t=(0,h.useBlockRequestContext)(),n=t.service;t.resource,(0,h.useAPIClient)(),(0,M.useFieldSchema)();var r=(0,h.useCompile)(),o=(0,h.useCollectionManager_deprecated)(),i=o.getCollectionJoinField,a=o.getCollectionField,l=(0,h.useCollection_deprecated)(),c=l.name;l.title,l.getField,(0,S.useTranslation)(k).t;var u=eo().schema,s=(0,M.useForm)(),p=(0,h.useActionContext)(),f=p.setVisible;p.fieldSchema;var d=X(),m=d.setImportModalVisible,y=d.setImportStatus,v=d.setImportResult,b=s.values.upload,x=(0,h.useDataBlockProps)();(0,h.useDataSourceHeaders)(x.dataSource);var O=(0,h.useDataBlockResource)();return(0,g.useEffect)(function(){s.reset()},[]),{run:function(){return en(function(){var e,t,o,l,p,d,b,h,g,x,S,I,w,A,j,P;return er(this,function(P){switch(P.label){case 0:l=(o=ee().cloneDeep(null!==(t=null==u?void 0:null===(e=u["x-action-settings"])||void 0===e?void 0:e.importSettings)&&void 0!==t?t:{})).importColumns,p=o.explain,d=ei(l).map(function(e){var t=a("".concat(c,".").concat(e.dataIndex[0]));if(!!t){if(e.defaultTitle=r(null==t?void 0:null===(n=t.uiSchema)||void 0===n?void 0:n.title)||t.name,e.dataIndex.length>1){var n,o,l=i("".concat(c,".").concat(e.dataIndex.join(".")));if(!l)return;e.defaultTitle=e.defaultTitle+"/"+r(null==l?void 0:null===(o=l.uiSchema)||void 0===o?void 0:o.title)||l.name}return"chinaRegion"===t.interface&&e.dataIndex.push("name"),e}}).filter(Boolean),b=new FormData,h=s.values.upload.map(function(e){return e.originFileObj}),b.append("file",h[0]),b.append("columns",JSON.stringify(d)),b.append("explain",p),x=(g=s.values).triggerWorkflow,S=g.identifyDuplicates,I=g.uniqueField,w=g.duplicateStrategy,void 0!==x&&b.append("triggerWorkflow",JSON.stringify(x)),S&&b.append("duplicateOption",JSON.stringify({uniqueField:I,mode:w})),f(!1),m(!0),y(Q.IMPORTING),P.label=1;case 1:return P.trys.push([1,6,,7]),[4,O.importXlsx({values:b},{timeout:6e5})];case 2:if(v(A=P.sent().data),s.reset(),A.data.taskId)return[3,4];return v(A),[4,null==n?void 0:null===(j=n.refresh)||void 0===j?void 0:j.call(n)];case 3:return P.sent(),y(Q.IMPORTED),[3,5];case 4:m(!1),f(!1),P.label=5;case 5:return[3,7];case 6:return P.sent(),m(!1),f(!0),[3,7];case 7:return[2]}})})()},disabled:(null==b?void 0:b.length)===0||(null===(e=s.errors)||void 0===e?void 0:e.length)>0}},ec=y("964");function eu(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 es(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ep(){var e=es(["\n .ant-formily-item-label {\n height: var(--controlHeightLG);\n }\n "]);return ep=function(){return e},e}function ef(){var e=es(["\n margin-top: 5px;\n "]);return ef=function(){return e},e}var ed={type:"void",name:"import-modal",title:'{{ t("Import Data", {ns: "'.concat(k,'" }) }}'),"x-component":"Action.Modal","x-decorator":"Form","x-component-props":{width:"100%",style:{maxWidth:"750px"},className:(0,ec.css)(ep())},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(k,'" }) }}'),"x-component":"FormItem","x-acl-ignore":!0,properties:{tip:{type:"void","x-component":"DownloadTips"},downloadAction:{type:"void",title:'{{ t("Download template", {ns: "'.concat(k,'" }) }}'),"x-component":"Action","x-component-props":{className:(0,ec.css)(ef()),useAction:"{{ useDownloadXlsxTemplateAction }}"}}}},upload:{type:"array",title:'{{ t("Step 2: Upload Excel", {ns: "'.concat(k,'" }) }}'),"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(k,'" }) }}'),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(k,'" }) }}'),"x-component":"Action","x-component-props":{type:"primary",htmlType:"submit",useAction:"{{ useImportStartAction }}"},"x-reactions":{dependencies:["upload"],fulfill:{run:"validateUpload($form, $self, $deps)"}}}}}}}}},em=function(e){var t,n,r,o,i=(t=(0,g.useState)(!1),n=2,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),!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}}(t,2)||function(e,t){if(e){if("string"==typeof e)return eu(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 eu(e,t)}}(t,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.")}()),a=i[0],l=i[1];(0,S.useTranslation)(k).t;var c=(0,h.useCompile)(),u=(0,M.useFieldSchema)();return x().createElement(h.ActionContextProvider,{value:{visible:a,setVisible:l,fieldSchema:u}},x().createElement(h.Action,(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,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({icon:e.icon||x().createElement(J.UploadOutlined,null),title:c((null==u?void 0:u.title)||"t('Import')")},e),o=(o={onClick:function(){return l(!0)}},o),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))}),r)),x().createElement(h.SchemaComponent,{schema:ed}))};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){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 ey(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 ey(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 eb=function(e){var t=_(),n=t.uploadValidator,r=t.beforeUploadHandler,o=t.validateUpload;return x().createElement(h.SchemaComponentOptions,{components:{ImportActionInitializer:E,ImportDesigner:$,ImportWarning:T,DownloadTips:D,ImportAction:em},scope:{uploadValidator:n,validateUpload:o,beforeUploadHandler:r,useDownloadXlsxTemplateAction:ea,useImportStartAction:el}},x().createElement(eh,null,e.children))},eh=function(e){var t=ev((0,g.useState)(!1),2),n=t[0],r=t[1],o=ev((0,g.useState)(Q.IMPORTING),2),i=o[0],a=o[1],l=ev((0,g.useState)(null),2),c=l[0],u=l[1];return x().createElement(W.Provider,{value:{importModalVisible:n,setImportModalVisible:r,importStatus:i,setImportStatus:a,importResult:c,setImportResult:u}},(0,H.createPortal)(x().createElement(Y,null),document.body),e.children)};function eg(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 ex(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eS(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){ex(e,t,n[t])})}return e}var eO=new h.SchemaSettings({name:"actionSettings:import",items:[{name:"editButton",Component:h.ButtonEditor,useComponentProps:function(){return(0,h.useSchemaToolbar)().buttonEditorProps}},{name:"importableFields",type:"actionModal",useComponentProps:function(){var e,t,n,r,o,i=(0,M.useField)(),a=(0,M.useFieldSchema)(),l=(0,S.useTranslation)().t,c=(0,h.useDesignable)().dn;var u=(e=(0,g.useState)(),t=2,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,2)||function(e,t){if(e){if("string"==typeof e)return eg(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 eg(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.")}()),s=u[0],p=u[1],f=_().importSettingsSchema;return(0,g.useEffect)(function(){p(f)},[i.address,null==a?void 0:null===(n=a["x-action-settings"])||void 0===n?void 0:n.importSettings]),{title:l("Importable fields"),schema:eS({},s),initialValues:eS({},null!==(o=null==a?void 0:null===(r=a["x-action-settings"])||void 0===r?void 0:r.importSettings)&&void 0!==o?o:{}),components:{ArrayItems:F.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?void 0:null===(t=e.dataIndex)||void 0===t?void 0:t.length}).map(function(e){return{dataIndex:e.dataIndex.map(function(e){var t;return null!==(t=e.name)&&void 0!==t?t:e}),title:e.title,description:e.description}});a["x-action-settings"].importSettings={importColumns:o,explain:r},c.emit("patch",{schema:(ex(t={},"x-uid",a["x-uid"]),ex(t,"x-action-settings",a["x-action-settings"]),t)}),c.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,S.useTranslation)().t)("Delete action")}}}}]});function eI(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 ew(e,t,n){return(ew=eE()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&eP(o,n.prototype),o}).apply(null,arguments)}function eA(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)}}function ej(e){return(ej=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eP(e,t){return(eP=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eC(e){var t="function"==typeof Map?new Map:void 0;return(eC=function(e){var n;if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return ew(e,arguments,ej(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),eP(r,e)})(e)}function eE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(eE=function(){return!!e})()}var eT=function(e){var t,n,r;function o(){var e,t,n;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),e=this,t=o,n=arguments,t=ej(t),function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,eE()?Reflect.construct(t,n||[],ej(e).constructor):t.apply(e,n))}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&eP(e,t)}(o,e),t=o,n=[{key:"load",value:function(){var e,t=this;return(e=function(){var e,n;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){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(r){return t.app.use(eb),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,h.useActionAvailable)("import")}},null==(n=t.app.schemaInitializerManager.get("table:configureActions"))||n.add("enableActions.import",e),t.app.schemaInitializerManager.addItem("gantt:configureActions","enableActions.import",e),t.app.schemaSettingsManager.add(eO),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){eI(i,r,o,a,l,"next",e)}function l(e){eI(i,r,o,a,l,"throw",e)}a(void 0)})})()}}],eA(t.prototype,n),o}(eC(h.Plugin)),eD=eT;return v}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("react"),require("react-dom"),require("file-saver"),require("@formily/shared"),require("@emotion/css"),require("@nocobase/utils/client"),require("@nocobase/client"),require("lodash"),require("antd"),require("@ant-design/icons"),require("@formily/react"),require("@formily/antd-v5")):"function"==typeof define&&define.amd?define("@nocobase/plugin-action-import",["react-i18next","react","react-dom","file-saver","@formily/shared","@emotion/css","@nocobase/utils/client","@nocobase/client","lodash","antd","@ant-design/icons","@formily/react","@formily/antd-v5"],t):"object"==typeof exports?exports["@nocobase/plugin-action-import"]=t(require("react-i18next"),require("react"),require("react-dom"),require("file-saver"),require("@formily/shared"),require("@emotion/css"),require("@nocobase/utils/client"),require("@nocobase/client"),require("lodash"),require("antd"),require("@ant-design/icons"),require("@formily/react"),require("@formily/antd-v5")):e["@nocobase/plugin-action-import"]=t(e["react-i18next"],e.react,e["react-dom"],e["file-saver"],e["@formily/shared"],e["@emotion/css"],e["@nocobase/utils/client"],e["@nocobase/client"],e.lodash,e.antd,e["@ant-design/icons"],e["@formily/react"],e["@formily/antd-v5"])}(self,function(e,t,n,r,o,i,a,l,c,u,s,p,f){return function(){"use strict";var d={482:function(e){e.exports=s},964:function(e){e.exports=i},632:function(e){e.exports=f},505:function(e){e.exports=p},875:function(e){e.exports=o},772:function(e){e.exports=l},584:function(e){e.exports=a},721:function(e){e.exports=u},346:function(e){e.exports=r},467:function(e){e.exports=c},156:function(e){e.exports=t},111:function(e){e.exports=n},238:function(t){t.exports=e}},m={};function y(e){var t=m[e];if(void 0!==t)return t.exports;var n=m[e]={exports:{}};return d[e](n,n.exports,y),n.exports}y.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return y.d(t,{a:t}),t},y.d=function(e,t){for(var n in t)y.o(t,n)&&!y.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},y.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},y.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var v={};y.r(v),y.d(v,{ImportActionInitializer:function(){return E},PluginActionImportClient:function(){return eT},default:function(){return eD},useDownloadXlsxTemplateAction:function(){return ea},useImportStartAction:function(){return el},ImportDesigner:function(){return $},ImportPluginProvider:function(){return eb},ImportWarning:function(){return T},DownloadTips:function(){return D},ImportContextProvider:function(){return eh},initImportSettings:function(){return C}});var b=y("875"),h=y("772"),g=y("156"),x=y.n(g),S=y("238");function I(){return(0,S.useTranslation)(["action-import","client"],{nsMode:"fallback"})}function O(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 w=["id","createdAt","createdBy","updatedAt","updatedBy"],A=function(e){var t=(0,h.useCollectionManager_deprecated)().getCollectionFields,n=t(e),r=function(e,n){if(!(!e.interface||w.includes(e.interface))){var r={name:e.name,title:(null==e?void 0:null===(i=e.uiSchema)||void 0===i?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,a,l,c=o(t(e.target),n+1).filter(Boolean);r.children=r.children||[],(a=r.children).push.apply(a,function(e){if(Array.isArray(e))return O(e)}(l=c)||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 O(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 O(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 r}},o=function(e,t){var n=[];return e.forEach(function(e){var o=r(e,t);o&&n.push(o)}),n};return o(n,1)},j=y("721"),P=y("584"),C=function(e){return{importColumns:null==e?void 0:e.filter(function(e){return!e.children}).map(function(e){return{dataIndex:[e.name]}}),explain:""}},E=function(){var e=(0,h.useSchemaInitializerItem)(),t=(0,h.useSchemaInitializer)().insert,n=A((0,h.useCollection_deprecated)().name),r={type:"void",title:'{{ t("Import") }}',"x-component":"ImportAction","x-action":"importXlsx","x-settings":"actionSettings:import","x-toolbar":"ActionSchemaToolbar"};return x().createElement(h.SchemaInitializerItem,{title:e.title,onClick:function(){P.lodash.set(r,"x-action-settings.importSettings",C(n));var o,i=(0,b.merge)(r||{},e.schema||{});null==e||null===(o=e.schemaInitialize)||void 0===o||o.call(e,i),t(i)}})},T=function(){var e=I().t;return x().createElement(j.Alert,{type:"warning",style:{marginBottom:"10px"},message:e("Import warnings",{limit:2e3})})},D=function(){var e=I().t;return x().createElement(j.Alert,{type:"info",style:{marginBottom:"10px",whiteSpace:"pre-line"},message:e("Download tips")})},M=y("632"),k=y("505"),F="action-import";function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function R(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function B(){var e=R(["\n width: 100%;\n & .ant-space-item:nth-child(2) {\n flex: 1;\n }\n "]);return B=function(){return e},e}function z(){var e=R(["\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 z=function(){return e},e}var U=["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel","application/wps-office.xlsx"],_=function(){var e=(0,S.useTranslation)(F).t,t=A((0,h.useCollection_deprecated)().name);return{importSettingsSchema:{type:"void","x-component":"Grid",properties:{explain:{type:"string",title:'{{ t("Import explain", {ns: "'.concat(F,'"}) }}'),"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,h.css)(B())},properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},dataIndex:{type:"array","x-decorator":"FormItem","x-component":h.Cascader,required:!0,enum: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(F,'"}) }}')}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:'{{ t("Add importable field", {ns: "'.concat(F,'"}) }}'),"x-component":"ArrayItems.Addition","x-component-props":{className:(0,h.css)(z())}}}}}},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])&&void 0!==r?r:{};return o.size>0x5000000?{type:"error",message:e("File size cannot exceed 80M")}:U.includes(o.type)?"":{type:"error",message:e("Please upload the file of Excel")}},validateUpload:function(e,t,n){var r,o,i,a,l,c=(a=1,function(e){if(Array.isArray(e))return e}(i=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),!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}}(i,1)||function(e,t){if(e){if("string"==typeof e)return q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return q(e,t)}}(i,a)||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==c?void 0:c.length)===0,t.componentProps=(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,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({},t.componentProps),o=(o={disabled:(null==c?void 0:c.length)===0||(null===(l=e.errors)||void 0===l?void 0:l.length)>0},o),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))}),r)}}};function N(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 V(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G(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){V(e,t,n[t])})}return e}var $=function(){var e,t,n,r,o,i,a,l,c=(0,k.useField)(),u=(0,k.useFieldSchema)(),s=(0,S.useTranslation)().t,p=(0,h.useDesignable)().dn;var f=(e=(0,g.useState)(),t=2,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,2)||function(e,t){if(e){if("string"==typeof e)return N(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 N(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.")}()),d=f[0],m=f[1],y=_().importSettingsSchema;return(0,g.useEffect)(function(){m(y)},[c.address,null==u?void 0:null===(n=u["x-action-settings"])||void 0===n?void 0:n.importSettings]),x().createElement(h.GeneralSchemaDesigner,{disableInitializer:!0},x().createElement(h.SchemaSettingsModalItem,{title:s("Edit button"),schema:{type:"object",title:s("Edit button"),properties:{title:{"x-decorator":"FormItem","x-component":"Input",title:s("Button title"),default:u.title,"x-component-props":{}},icon:{"x-decorator":"FormItem","x-component":"IconPicker",title:s("Button icon"),default:null==u?void 0:null===(r=u["x-component-props"])||void 0===r?void 0:r.icon,"x-component-props":{}},type:{"x-decorator":"FormItem","x-component":"Radio.Group",title:s("Button background color"),default:(null==u?void 0:null===(o=u["x-component-props"])||void 0===o?void 0:o.danger)?"danger":(null==u?void 0:null===(i=u["x-component-props"])||void 0===i?void 0:i.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;u.title=n,c.title=n,c.componentProps.icon=r,c.componentProps.danger="danger"===o,c.componentProps.type=o,u["x-component-props"]=u["x-component-props"]||{},u["x-component-props"].icon=r,u["x-component-props"].danger="danger"===o,u["x-component-props"].type=o,p.emit("patch",{schema:(V(t={},"x-uid",u["x-uid"]),V(t,"title",n),V(t,"x-component-props",G({},u["x-component-props"])),t)}),p.refresh()}}),x().createElement(h.SchemaSettingsActionModalItem,{title:s("Importable fields"),schema:d,initialValues:G({},null!==(l=null==u?void 0:null===(a=u["x-action-settings"])||void 0===a?void 0:a.importSettings)&&void 0!==l?l:{}),components:{ArrayItems:M.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?void 0:null===(t=e.dataIndex)||void 0===t?void 0:t.length}).map(function(e){return{dataIndex:e.dataIndex.map(function(e){var t;return null!==(t=e.name)&&void 0!==t?t:e}),title:e.title}});u["x-action-settings"].importSettings={importColumns:o,explain:r},p.emit("patch",{schema:(V(t={},"x-uid",u["x-uid"]),V(t,"x-action-settings",u["x-action-settings"]),t)}),p.refresh()}}),x().createElement(h.SchemaSettingsDivider,null),x().createElement(h.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:function(e){return"Space"===e["x-component"]||e["x-component"].endsWith("ActionBar")},confirm:{title:s("Delete action")}}))},X=y("111"),H=(0,g.createContext)(null);H.displayName="ImportContext";var W=function(){return(0,g.useContext)(H)},L=y("482"),J=y("346");function K(){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 K=function(){return n},n}var Q={IMPORTING:1,IMPORTED:2},Y=function(e){var t=(0,S.useTranslation)(F).t,n=W(),r=n.importModalVisible,o=n.importStatus,i=n.importResult,a=n.setImportModalVisible,l=null!=i?i:{},c=l.data,u=l.meta,s=function(){a(!1)};return x().createElement(j.Modal,{title:t("Import Data"),width:"50%",styles:{body:{height:"calc(80vh - 200px)"}},open:r,footer:null,closable:o===Q.IMPORTED,onCancel:s},x().createElement("div",{className:(0,h.css)(K())},o===Q.IMPORTING&&x().createElement(j.Spin,{indicator:x().createElement(L.LoadingOutlined,{style:{fontSize:24},spin:!0}),tip:t("Excel data importing")}),o===Q.IMPORTED&&x().createElement(j.Space,{direction:"vertical",align:"center"},x().createElement(L.ExclamationCircleFilled,{style:{fontSize:72,color:"#1890ff"}}),x().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,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}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(", ")}(i)),x().createElement(j.Space,null,(null==u?void 0:u.failureCount)>0&&x().createElement(j.Button,{onClick:function(){var e=new Blob([new Int8Array(null==c?void 0:c.data)],{type:"application/x-xls"});(0,J.saveAs)(e,"fail.xlsx")}},t("To download the failure data")),x().createElement(j.Button,{type:"primary",onClick:s},t("Done"))))))},Z=y("467"),ee=y.n(Z);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 en(e){return 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)})}}function er(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){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}var eo=function(){for(var e=(0,h.useActionContext)().fieldSchema,t=(0,k.useFieldSchema)(),n=e||t;n&&"importXlsx"!==n["x-action"];)console.log("schema",n=n.parent);return{schema:n}},ei=function(e){return e&&Array.isArray(e)?e:[]},ea=function(){var e=(0,h.useBlockRequestContext)().resource,t=(0,h.useCompile)(),n=(0,h.useCollectionManager_deprecated)(),r=n.getCollectionJoinField,o=n.getCollectionField,i=(0,h.useCollection_deprecated)(),a=i.name,l=i.title,c=eo().schema;return{run:function(){return en(function(){var n,i,u,s,p,f,d;return er(this,function(m){switch(m.label){case 0:return s=(u=ee().cloneDeep(null!==(i=null==c?void 0:null===(n=c["x-action-settings"])||void 0===n?void 0:n.importSettings)&&void 0!==i?i:{})).importColumns,p=u.explain,f=ei(s).map(function(e){var n=o("".concat(a,".").concat(e.dataIndex[0]));if(!!n){if(e.defaultTitle=t(null==n?void 0:null===(i=n.uiSchema)||void 0===i?void 0:i.title)||n.name,e.dataIndex.length>1){var i,l,c=r("".concat(a,".").concat(e.dataIndex.join(".")));if(!c)return;e.defaultTitle=e.defaultTitle+"/"+t(null==c?void 0:null===(l=c.uiSchema)||void 0===l?void 0:l.title)||c.name}return"chinaRegion"===n.interface&&e.dataIndex.push("name"),e}}).filter(Boolean),[4,e.downloadXlsxTemplate({values:{title:t(l),explain:p,columns:t(f)}},{method:"post",responseType:"blob"})];case 1:return d=new Blob([m.sent().data],{type:"application/x-xls"}),(0,J.saveAs)(d,"".concat(t(l),".xlsx")),[2]}})})()}}},el=function(){var e,t=(0,h.useBlockRequestContext)().service,n=(0,h.useCompile)(),r=(0,h.useCollectionManager_deprecated)(),o=r.getCollectionJoinField,i=r.getCollectionField,a=(0,h.useCollection_deprecated)().name,l=eo().schema,c=(0,k.useForm)(),u=(0,h.useActionContext)().setVisible,s=W(),p=s.setImportModalVisible,f=s.setImportStatus,d=s.setImportResult,m=c.values.upload,y=(0,h.useDataBlockResource)();return(0,g.useEffect)(function(){c.reset()},[]),{run:function(){return en(function(){var e,r,s,m,v,b,h,g,x,S,I,O,w;return er(this,function(w){switch(w.label){case 0:v=(m=ee().cloneDeep(null!==(s=null==l?void 0:null===(e=l["x-action-settings"])||void 0===e?void 0:e.importSettings)&&void 0!==s?s:{})).importColumns,b=m.explain,h=ei(v).map(function(e){var t=i("".concat(a,".").concat(e.dataIndex[0]));if(!!t){if(e.defaultTitle=n(null==t?void 0:null===(r=t.uiSchema)||void 0===r?void 0:r.title)||t.name,e.dataIndex.length>1){var r,l,c=o("".concat(a,".").concat(e.dataIndex.join(".")));if(!c)return;e.defaultTitle=e.defaultTitle+"/"+n(null==c?void 0:null===(l=c.uiSchema)||void 0===l?void 0:l.title)||c.name}return"chinaRegion"===t.interface&&e.dataIndex.push("name"),e}}).filter(Boolean),g=new FormData,x=c.values.upload.map(function(e){return e.originFileObj}),g.append("file",x[0]),g.append("columns",JSON.stringify(h)),g.append("explain",b),S=(null==l?void 0:null===(r=l["x-action-settings"])||void 0===r?void 0:r.importMode)||"auto",u(!1),p(!0),f(Q.IMPORTING),w.label=1;case 1:return w.trys.push([1,6,,7]),[4,y.importXlsx({values:g,mode:S},{timeout:6e5})];case 2:if(I=w.sent().data,c.reset(),I.data.taskId)return[3,4];return d(I),[4,null==t?void 0:null===(O=t.refresh)||void 0===O?void 0:O.call(t)];case 3:return w.sent(),f(Q.IMPORTED),[3,5];case 4:p(!1),u(!1),w.label=5;case 5:return[3,7];case 6:return w.sent(),p(!1),u(!0),[3,7];case 7:return[2]}})})()},disabled:(null==m?void 0:m.length)===0||(null===(e=c.errors)||void 0===e?void 0:e.length)>0}},ec=y("964");function eu(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 es(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ep(){var e=es(["\n .ant-formily-item-label {\n height: var(--controlHeightLG);\n }\n "]);return ep=function(){return e},e}function ef(){var e=es(["\n margin-top: 5px;\n "]);return ef=function(){return e},e}var ed={type:"void",name:"import-modal",title:'{{ t("Import Data", {ns: "'.concat(F,'" }) }}'),"x-component":"Action.Modal","x-decorator":"Form","x-component-props":{width:"100%",style:{maxWidth:"750px"},className:(0,ec.css)(ep())},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(F,'" }) }}'),"x-component":"FormItem","x-acl-ignore":!0,properties:{tip:{type:"void","x-component":"DownloadTips"},downloadAction:{type:"void",title:'{{ t("Download template", {ns: "'.concat(F,'" }) }}'),"x-component":"Action","x-component-props":{className:(0,ec.css)(ef()),useAction:"{{ useDownloadXlsxTemplateAction }}"}}}},upload:{type:"array",title:'{{ t("Step 2: Upload Excel", {ns: "'.concat(F,'" }) }}'),"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(F,'" }) }}'),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(F,'" }) }}'),"x-component":"Action","x-component-props":{type:"primary",htmlType:"submit",useAction:"{{ useImportStartAction }}"},"x-reactions":{dependencies:["upload"],fulfill:{run:"validateUpload($form, $self, $deps)"}}}}}}}}},em=function(e){var t,n,r,o,i=(t=(0,g.useState)(!1),n=2,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),!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}}(t,2)||function(e,t){if(e){if("string"==typeof e)return eu(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 eu(e,t)}}(t,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.")}()),a=i[0],l=i[1];(0,S.useTranslation)(F).t;var c=(0,h.useCompile)(),u=(0,k.useFieldSchema)();return x().createElement(h.ActionContextProvider,{value:{visible:a,setVisible:l,fieldSchema:u}},x().createElement(h.Action,(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,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({icon:e.icon||x().createElement(L.UploadOutlined,null),title:c((null==u?void 0:u.title)||"t('Import')")},e),o=(o={onClick:function(){return l(!0)}},o),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))}),r)),x().createElement(h.SchemaComponent,{schema:ed}))};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){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 ey(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 ey(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 eb=function(e){var t=_(),n=t.uploadValidator,r=t.beforeUploadHandler,o=t.validateUpload;return x().createElement(h.SchemaComponentOptions,{components:{ImportActionInitializer:E,ImportDesigner:$,ImportWarning:T,DownloadTips:D,ImportAction:em},scope:{uploadValidator:n,validateUpload:o,beforeUploadHandler:r,useDownloadXlsxTemplateAction:ea,useImportStartAction:el}},x().createElement(eh,null,e.children))},eh=function(e){var t=ev((0,g.useState)(!1),2),n=t[0],r=t[1],o=ev((0,g.useState)(Q.IMPORTING),2),i=o[0],a=o[1],l=ev((0,g.useState)(null),2),c=l[0],u=l[1];return x().createElement(H.Provider,{value:{importModalVisible:n,setImportModalVisible:r,importStatus:i,setImportStatus:a,importResult:c,setImportResult:u}},(0,X.createPortal)(x().createElement(Y,null),document.body),e.children)};function eg(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 ex(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eS(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){ex(e,t,n[t])})}return e}var eI=new h.SchemaSettings({name:"actionSettings:import",items:[{name:"editButton",Component:h.ButtonEditor,useComponentProps:function(){return(0,h.useSchemaToolbar)().buttonEditorProps}},{name:"importableFields",type:"actionModal",useComponentProps:function(){var e,t,n,r,o,i=(0,k.useField)(),a=(0,k.useFieldSchema)(),l=(0,S.useTranslation)().t,c=(0,h.useDesignable)().dn;var u=(e=(0,g.useState)(),t=2,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,2)||function(e,t){if(e){if("string"==typeof e)return eg(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 eg(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.")}()),s=u[0],p=u[1],f=_().importSettingsSchema;return(0,g.useEffect)(function(){p(f)},[i.address,null==a?void 0:null===(n=a["x-action-settings"])||void 0===n?void 0:n.importSettings]),{title:l("Importable fields"),schema:eS({},s),initialValues:eS({},null!==(o=null==a?void 0:null===(r=a["x-action-settings"])||void 0===r?void 0:r.importSettings)&&void 0!==o?o:{}),components:{ArrayItems:M.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?void 0:null===(t=e.dataIndex)||void 0===t?void 0:t.length}).map(function(e){return{dataIndex:e.dataIndex.map(function(e){var t;return null!==(t=e.name)&&void 0!==t?t:e}),title:e.title,description:e.description}});a["x-action-settings"].importSettings={importColumns:o,explain:r},c.emit("patch",{schema:(ex(t={},"x-uid",a["x-uid"]),ex(t,"x-action-settings",a["x-action-settings"]),t)}),c.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,S.useTranslation)().t)("Delete action")}}}}]});function eO(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 ew(e,t,n){return(ew=eE()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&eP(o,n.prototype),o}).apply(null,arguments)}function eA(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)}}function ej(e){return(ej=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eP(e,t){return(eP=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eC(e){var t="function"==typeof Map?new Map:void 0;return(eC=function(e){var n;if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return ew(e,arguments,ej(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),eP(r,e)})(e)}function eE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(eE=function(){return!!e})()}var eT=function(e){var t,n,r;function o(){var e,t,n;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),e=this,t=o,n=arguments,t=ej(t),function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,eE()?Reflect.construct(t,n||[],ej(e).constructor):t.apply(e,n))}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&eP(e,t)}(o,e),t=o,n=[{key:"load",value:function(){var e,t=this;return(e=function(){var e,n;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){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(r){return t.app.use(eb),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,h.useActionAvailable)("import")}},null==(n=t.app.schemaInitializerManager.get("table:configureActions"))||n.add("enableActions.import",e),t.app.schemaInitializerManager.addItem("gantt:configureActions","enableActions.import",e),t.app.schemaSettingsManager.add(eI),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){eO(i,r,o,a,l,"next",e)}function l(e){eO(i,r,o,a,l,"throw",e)}a(void 0)})})()}}],eA(t.prototype,n),o}(eC(h.Plugin)),eD=eT;return v}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -10,23 +10,23 @@
|
|
|
10
10
|
module.exports = {
|
|
11
11
|
"@emotion/css": "11.13.0",
|
|
12
12
|
"@formily/react": "2.3.0",
|
|
13
|
-
"@nocobase/client": "1.6.0
|
|
13
|
+
"@nocobase/client": "1.6.0",
|
|
14
14
|
"react": "18.2.0",
|
|
15
15
|
"react-i18next": "11.18.6",
|
|
16
|
-
"@ant-design/icons": "5.
|
|
16
|
+
"@ant-design/icons": "5.6.1",
|
|
17
17
|
"@formily/shared": "2.3.2",
|
|
18
18
|
"antd": "5.12.8",
|
|
19
|
-
"@nocobase/utils": "1.6.0
|
|
19
|
+
"@nocobase/utils": "1.6.0",
|
|
20
20
|
"@formily/antd-v5": "1.1.9",
|
|
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.0",
|
|
25
|
-
"@nocobase/server": "1.6.0
|
|
26
|
-
"@nocobase/actions": "1.6.0
|
|
27
|
-
"@nocobase/database": "1.6.0
|
|
25
|
+
"@nocobase/server": "1.6.0",
|
|
26
|
+
"@nocobase/actions": "1.6.0",
|
|
27
|
+
"@nocobase/database": "1.6.0",
|
|
28
28
|
"async-mutex": "0.5.0",
|
|
29
|
-
"@nocobase/data-source-manager": "1.6.0
|
|
29
|
+
"@nocobase/data-source-manager": "1.6.0",
|
|
30
30
|
"sequelize": "6.35.2",
|
|
31
31
|
"mathjs": "10.6.4"
|
|
32
32
|
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Only one file is allowed to be uploaded": "È consentito caricare solo un file",
|
|
3
|
+
"File size cannot exceed 10M": "La dimensione del file non può superare i 10M",
|
|
4
|
+
"Please upload the file of Excel": "Si prega di caricare il file Excel",
|
|
5
|
+
"Import Data": "Importa dati",
|
|
6
|
+
"Start import": "Inizia importazione",
|
|
7
|
+
"Import explain": "Guida importazione",
|
|
8
|
+
"Download template": "Scarica modello",
|
|
9
|
+
"Step 1: Download template": "Passo 1: Scarica modello",
|
|
10
|
+
"Step 2: Upload Excel": "Passo 2: Carica file Excel",
|
|
11
|
+
"Step 3: Import options": "Passo 3: Opzioni di importazione",
|
|
12
|
+
"Download tips": "- Scarica il modello e compila i dati secondo il formato \\r\\n - Importa solo il primo foglio di lavoro \\r\\n - Non cambiare l'intestazione del modello per evitare errori di importazione",
|
|
13
|
+
"Import warnings": "Puoi importare fino a {{limit}} righe di dati alla volta, qualsiasi eccedenza verrà ignorata.",
|
|
14
|
+
"Upload placeholder": "Trascina qui il file o clicca per caricare, la dimensione del file non deve superare 80M",
|
|
15
|
+
"Excel data importing": "Importazione dati Excel in corso",
|
|
16
|
+
"{{successCount}} records have been successfully imported": "{{successCount}} record sono stati importati con successo",
|
|
17
|
+
"To download the failure data": "Scarica i dati non riusciti",
|
|
18
|
+
"Add importable field": "Aggiungi campo importabile",
|
|
19
|
+
"Done": "Fatto",
|
|
20
|
+
"Yes": "Sì",
|
|
21
|
+
"No": "No",
|
|
22
|
+
"Field {{fieldName}} does not exist": "Il campo {{fieldName}} non esiste",
|
|
23
|
+
"can not find value": "valore non trovato",
|
|
24
|
+
"password is empty": "la password è vuota",
|
|
25
|
+
"Incorrect time format": "Formato orario errato",
|
|
26
|
+
"Incorrect date format": "Formato data errato",
|
|
27
|
+
"Incorrect email format": "Formato email errato",
|
|
28
|
+
"Illegal percentage format": "Formato percentuale illegale",
|
|
29
|
+
"Imported template does not match, please download again.": "Il modello importato non corrisponde, si prega di scaricare di nuovo.",
|
|
30
|
+
"another import action is running, please try again later.": "un'altra azione di importazione è in corso, riprova più tardi.",
|
|
31
|
+
"Please select": "Si prega di selezionare",
|
|
32
|
+
"Custom column title": "Titolo colonna personalizzato",
|
|
33
|
+
"Field description": "Descrizione del campo",
|
|
34
|
+
"Field description placeholder": "Inserisci descrizione del campo",
|
|
35
|
+
"Columns configuration is empty": "La configurazione delle colonne è vuota",
|
|
36
|
+
"Field not found: {{field}}": "Campo non trovato: {{field}}",
|
|
37
|
+
"Headers not found. Expected headers: {{headers}}": "Intestazioni non trovate. Intestazioni previste: {{headers}}",
|
|
38
|
+
"Header mismatch at column {{column}}: expected \"{{expected}}\", but got \"{{actual}}\"": "Incongruenza intestazione alla colonna {{column}}: previsto \"{{expected}}\", ma ottenuto \"{{actual}}\"",
|
|
39
|
+
"No data to import": "Nessun dato da importare",
|
|
40
|
+
"Failed to import row {{row}}, {{message}}, row data: {{data}}": "Errore nell'importazione della riga {{row}}, {{message}}, dati della riga: {{data}}",
|
|
41
|
+
"import-error": "Errore nell'importazione della riga {{rowIndex}}, dati della riga: {{rowData}}, causa: {{causeMessage}}"
|
|
42
|
+
}
|
package/dist/locale/zh-CN.json
CHANGED
|
@@ -39,5 +39,13 @@
|
|
|
39
39
|
"Header mismatch at column {{column}}: expected \"{{expected}}\", but got \"{{actual}}\"": "第 {{column}} 列的表头不匹配:预期 \"{{expected}}\",实际是 \"{{actual}}\"",
|
|
40
40
|
"No data to import": "没有数据可导入",
|
|
41
41
|
"Failed to import row {{row}}, {{message}}, row data: {{data}}": "导入第 {{row}} 行失败,{{message}},行数据:{{data}}",
|
|
42
|
-
"import-error": "导入第 {{rowIndex}} 行失败,行数据:{{rowData}}, 原因:{{causeMessage}}"
|
|
42
|
+
"import-error": "导入第 {{rowIndex}} 行失败,行数据:{{rowData}}, 原因:{{causeMessage}}",
|
|
43
|
+
"Import completed": "导入完成:{{success}} 条记录已导入,{{updated}} 条记录已更新,{{skipped}} 条记录已跳过,共 {{total}} 条记录",
|
|
44
|
+
"Successfully imported": "成功导入",
|
|
45
|
+
"Updated records": "已更新记录",
|
|
46
|
+
"Skipped records": "已跳过记录",
|
|
47
|
+
"Total records": "总记录数",
|
|
48
|
+
"View result": "查看结果",
|
|
49
|
+
"ImportResult": "已导入 {{success}} 条,更新 {{updated}} 条,跳过 {{skipped}} 条,共 {{total}} 条",
|
|
50
|
+
"Task result": "任务结果"
|
|
43
51
|
}
|
|
@@ -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-
|
|
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-03-11T05:43:31.416Z"}
|
|
@@ -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-
|
|
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-03-11T05:43:32.913Z"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "操作:导入记录",
|
|
5
5
|
"description": "Import records using excel templates. You can configure which fields to import and templates will be generated automatically.",
|
|
6
6
|
"description.zh-CN": "使用 Excel 模板导入数据,可以配置导入哪些字段,自动生成模板。",
|
|
7
|
-
"version": "1.6.0
|
|
7
|
+
"version": "1.6.0",
|
|
8
8
|
"license": "AGPL-3.0",
|
|
9
9
|
"main": "./dist/server/index.js",
|
|
10
10
|
"homepage": "https://docs.nocobase.com/handbook/action-import",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@nocobase/test": "1.x",
|
|
37
37
|
"@nocobase/utils": "1.x"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "7422d72a4e515a11300860028a26030ed5732135",
|
|
40
40
|
"keywords": [
|
|
41
41
|
"Actions"
|
|
42
42
|
]
|