@nocobase/plugin-action-import 1.9.20 → 1.9.22
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("file-saver"),require("@formily/shared"),require("@nocobase/client"),require("react-dom"),require("@formily/antd-v5"),require("react"),require("@emotion/css"),require("@formily/react"),require("@nocobase/utils/client"),require("@ant-design/icons"),require("antd"),require("lodash"),require("react-i18next")):"function"==typeof define&&define.amd?define("@nocobase/plugin-action-import",["file-saver","@formily/shared","@nocobase/client","react-dom","@formily/antd-v5","react","@emotion/css","@formily/react","@nocobase/utils/client","@ant-design/icons","antd","lodash","react-i18next"],t):"object"==typeof exports?exports["@nocobase/plugin-action-import"]=t(require("file-saver"),require("@formily/shared"),require("@nocobase/client"),require("react-dom"),require("@formily/antd-v5"),require("react"),require("@emotion/css"),require("@formily/react"),require("@nocobase/utils/client"),require("@ant-design/icons"),require("antd"),require("lodash"),require("react-i18next")):e["@nocobase/plugin-action-import"]=t(e["file-saver"],e["@formily/shared"],e["@nocobase/client"],e["react-dom"],e["@formily/antd-v5"],e.react,e["@emotion/css"],e["@formily/react"],e["@nocobase/utils/client"],e["@ant-design/icons"],e.antd,e.lodash,e["react-i18next"])}(self,function(e,t,n,r,o,i,a,l,c,u,s,p,f){return function(){"use strict";var m={482:function(e){e.exports=u},964:function(e){e.exports=a},632:function(e){e.exports=o},505:function(e){e.exports=l},875:function(e){e.exports=t},772:function(e){e.exports=n},584:function(e){e.exports=c},721:function(e){e.exports=s},346:function(t){t.exports=e},467:function(e){e.exports=p},156:function(e){e.exports=i},111:function(e){e.exports=r},238:function(e){e.exports=f}},d={};function y(e){var t=d[e];if(void 0!==t)return t.exports;var n=d[e]={exports:{}};return m[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 b={};return!function(){y.r(b),y.d(b,{PluginActionImportClient:function(){return ed},ImportActionInitializer:function(){return f},useImportStartAction:function(){return H},DownloadTips:function(){return d},initImportSettings:function(){return p},ImportContextProvider:function(){return er},ImportWarning:function(){return m},ImportDesigner:function(){return E},default:function(){return ey},useDownloadXlsxTemplateAction:function(){return $},ImportPluginProvider:function(){return en}});var e=y(875),t=y(772),n=y(156),r=y.n(n),o=y(238);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=["id","createdAt","createdBy","updatedAt","updatedBy"],c=function(e){var n=(0,t.useCollectionManager_deprecated)().getCollectionFields,r=n(e),o=function(e,t){if(!(!e.interface||l.includes(e.interface))){var r={name:e.name,title:(null==e||null==(o=e.uiSchema)?void 0:o.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 o,c,u=i(n(e.target),t+1).filter(Boolean);r.children=r.children||[],(c=r.children).push.apply(c,function(e){if(Array.isArray(e))return a(e)}(u)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(u)||function(e,t){if(e){if("string"==typeof e)return a(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 a(e,t)}}(u)||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}},i=function(e,t){var n=[];return e.forEach(function(e){var r=o(e,t);r&&n.push(r)}),n};return i(r,1)},u=y(721),s=y(584),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")})},v=y(632),h=y(505),g="action-import";function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function S(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function I(){var e=S(["\n width: 100%;\n & .ant-space-item:nth-child(2) {\n flex: 1;\n }\n "]);return I=function(){return e},e}function O(){var e=S(["\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 O=function(){return e},e}var w=["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel","application/wps-office.xlsx"],A=function(){var e=(0,o.useTranslation)(g).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(g,'"}) }}'),"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)(I())},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(g,'"}) }}')}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:'{{ t("Add importable field", {ns: "'.concat(g,'"}) }}'),"x-component":"ArrayItems.Addition","x-component-props":{className:(0,t.css)(O())}}}}}},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 w.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 x(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 x(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 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,h.useField)(),f=(0,h.useFieldSchema)(),m=(0,o.useTranslation)().t,d=(0,t.useDesignable)().dn,y=(e=(0,n.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 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)}}(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.")}()),b=y[0],g=y[1],x=A().importSettingsSchema;return(0,n.useEffect)(function(){g(x)},[p.address,null==f||null==(i=f["x-action-settings"])?void 0:i.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==(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:(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:b,initialValues:C({},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:(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=y(111),D=(0,n.createContext)(null);D.displayName="ImportContext";var M=function(){return(0,n.useContext)(D)},k=y(482),F=y(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},B=function(e){var n=(0,o.useTranslation)(g).t,i=M(),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:l===R.IMPORTED,onCancel:d},r().createElement("div",{className:(0,t.css)(q())},l===R.IMPORTING&&r().createElement(u.Spin,{indicator:r().createElement(k.LoadingOutlined,{style:{fontSize:24},spin:!0}),tip:n("Excel data importing")}),l===R.IMPORTED&&r().createElement(u.Space,{direction:"vertical",align:"center"},r().createElement(k.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,F.saveAs)(e,"fail.xlsx")}},n("To download the failure data")),r().createElement(u.Button,{type:"primary",onClick:d},n("Done"))))))},U=y(467),_=y.n(U);function z(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 N(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){z(i,r,o,a,l,"next",e)}function l(e){z(i,r,o,a,l,"throw",e)}a(void 0)})}}function V(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,t.useActionContext)().fieldSchema,n=(0,h.useFieldSchema)(),r=e||n;r&&"importXlsx"!==r["x-action"];)console.log("schema",r=r.parent);return{schema:r}},X=function(e){return e&&Array.isArray(e)?e:[]},$=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=G().schema;return{run:function(){return N(function(){var t,r,a,s,p,f,m;return V(this,function(d){switch(d.label){case 0:return s=(a=_().cloneDeep(null!=(r=null==u||null==(t=u["x-action-settings"])?void 0:t.importSettings)?r:{})).importColumns,p=a.explain,f=X(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,F.saveAs)(m,"".concat(n(c),".xlsx")),[2]}})})()}}},H=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=G().schema,s=(0,h.useForm)(),p=(0,t.useActionContext)().setVisible,f=M(),m=f.setImportModalVisible,d=f.setImportStatus,y=f.setImportResult,b=s.values.upload,v=(0,t.useDataBlockResource)();return(0,n.useEffect)(function(){s.reset()},[]),{run:function(){return N(function(){var e,t,n,i,f,b,h,g,x,S,I,O,w,A;return V(this,function(j){switch(j.label){case 0:b=(f=_().cloneDeep(null!=(i=null==u||null==(e=u["x-action-settings"])?void 0:e.importSettings)?i:{})).importColumns,h=f.explain,g=X(b).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",h),I=(null==u||null==(t=u["x-action-settings"])?void 0:t.importMode)||"auto",O=(null==u||null==(n=u["x-action-settings"])?void 0:n.timeout)||6e5,p(!1),m(!0),d(R.IMPORTING),j.label=1;case 1:return j.trys.push([1,6,,7]),[4,v.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==r||null==(A=r.refresh)?void 0:A.call(r)];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==b?void 0:b.length)===0||(null==(e=s.errors)?void 0:e.length)>0}},L=y(964);function W(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 J(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function K(){var e=J(["\n .ant-formily-item-label {\n height: var(--controlHeightLG);\n }\n "]);return K=function(){return e},e}function Q(){var e=J(["\n margin-top: 5px;\n "]);return Q=function(){return e},e}var Y={type:"void",name:"import-modal",title:'{{ t("Import Data", {ns: "'.concat(g,'" }) }}'),"x-component":"Action.Modal","x-decorator":"Form","x-component-props":{width:"100%",style:{maxWidth:"750px"},className:(0,L.css)(K())},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(g,'" }) }}'),"x-component":"FormItem","x-acl-ignore":!0,properties:{tip:{type:"void","x-component":"DownloadTips"},downloadAction:{type:"void",title:'{{ t("Download template", {ns: "'.concat(g,'" }) }}'),"x-component":"Action","x-component-props":{className:(0,L.css)(Q()),useAction:"{{ useDownloadXlsxTemplateAction }}"}}}},upload:{type:"array",title:'{{ t("Step 2: Upload Excel", {ns: "'.concat(g,'" }) }}'),"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(g,'" }) }}'),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(g,'" }) }}'),"x-component":"Action","x-component-props":{type:"primary",htmlType:"submit",useAction:"{{ useImportStartAction }}"},"x-reactions":{dependencies:["upload"],fulfill:{run:"validateUpload($form, $self, $deps)"}}}}}}}}},Z=function(e){var o,i,a,l=(o=(0,n.useState)(!1),function(e){if(Array.isArray(e))return e}(o)||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}}(o,2)||function(e,t){if(e){if("string"==typeof e)return W(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 W(e,t)}}(o,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=l[0],u=l[1],s=(0,t.useCompile)(),p=(0,h.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,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)),r().createElement(t.SchemaComponent,{schema:Y}))};function ee(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 et(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 ee(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 ee(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 en=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:Z},scope:{uploadValidator:o,validateUpload:a,beforeUploadHandler:i,useDownloadXlsxTemplateAction:$,useImportStartAction:H}},r().createElement(er,null,e.children))},er=function(e){var t=et((0,n.useState)(!1),2),o=t[0],i=t[1],a=et((0,n.useState)(R.IMPORTING),2),l=a[0],c=a[1],u=et((0,n.useState)(null),2),s=u[0],p=u[1];return r().createElement(D.Provider,{value:{importModalVisible:o,setImportModalVisible:i,importStatus:l,setImportStatus:c,importResult:s,setImportResult:p}},(0,T.createPortal)(r().createElement(B,null),document.body),e.children)};function eo(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 ei(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ea(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){ei(e,t,n[t])})}return e}var el=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 ea({},(0,t.useSchemaToolbar)().linkageRulesProps)}},{name:"importableFields",type:"actionModal",useComponentProps:function(){var e,r,i,a,l=(0,h.useField)(),c=(0,h.useFieldSchema)(),u=(0,o.useTranslation)().t,s=(0,t.useDesignable)().dn,p=(e=(0,n.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 eo(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 eo(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=A().importSettingsSchema;return(0,n.useEffect)(function(){m(d)},[l.address,null==c||null==(r=c["x-action-settings"])?void 0:r.importSettings]),{title:u("Importable fields"),schema:ea({},f),initialValues:ea({},null!=(a=null==c||null==(i=c["x-action-settings"])?void 0:i.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:(ei(t={},"x-uid",c["x-uid"]),ei(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")}}}}]});function ec(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 eu(e,t,n){return(eu=em()?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 es(e){return(es=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 ef(e){var t="function"==typeof Map?new Map:void 0;return(ef=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 eu(e,arguments,es(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ep(n,e)})(e)}function em(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(em=function(){return!!e})()}var ed=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=es(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,em()?Reflect.construct(e,t||[],es(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&ep(r,e),n=[{key:"load",value:function(){var e,n=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 n.app.use(en),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==(r=n.app.schemaInitializerManager.get("table:configureActions"))||r.add("enableActions.import",e),n.app.schemaInitializerManager.addItem("gantt:configureActions","enableActions.import",e),n.app.schemaSettingsManager.add(el),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ec(i,r,o,a,l,"next",e)}function l(e){ec(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,n),r}(ef(t.Plugin)),ey=ed}(),b}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("file-saver"),require("@formily/shared"),require("@nocobase/client"),require("react-dom"),require("@formily/antd-v5"),require("react"),require("@emotion/css"),require("@formily/react"),require("@nocobase/utils/client"),require("@ant-design/icons"),require("antd"),require("lodash"),require("react-i18next")):"function"==typeof define&&define.amd?define("@nocobase/plugin-action-import",["file-saver","@formily/shared","@nocobase/client","react-dom","@formily/antd-v5","react","@emotion/css","@formily/react","@nocobase/utils/client","@ant-design/icons","antd","lodash","react-i18next"],t):"object"==typeof exports?exports["@nocobase/plugin-action-import"]=t(require("file-saver"),require("@formily/shared"),require("@nocobase/client"),require("react-dom"),require("@formily/antd-v5"),require("react"),require("@emotion/css"),require("@formily/react"),require("@nocobase/utils/client"),require("@ant-design/icons"),require("antd"),require("lodash"),require("react-i18next")):e["@nocobase/plugin-action-import"]=t(e["file-saver"],e["@formily/shared"],e["@nocobase/client"],e["react-dom"],e["@formily/antd-v5"],e.react,e["@emotion/css"],e["@formily/react"],e["@nocobase/utils/client"],e["@ant-design/icons"],e.antd,e.lodash,e["react-i18next"])}(self,function(e,t,n,r,o,i,a,l,c,u,s,p,f){return function(){"use strict";var m={482:function(e){e.exports=u},964:function(e){e.exports=a},632:function(e){e.exports=o},505:function(e){e.exports=l},875:function(e){e.exports=t},772:function(e){e.exports=n},584:function(e){e.exports=c},721:function(e){e.exports=s},346:function(t){t.exports=e},467:function(e){e.exports=p},156:function(e){e.exports=i},111:function(e){e.exports=r},238:function(e){e.exports=f}},d={};function y(e){var t=d[e];if(void 0!==t)return t.exports;var n=d[e]={exports:{}};return m[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 b={};return!function(){y.r(b),y.d(b,{PluginActionImportClient:function(){return ed},ImportActionInitializer:function(){return f},useImportStartAction:function(){return H},DownloadTips:function(){return d},initImportSettings:function(){return p},ImportContextProvider:function(){return er},ImportWarning:function(){return m},ImportDesigner:function(){return E},default:function(){return ey},useDownloadXlsxTemplateAction:function(){return $},ImportPluginProvider:function(){return en}});var e=y(875),t=y(772),n=y(156),r=y.n(n),o=y(238);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=function(e,t){if(!(!e.interface||l.includes(e.interface))){var r={name:e.name,title:(null==e||null==(o=e.uiSchema)?void 0:o.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 o,c,u=i(n(e.target),t+1).filter(Boolean);r.children=r.children||[],(c=r.children).push.apply(c,function(e){if(Array.isArray(e))return a(e)}(u)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(u)||function(e,t){if(e){if("string"==typeof e)return a(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 a(e,t)}}(u)||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}},i=function(e,t){var n=[];return e.forEach(function(e){var r=o(e,t);r&&n.push(r)}),n};return i(r,1)},u=y(721),s=y(584),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")})},v=y(632),h=y(505),g="action-import";function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function S(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function I(){var e=S(["\n width: 100%;\n & .ant-space-item:nth-child(2) {\n flex: 1;\n }\n "]);return I=function(){return e},e}function O(){var e=S(["\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 O=function(){return e},e}var w=["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel","application/wps-office.xlsx"],A=function(){var e=(0,o.useTranslation)(g).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(g,'"}) }}'),"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)(I())},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(g,'"}) }}')}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:'{{ t("Add importable field", {ns: "'.concat(g,'"}) }}'),"x-component":"ArrayItems.Addition","x-component-props":{className:(0,t.css)(O())}}}}}},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 w.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 x(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 x(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 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,h.useField)(),f=(0,h.useFieldSchema)(),m=(0,o.useTranslation)().t,d=(0,t.useDesignable)().dn,y=(e=(0,n.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 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)}}(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.")}()),b=y[0],g=y[1],x=A().importSettingsSchema;return(0,n.useEffect)(function(){g(x)},[p.address,null==f||null==(i=f["x-action-settings"])?void 0:i.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==(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:(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:b,initialValues:C({},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:(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=y(111),D=(0,n.createContext)(null);D.displayName="ImportContext";var M=function(){return(0,n.useContext)(D)},k=y(482),F=y(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},B=function(e){var n=(0,o.useTranslation)(g).t,i=M(),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:l===R.IMPORTED,onCancel:d},r().createElement("div",{className:(0,t.css)(q())},l===R.IMPORTING&&r().createElement(u.Spin,{indicator:r().createElement(k.LoadingOutlined,{style:{fontSize:24},spin:!0}),tip:n("Excel data importing")}),l===R.IMPORTED&&r().createElement(u.Space,{direction:"vertical",align:"center"},r().createElement(k.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,F.saveAs)(e,"fail.xlsx")}},n("To download the failure data")),r().createElement(u.Button,{type:"primary",onClick:d},n("Done"))))))},U=y(467),_=y.n(U);function z(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 N(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){z(i,r,o,a,l,"next",e)}function l(e){z(i,r,o,a,l,"throw",e)}a(void 0)})}}function V(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,t.useActionContext)().fieldSchema,n=(0,h.useFieldSchema)(),r=e||n;r&&"importXlsx"!==r["x-action"];)console.log("schema",r=r.parent);return{schema:r}},X=function(e){return e&&Array.isArray(e)?e:[]},$=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=G().schema;return{run:function(){return N(function(){var t,r,a,s,p,f,m;return V(this,function(d){switch(d.label){case 0:return s=(a=_().cloneDeep(null!=(r=null==u||null==(t=u["x-action-settings"])?void 0:t.importSettings)?r:{})).importColumns,p=a.explain,f=X(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,F.saveAs)(m,"".concat(n(c),".xlsx")),[2]}})})()}}},H=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=G().schema,s=(0,h.useForm)(),p=(0,t.useActionContext)().setVisible,f=M(),m=f.setImportModalVisible,d=f.setImportStatus,y=f.setImportResult,b=s.values.upload,v=(0,t.useDataBlockResource)();return(0,n.useEffect)(function(){s.reset()},[]),{run:function(){return N(function(){var e,t,n,i,f,b,h,g,x,S,I,O,w,A;return V(this,function(j){switch(j.label){case 0:b=(f=_().cloneDeep(null!=(i=null==u||null==(e=u["x-action-settings"])?void 0:e.importSettings)?i:{})).importColumns,h=f.explain,g=X(b).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",h),I=(null==u||null==(t=u["x-action-settings"])?void 0:t.importMode)||"auto",O=(null==u||null==(n=u["x-action-settings"])?void 0:n.timeout)||6e5,p(!1),m(!0),d(R.IMPORTING),j.label=1;case 1:return j.trys.push([1,6,,7]),[4,v.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==r||null==(A=r.refresh)?void 0:A.call(r)];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==b?void 0:b.length)===0||(null==(e=s.errors)?void 0:e.length)>0}},L=y(964);function W(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 J(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function K(){var e=J(["\n .ant-formily-item-label {\n height: var(--controlHeightLG);\n }\n "]);return K=function(){return e},e}function Q(){var e=J(["\n margin-top: 5px;\n "]);return Q=function(){return e},e}var Y={type:"void",name:"import-modal",title:'{{ t("Import Data", {ns: "'.concat(g,'" }) }}'),"x-component":"Action.Modal","x-decorator":"Form","x-component-props":{width:"100%",style:{maxWidth:"750px"},className:(0,L.css)(K())},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(g,'" }) }}'),"x-component":"FormItem","x-acl-ignore":!0,properties:{tip:{type:"void","x-component":"DownloadTips"},downloadAction:{type:"void",title:'{{ t("Download template", {ns: "'.concat(g,'" }) }}'),"x-component":"Action","x-component-props":{className:(0,L.css)(Q()),useAction:"{{ useDownloadXlsxTemplateAction }}"}}}},upload:{type:"array",title:'{{ t("Step 2: Upload Excel", {ns: "'.concat(g,'" }) }}'),"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(g,'" }) }}'),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(g,'" }) }}'),"x-component":"Action","x-component-props":{type:"primary",htmlType:"submit",useAction:"{{ useImportStartAction }}"},"x-reactions":{dependencies:["upload"],fulfill:{run:"validateUpload($form, $self, $deps)"}}}}}}}}},Z=function(e){var o,i,a,l=(o=(0,n.useState)(!1),function(e){if(Array.isArray(e))return e}(o)||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}}(o,2)||function(e,t){if(e){if("string"==typeof e)return W(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 W(e,t)}}(o,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=l[0],u=l[1],s=(0,t.useCompile)(),p=(0,h.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,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)),r().createElement(t.SchemaComponent,{schema:Y}))};function ee(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 et(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 ee(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 ee(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 en=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:Z},scope:{uploadValidator:o,validateUpload:a,beforeUploadHandler:i,useDownloadXlsxTemplateAction:$,useImportStartAction:H}},r().createElement(er,null,e.children))},er=function(e){var t=et((0,n.useState)(!1),2),o=t[0],i=t[1],a=et((0,n.useState)(R.IMPORTING),2),l=a[0],c=a[1],u=et((0,n.useState)(null),2),s=u[0],p=u[1];return r().createElement(D.Provider,{value:{importModalVisible:o,setImportModalVisible:i,importStatus:l,setImportStatus:c,importResult:s,setImportResult:p}},(0,T.createPortal)(r().createElement(B,null),document.body),e.children)};function eo(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 ei(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ea(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){ei(e,t,n[t])})}return e}var el=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 ea({},(0,t.useSchemaToolbar)().linkageRulesProps)}},{name:"importableFields",type:"actionModal",useComponentProps:function(){var e,r,i,a,l=(0,h.useField)(),c=(0,h.useFieldSchema)(),u=(0,o.useTranslation)().t,s=(0,t.useDesignable)().dn,p=(e=(0,n.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 eo(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 eo(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=A().importSettingsSchema;return(0,n.useEffect)(function(){m(d)},[l.address,null==c||null==(r=c["x-action-settings"])?void 0:r.importSettings]),{title:u("Importable fields"),schema:ea({},f),initialValues:ea({},null!=(a=null==c||null==(i=c["x-action-settings"])?void 0:i.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:(ei(t={},"x-uid",c["x-uid"]),ei(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")}}}}]});function ec(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 eu(e,t,n){return(eu=em()?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 es(e){return(es=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 ef(e){var t="function"==typeof Map?new Map:void 0;return(ef=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 eu(e,arguments,es(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ep(n,e)})(e)}function em(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(em=function(){return!!e})()}var ed=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=es(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,em()?Reflect.construct(e,t||[],es(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&ep(r,e),n=[{key:"load",value:function(){var e,n=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 n.app.use(en),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==(r=n.app.schemaInitializerManager.get("table:configureActions"))||r.add("enableActions.import",e),n.app.schemaInitializerManager.addItem("gantt:configureActions","enableActions.import",e),n.app.schemaSettingsManager.add(el),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ec(i,r,o,a,l,"next",e)}function l(e){ec(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,n),r}(ef(t.Plugin)),ey=ed}(),b}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -10,24 +10,24 @@
|
|
|
10
10
|
module.exports = {
|
|
11
11
|
"@emotion/css": "11.13.0",
|
|
12
12
|
"@formily/react": "2.3.0",
|
|
13
|
-
"@nocobase/client": "1.9.
|
|
13
|
+
"@nocobase/client": "1.9.22",
|
|
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.2",
|
|
18
18
|
"antd": "5.24.2",
|
|
19
|
-
"@nocobase/utils": "1.9.
|
|
19
|
+
"@nocobase/utils": "1.9.22",
|
|
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.0",
|
|
25
|
-
"@nocobase/server": "1.9.
|
|
26
|
-
"@nocobase/actions": "1.9.
|
|
27
|
-
"@nocobase/database": "1.9.
|
|
25
|
+
"@nocobase/server": "1.9.22",
|
|
26
|
+
"@nocobase/actions": "1.9.22",
|
|
27
|
+
"@nocobase/database": "1.9.22",
|
|
28
28
|
"async-mutex": "0.5.0",
|
|
29
|
-
"@nocobase/data-source-manager": "1.9.
|
|
29
|
+
"@nocobase/data-source-manager": "1.9.22",
|
|
30
30
|
"sequelize": "6.35.2",
|
|
31
|
-
"@nocobase/logger": "1.9.
|
|
31
|
+
"@nocobase/logger": "1.9.22",
|
|
32
32
|
"mathjs": "10.6.4"
|
|
33
33
|
};
|
|
@@ -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-
|
|
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-09T05:31:57.817Z"}
|
|
@@ -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-
|
|
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-09T05:32:00.617Z"}
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "Import records using excel templates. You can configure which fields to import and templates will be generated automatically.",
|
|
7
7
|
"description.ru-RU": "Импорт записей с помощью шаблонов Excel: можно настроить, какие поля импортировать, шаблоны будут генерироваться автоматически.",
|
|
8
8
|
"description.zh-CN": "使用 Excel 模板导入数据,可以配置导入哪些字段,自动生成模板。",
|
|
9
|
-
"version": "1.9.
|
|
9
|
+
"version": "1.9.22",
|
|
10
10
|
"license": "AGPL-3.0",
|
|
11
11
|
"main": "./dist/server/index.js",
|
|
12
12
|
"homepage": "https://docs.nocobase.com/handbook/action-import",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@nocobase/test": "1.x",
|
|
40
40
|
"@nocobase/utils": "1.x"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "8c563adec50841006fdda8f6055be127b174da76",
|
|
43
43
|
"keywords": [
|
|
44
44
|
"Actions"
|
|
45
45
|
]
|