@nocobase/plugin-action-import 1.0.0-alpha.13 → 1.0.0-alpha.15

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.
@@ -6,12 +6,6 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- import { Schema } from '@formily/react';
10
9
  import React from 'react';
11
- export declare const useCurrentSchema: (action: string, key: string, find?: (schema: Schema, key: string, action: string) => any, rm?: (schema: any, cb: any) => any) => {
12
- schema: any;
13
- exists: boolean;
14
- remove(): void;
15
- };
16
10
  export declare const ImportWarning: () => React.JSX.Element;
17
11
  export declare const ImportActionInitializer: () => React.JSX.Element;
@@ -7,27 +7,27 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- (function(l,c){typeof exports=="object"&&typeof module!="undefined"?c(exports,require("react/jsx-runtime"),require("@formily/react"),require("@formily/shared"),require("@nocobase/client"),require("antd"),require("react-i18next"),require("@formily/antd-v5"),require("react"),require("react-dom"),require("@ant-design/icons"),require("lodash")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@formily/react","@formily/shared","@nocobase/client","antd","react-i18next","@formily/antd-v5","react","react-dom","@ant-design/icons","lodash"],c):(l=typeof globalThis!="undefined"?globalThis:l||self,c(l["@nocobase/plugin-action-import"]={},l.jsxRuntime,l["@formily/react"],l["@formily/shared"],l["@nocobase/client"],l.antd,l["react-i18next"],l["@formily/antd-v5"],l.react,l["react-dom"],l["@ant-design/icons"],l.lodash))})(this,function(l,c,f,q,p,F,E,B,y,U,V,H){"use strict";var Ae=Object.defineProperty,we=Object.defineProperties;var Ce=Object.getOwnPropertyDescriptors;var ue=Object.getOwnPropertySymbols;var Te=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable;var xe=(l,c,f)=>c in l?Ae(l,c,{enumerable:!0,configurable:!0,writable:!0,value:f}):l[c]=f,D=(l,c)=>{for(var f in c||(c={}))Te.call(c,f)&&xe(l,f,c[f]);if(ue)for(var f of ue(c))Ee.call(c,f)&&xe(l,f,c[f]);return l},R=(l,c)=>we(l,Ce(c));var _=(l,c,f)=>new Promise((q,p)=>{var F=y=>{try{B(f.next(y))}catch(U){p(U)}},E=y=>{try{B(f.throw(y))}catch(U){p(U)}},B=y=>y.done?q(y.value):Promise.resolve(y.value).then(F,E);B((f=f.apply(l,c)).next())});const w="action-import",fe=["id","createdAt","createdBy","updatedAt","updatedBy"],X=t=>{const{getCollectionFields:e}=p.useCollectionManager_deprecated(),s=e(t),o=(a,n)=>{var h;if(!a.interface||fe.includes(a.interface))return;const d={name:a.name,title:((h=a==null?void 0:a.uiSchema)==null?void 0:h.title)||a.name,schema:a==null?void 0:a.uiSchema};if(!a.target||n>=2)return d;if(a.target){const r=e(a.target),i=x(r,n+1).filter(Boolean);d.children=d.children||[],d.children.push(...i)}return d},x=(a,n)=>{const d=[];return a.forEach(h=>{const r=o(h,n);r&&d.push(r)}),d};return x(s,1)},he="action-import";function ge(){return E.useTranslation([he,"client"],{nsMode:"fallback"})}const G=(t,e,s)=>t.reduceProperties((o,x)=>{if(x[e]===s)return x;const a=G(x,e,s);return a||o}),ye=(t,e)=>e(t),W=(t,e,s=G,o=ye)=>{const x=f.useFieldSchema(),{remove:a}=p.useDesignable(),n=s(x,e,t);return{schema:n,exists:!!n,remove(){n&&o(n,a)}}},ve=t=>({importColumns:t==null?void 0:t.filter(s=>!s.children).map(s=>({dataIndex:[s.name]})),explain:""}),J=()=>{const{t}=ge();return c.jsx(F.Alert,{type:"warning",style:{marginBottom:"10px"},message:t("Import warning")})},K=()=>{const t=p.useSchemaInitializerItem(),{insert:e}=p.useSchemaInitializer(),{exists:s,remove:o}=W("importXlsx","x-action",t.find,t.remove),{name:x}=p.useCollection_deprecated(),a=X(x),n={type:"void",title:'{{ t("Import") }}',"x-action":"importXlsx","x-action-settings":{importSettings:{importColumns:[],explain:""}},"x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:import","x-component":"Action","x-component-props":{icon:"CloudUploadOutlined",openMode:"modal"},properties:{modal:{type:"void",title:`{{ t("Import Data", {ns: "${w}" }) }}`,"x-component":"Action.Container","x-decorator":"Form","x-component-props":{width:"50%",className:p.css`
10
+ (function(p,i){typeof exports=="object"&&typeof module!="undefined"?i(exports,require("react/jsx-runtime"),require("@formily/shared"),require("@nocobase/client"),require("antd"),require("react-i18next"),require("@formily/antd-v5"),require("@formily/react"),require("react"),require("react-dom"),require("@ant-design/icons"),require("lodash")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@formily/shared","@nocobase/client","antd","react-i18next","@formily/antd-v5","@formily/react","react","react-dom","@ant-design/icons","lodash"],i):(p=typeof globalThis!="undefined"?globalThis:p||self,i(p["@nocobase/plugin-action-import"]={},p.jsxRuntime,p["@formily/shared"],p["@nocobase/client"],p.antd,p["react-i18next"],p["@formily/antd-v5"],p["@formily/react"],p.react,p["react-dom"],p["@ant-design/icons"],p.lodash))})(this,function(p,i,g,c,M,F,N,T,y,U,R,V){"use strict";var Ie=Object.defineProperty,Se=Object.defineProperties;var be=Object.getOwnPropertyDescriptors;var le=Object.getOwnPropertySymbols;var Ae=Object.prototype.hasOwnProperty,we=Object.prototype.propertyIsEnumerable;var de=(p,i,g)=>i in p?Ie(p,i,{enumerable:!0,configurable:!0,writable:!0,value:g}):p[i]=g,j=(p,i)=>{for(var g in i||(i={}))Ae.call(i,g)&&de(p,g,i[g]);if(le)for(var g of le(i))we.call(i,g)&&de(p,g,i[g]);return p},me=(p,i)=>Se(p,be(i));var q=(p,i,g)=>new Promise((c,M)=>{var F=y=>{try{T(g.next(y))}catch(U){M(U)}},N=y=>{try{T(g.throw(y))}catch(U){M(U)}},T=y=>y.done?c(y.value):Promise.resolve(y.value).then(F,N);T((g=g.apply(p,i)).next())});const w="action-import",ue="action-import";function xe(){return F.useTranslation([ue,"client"],{nsMode:"fallback"})}const fe=["id","createdAt","createdBy","updatedAt","updatedBy"],H=t=>{const{getCollectionFields:e}=c.useCollectionManager_deprecated(),l=e(t),n=(s,r)=>{var h;if(!s.interface||fe.includes(s.interface))return;const m={name:s.name,title:((h=s==null?void 0:s.uiSchema)==null?void 0:h.title)||s.name,schema:s==null?void 0:s.uiSchema};if(!s.target||r>=2)return m;if(s.target){const o=e(s.target),a=x(o,r+1).filter(Boolean);m.children=m.children||[],m.children.push(...a)}return m},x=(s,r)=>{const m=[];return s.forEach(h=>{const o=n(h,r);o&&m.push(o)}),m};return x(l,1)},he=t=>({importColumns:t==null?void 0:t.filter(l=>!l.children).map(l=>({dataIndex:[l.name]})),explain:""}),X=()=>{const{t}=xe();return i.jsx(M.Alert,{type:"warning",style:{marginBottom:"10px"},message:t("Import warning")})},G=()=>{const t=c.useSchemaInitializerItem(),{insert:e}=c.useSchemaInitializer(),{name:l}=c.useCollection_deprecated(),n=H(l),x={type:"void",title:'{{ t("Import") }}',"x-action":"importXlsx","x-action-settings":{importSettings:{importColumns:[],explain:""}},"x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:import","x-component":"Action","x-component-props":{icon:"CloudUploadOutlined",openMode:"modal"},properties:{modal:{type:"void",title:`{{ t("Import Data", {ns: "${w}" }) }}`,"x-component":"Action.Container","x-decorator":"Form","x-component-props":{width:"50%",className:c.css`
11
11
  .ant-formily-item-label {
12
12
  height: var(--controlHeightLG);
13
13
  }
14
- `},properties:{formLayout:{type:"void","x-component":"FormLayout",properties:{warning:{type:"void","x-component":"ImportWarning"},download:{type:"void",title:`{{ t("Step 1: Download template", {ns: "${w}" }) }}`,"x-component":"FormItem","x-acl-ignore":!0,properties:{tip:{type:"void","x-component":"Markdown.Void","x-editable":!1,"x-component-props":{style:{padding:"var(--paddingContentVerticalSM)",backgroundColor:"var(--colorInfoBg)",border:"1px solid var(--colorInfoBorder)",color:"var(--colorText)",marginBottom:"var(--marginSM)"},content:`{{ t("Download tip", {ns: "${w}" }) }}`}},downloadAction:{type:"void",title:`{{ t("Download template", {ns: "${w}" }) }}`,"x-component":"Action","x-component-props":{className:p.css`
14
+ `},properties:{formLayout:{type:"void","x-component":"FormLayout",properties:{warning:{type:"void","x-component":"ImportWarning"},download:{type:"void",title:`{{ t("Step 1: Download template", {ns: "${w}" }) }}`,"x-component":"FormItem","x-acl-ignore":!0,properties:{tip:{type:"void","x-component":"Markdown.Void","x-editable":!1,"x-component-props":{style:{padding:"var(--paddingContentVerticalSM)",backgroundColor:"var(--colorInfoBg)",border:"1px solid var(--colorInfoBorder)",color:"var(--colorText)",marginBottom:"var(--marginSM)"},content:`{{ t("Download tip", {ns: "${w}" }) }}`}},downloadAction:{type:"void",title:`{{ t("Download template", {ns: "${w}" }) }}`,"x-component":"Action","x-component-props":{className:c.css`
15
15
  margin-top: 5px;
16
- `,useAction:"{{ useDownloadXlsxTemplateAction }}"}}}},upload:{type:"array",title:`{{ t("Step 2: Upload Excel", {ns: "${w}" }) }}`,"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: "${w}" }) }}`,beforeUpload:"{{ beforeUploadHandler }}"}}}},footer:{"x-component":"Action.Container.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: "${w}" }) }}`,"x-component":"Action","x-component-props":{type:"primary",htmlType:"submit",useAction:"{{ useImportStartAction }}"},"x-reactions":{dependencies:["upload"],fulfill:{run:"validateUpload($form, $self, $deps)"}}}}}}}}}}};return c.jsx(p.SchemaInitializerSwitch,R(D({},t),{checked:s,title:t.title,onClick:()=>{var h;if(s)return o();n["x-action-settings"].importSettings=ve(a);const d=q.merge(n||{},t.schema||{});(h=t==null?void 0:t.schemaInitialize)==null||h.call(t,d),e(d)}}))},Se=["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel"],$=()=>{const{t}=E.useTranslation(w),{name:e}=p.useCollection_deprecated(),s=X(e);return{importSettingsSchema:{type:"void","x-component":"Grid",properties:{explain:{type:"string",title:`{{ t("Import explain", {ns: "${w}"}) }}`,"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:p.css`
16
+ `,useAction:"{{ useDownloadXlsxTemplateAction }}"}}}},upload:{type:"array",title:`{{ t("Step 2: Upload Excel", {ns: "${w}" }) }}`,"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: "${w}" }) }}`,beforeUpload:"{{ beforeUploadHandler }}"}}}},footer:{"x-component":"Action.Container.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: "${w}" }) }}`,"x-component":"Action","x-component-props":{type:"primary",htmlType:"submit",useAction:"{{ useImportStartAction }}"},"x-reactions":{dependencies:["upload"],fulfill:{run:"validateUpload($form, $self, $deps)"}}}}}}}}}}};return i.jsx(c.SchemaInitializerItem,{title:t.title,onClick:()=>{var r;x["x-action-settings"].importSettings=he(n);const s=g.merge(x||{},t.schema||{});(r=t==null?void 0:t.schemaInitialize)==null||r.call(t,s),e(s)}})},ge=["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel"],$=()=>{const{t}=F.useTranslation(w),{name:e}=c.useCollection_deprecated(),l=H(e);return{importSettingsSchema:{type:"void","x-component":"Grid",properties:{explain:{type:"string",title:`{{ t("Import explain", {ns: "${w}"}) }}`,"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:c.css`
17
17
  width: 100%;
18
18
  & .ant-space-item:nth-child(2) {
19
19
  flex: 1;
20
20
  }
21
- `},properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},dataIndex:{type:"array","x-decorator":"FormItem","x-component":p.Cascader,required:!0,enum:s,"x-component-props":{fieldNames:{label:"title",value:"name",children:"children"},changeOnSelect:!1}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:`{{ t("Add importable field", {ns: "${w}"}) }}`,"x-component":"ArrayItems.Addition","x-component-props":{className:p.css`
21
+ `},properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},dataIndex:{type:"array","x-decorator":"FormItem","x-component":c.Cascader,required:!0,enum:l,"x-component-props":{fieldNames:{label:"title",value:"name",children:"children"},changeOnSelect:!1}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:`{{ t("Add importable field", {ns: "${w}"}) }}`,"x-component":"ArrayItems.Addition","x-component-props":{className:c.css`
22
22
  border-color: var(--colorSettings);
23
23
  color: var(--colorSettings);
24
24
  &.ant-btn-dashed:hover {
25
25
  border-color: var(--colorSettings);
26
26
  color: var(--colorSettings);
27
27
  }
28
- `}}}}}},beforeUploadHandler(){return!1},uploadValidator(o,x){var n;if(o.length>1)return{type:"error",message:t("Only one file is allowed to be uploaded")};const a=(n=o[0])!=null?n:{};return a.size>10*1024*1024?{type:"error",message:t("File size cannot exceed 10M")}:Se.includes(a.type)?"":{type:"error",message:t("Please upload the file of Excel")}},validateUpload(o,x,a){var d;const[n]=a;x.disabled=(n==null?void 0:n.length)===0,x.componentProps=R(D({},x.componentProps),{disabled:(n==null?void 0:n.length)===0||((d=o.errors)==null?void 0:d.length)>0})}}},Y=()=>{var d,h,r,i,g,m;const t=f.useField(),e=f.useFieldSchema(),{t:s}=E.useTranslation(),{dn:o}=p.useDesignable(),[x,a]=y.useState(),{importSettingsSchema:n}=$();return y.useEffect(()=>{a(n)},[t.address,(d=e==null?void 0:e["x-action-settings"])==null?void 0:d.importSettings]),c.jsxs(p.GeneralSchemaDesigner,{disableInitializer:!0,children:[c.jsx(p.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:e.title,"x-component-props":{}},icon:{"x-decorator":"FormItem","x-component":"IconPicker",title:s("Button icon"),default:(h=e==null?void 0:e["x-component-props"])==null?void 0:h.icon,"x-component-props":{}},type:{"x-decorator":"FormItem","x-component":"Radio.Group",title:s("Button background color"),default:(r=e==null?void 0:e["x-component-props"])!=null&&r.danger?"danger":((i=e==null?void 0:e["x-component-props"])==null?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:({title:u,icon:v,type:S})=>{e.title=u,t.title=u,t.componentProps.icon=v,t.componentProps.danger=S==="danger",t.componentProps.type=S,e["x-component-props"]=e["x-component-props"]||{},e["x-component-props"].icon=v,e["x-component-props"].danger=S==="danger",e["x-component-props"].type=S,o.emit("patch",{schema:{"x-uid":e["x-uid"],title:u,"x-component-props":D({},e["x-component-props"])}}),o.refresh()}}),c.jsx(p.SchemaSettingsActionModalItem,{title:s("Importable fields"),schema:x,initialValues:D({},(m=(g=e==null?void 0:e["x-action-settings"])==null?void 0:g.importSettings)!=null?m:{}),components:{ArrayItems:B.ArrayItems},onSubmit:({importColumns:u,explain:v})=>{const S=u==null?void 0:u.filter(b=>{var T;return(T=b==null?void 0:b.dataIndex)==null?void 0:T.length}).map(b=>({dataIndex:b.dataIndex.map(T=>{var I;return(I=T.name)!=null?I:T}),title:b.title}));e["x-action-settings"].importSettings={importColumns:S,explain:v},o.emit("patch",{schema:{"x-uid":e["x-uid"],"x-action-settings":e["x-action-settings"]}}),o.refresh()}}),c.jsx(p.SchemaSettingsDivider,{}),c.jsx(p.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:u=>u["x-component"]==="Space"||u["x-component"].endsWith("ActionBar"),confirm:{title:s("Delete action")}})]})},z=y.createContext(null);z.displayName="ImportContext";const Q=()=>y.useContext(z);var k=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Z={exports:{}};(function(t,e){(function(s,o){o()})(k,function(){function s(r,i){return typeof i=="undefined"?i={autoBom:!1}:typeof i!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),i={autoBom:!i}),i.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(r.type)?new Blob(["\uFEFF",r],{type:r.type}):r}function o(r,i,g){var m=new XMLHttpRequest;m.open("GET",r),m.responseType="blob",m.onload=function(){h(m.response,i,g)},m.onerror=function(){console.error("could not download file")},m.send()}function x(r){var i=new XMLHttpRequest;i.open("HEAD",r,!1);try{i.send()}catch(g){}return 200<=i.status&&299>=i.status}function a(r){try{r.dispatchEvent(new MouseEvent("click"))}catch(g){var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),r.dispatchEvent(i)}}var n=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof k=="object"&&k.global===k?k:void 0,d=n.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),h=n.saveAs||(typeof window!="object"||window!==n?function(){}:"download"in HTMLAnchorElement.prototype&&!d?function(r,i,g){var m=n.URL||n.webkitURL,u=document.createElement("a");i=i||r.name||"download",u.download=i,u.rel="noopener",typeof r=="string"?(u.href=r,u.origin===location.origin?a(u):x(u.href)?o(r,i,g):a(u,u.target="_blank")):(u.href=m.createObjectURL(r),setTimeout(function(){m.revokeObjectURL(u.href)},4e4),setTimeout(function(){a(u)},0))}:"msSaveOrOpenBlob"in navigator?function(r,i,g){if(i=i||r.name||"download",typeof r!="string")navigator.msSaveOrOpenBlob(s(r,g),i);else if(x(r))o(r,i,g);else{var m=document.createElement("a");m.href=r,m.target="_blank",setTimeout(function(){a(m)})}}:function(r,i,g,m){if(m=m||open("","_blank"),m&&(m.document.title=m.document.body.innerText="downloading..."),typeof r=="string")return o(r,i,g);var u=r.type==="application/octet-stream",v=/constructor/i.test(n.HTMLElement)||n.safari,S=/CriOS\/[\d]+/.test(navigator.userAgent);if((S||u&&v||d)&&typeof FileReader!="undefined"){var b=new FileReader;b.onloadend=function(){var A=b.result;A=S?A:A.replace(/^data:[^;]*;/,"data:attachment/file;"),m?m.location.href=A:location=A,m=null},b.readAsDataURL(r)}else{var T=n.URL||n.webkitURL,I=T.createObjectURL(r);m?m.location=I:location.href=I,m=null,setTimeout(function(){T.revokeObjectURL(I)},4e4)}});n.saveAs=h.saveAs=h,t.exports=h})})(Z);var ee=Z.exports;const O={IMPORTING:1,IMPORTED:2},Ie=t=>{const{t:e}=E.useTranslation(w),{importModalVisible:s,importStatus:o,importResult:x,setImportModalVisible:a}=Q(),{data:n,meta:d}=x!=null?x:{},h=()=>{a(!1)},r=()=>{const i=new Int8Array(n==null?void 0:n.data),g=new Blob([i],{type:"application/x-xls"});ee.saveAs(g,"fail.xlsx")};return c.jsx(F.Modal,{title:e("Import Data"),width:"50%",styles:{body:{height:"calc(80vh - 200px)"}},open:s,footer:null,closable:o===O.IMPORTED,onCancel:h,children:c.jsxs("div",{className:p.css`
28
+ `}}}}}},beforeUploadHandler(){return!1},uploadValidator(n,x){var r;if(n.length>1)return{type:"error",message:t("Only one file is allowed to be uploaded")};const s=(r=n[0])!=null?r:{};return s.size>10*1024*1024?{type:"error",message:t("File size cannot exceed 10M")}:ge.includes(s.type)?"":{type:"error",message:t("Please upload the file of Excel")}},validateUpload(n,x,s){var m;const[r]=s;x.disabled=(r==null?void 0:r.length)===0,x.componentProps=me(j({},x.componentProps),{disabled:(r==null?void 0:r.length)===0||((m=n.errors)==null?void 0:m.length)>0})}}},W=()=>{var m,h,o,a,f,d;const t=T.useField(),e=T.useFieldSchema(),{t:l}=F.useTranslation(),{dn:n}=c.useDesignable(),[x,s]=y.useState(),{importSettingsSchema:r}=$();return y.useEffect(()=>{s(r)},[t.address,(m=e==null?void 0:e["x-action-settings"])==null?void 0:m.importSettings]),i.jsxs(c.GeneralSchemaDesigner,{disableInitializer:!0,children:[i.jsx(c.SchemaSettingsModalItem,{title:l("Edit button"),schema:{type:"object",title:l("Edit button"),properties:{title:{"x-decorator":"FormItem","x-component":"Input",title:l("Button title"),default:e.title,"x-component-props":{}},icon:{"x-decorator":"FormItem","x-component":"IconPicker",title:l("Button icon"),default:(h=e==null?void 0:e["x-component-props"])==null?void 0:h.icon,"x-component-props":{}},type:{"x-decorator":"FormItem","x-component":"Radio.Group",title:l("Button background color"),default:(o=e==null?void 0:e["x-component-props"])!=null&&o.danger?"danger":((a=e==null?void 0:e["x-component-props"])==null?void 0:a.type)==="primary"?"primary":"default",enum:[{value:"default",label:'{{t("Default")}}'},{value:"primary",label:'{{t("Highlight")}}'},{value:"danger",label:'{{t("Danger red")}}'}]}}},onSubmit:({title:u,icon:v,type:I})=>{e.title=u,t.title=u,t.componentProps.icon=v,t.componentProps.danger=I==="danger",t.componentProps.type=I,e["x-component-props"]=e["x-component-props"]||{},e["x-component-props"].icon=v,e["x-component-props"].danger=I==="danger",e["x-component-props"].type=I,n.emit("patch",{schema:{"x-uid":e["x-uid"],title:u,"x-component-props":j({},e["x-component-props"])}}),n.refresh()}}),i.jsx(c.SchemaSettingsActionModalItem,{title:l("Importable fields"),schema:x,initialValues:j({},(d=(f=e==null?void 0:e["x-action-settings"])==null?void 0:f.importSettings)!=null?d:{}),components:{ArrayItems:N.ArrayItems},onSubmit:({importColumns:u,explain:v})=>{const I=u==null?void 0:u.filter(b=>{var E;return(E=b==null?void 0:b.dataIndex)==null?void 0:E.length}).map(b=>({dataIndex:b.dataIndex.map(E=>{var S;return(S=E.name)!=null?S:E}),title:b.title}));e["x-action-settings"].importSettings={importColumns:I,explain:v},n.emit("patch",{schema:{"x-uid":e["x-uid"],"x-action-settings":e["x-action-settings"]}}),n.refresh()}}),i.jsx(c.SchemaSettingsDivider,{}),i.jsx(c.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:u=>u["x-component"]==="Space"||u["x-component"].endsWith("ActionBar"),confirm:{title:l("Delete action")}})]})},z=y.createContext(null);z.displayName="ImportContext";const J=()=>y.useContext(z);var k=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},K={exports:{}};(function(t,e){(function(l,n){n()})(k,function(){function l(o,a){return typeof a=="undefined"?a={autoBom:!1}:typeof a!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(o.type)?new Blob(["\uFEFF",o],{type:o.type}):o}function n(o,a,f){var d=new XMLHttpRequest;d.open("GET",o),d.responseType="blob",d.onload=function(){h(d.response,a,f)},d.onerror=function(){console.error("could not download file")},d.send()}function x(o){var a=new XMLHttpRequest;a.open("HEAD",o,!1);try{a.send()}catch(f){}return 200<=a.status&&299>=a.status}function s(o){try{o.dispatchEvent(new MouseEvent("click"))}catch(f){var a=document.createEvent("MouseEvents");a.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),o.dispatchEvent(a)}}var r=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof k=="object"&&k.global===k?k:void 0,m=r.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),h=r.saveAs||(typeof window!="object"||window!==r?function(){}:"download"in HTMLAnchorElement.prototype&&!m?function(o,a,f){var d=r.URL||r.webkitURL,u=document.createElement("a");a=a||o.name||"download",u.download=a,u.rel="noopener",typeof o=="string"?(u.href=o,u.origin===location.origin?s(u):x(u.href)?n(o,a,f):s(u,u.target="_blank")):(u.href=d.createObjectURL(o),setTimeout(function(){d.revokeObjectURL(u.href)},4e4),setTimeout(function(){s(u)},0))}:"msSaveOrOpenBlob"in navigator?function(o,a,f){if(a=a||o.name||"download",typeof o!="string")navigator.msSaveOrOpenBlob(l(o,f),a);else if(x(o))n(o,a,f);else{var d=document.createElement("a");d.href=o,d.target="_blank",setTimeout(function(){s(d)})}}:function(o,a,f,d){if(d=d||open("","_blank"),d&&(d.document.title=d.document.body.innerText="downloading..."),typeof o=="string")return n(o,a,f);var u=o.type==="application/octet-stream",v=/constructor/i.test(r.HTMLElement)||r.safari,I=/CriOS\/[\d]+/.test(navigator.userAgent);if((I||u&&v||m)&&typeof FileReader!="undefined"){var b=new FileReader;b.onloadend=function(){var A=b.result;A=I?A:A.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=A:location=A,d=null},b.readAsDataURL(o)}else{var E=r.URL||r.webkitURL,S=E.createObjectURL(o);d?d.location=S:location.href=S,d=null,setTimeout(function(){E.revokeObjectURL(S)},4e4)}});r.saveAs=h.saveAs=h,t.exports=h})})(K);var Y=K.exports;const B={IMPORTING:1,IMPORTED:2},ye=t=>{const{t:e}=F.useTranslation(w),{importModalVisible:l,importStatus:n,importResult:x,setImportModalVisible:s}=J(),{data:r,meta:m}=x!=null?x:{},h=()=>{s(!1)},o=()=>{const a=new Int8Array(r==null?void 0:r.data),f=new Blob([a],{type:"application/x-xls"});Y.saveAs(f,"fail.xlsx")};return i.jsx(M.Modal,{title:e("Import Data"),width:"50%",styles:{body:{height:"calc(80vh - 200px)"}},open:l,footer:null,closable:n===B.IMPORTED,onCancel:h,children:i.jsxs("div",{className:c.css`
29
29
  display: flex;
30
30
  justify-content: center;
31
31
  align-items: center;
32
32
  height: 100%;
33
- `,children:[o===O.IMPORTING&&c.jsx(F.Spin,{indicator:c.jsx(V.LoadingOutlined,{style:{fontSize:24},spin:!0}),tip:e("Excel data importing")}),o===O.IMPORTED&&c.jsxs(F.Space,{direction:"vertical",align:"center",children:[c.jsx(V.ExclamationCircleFilled,{style:{fontSize:72,color:"#1890ff"}}),c.jsx("p",{children:e("Import done, total success have {{successCount}} , total failure have {{failureCount}}",D({},d!=null?d:{}))}),c.jsxs(F.Space,{children:[(d==null?void 0:d.failureCount)>0&&c.jsx(F.Button,{onClick:r,children:e("To download the failure data")}),c.jsx(F.Button,{type:"primary",onClick:h,children:e("Done")})]})]})]})})},te=t=>{let e=t;for(;e&&e["x-action"]!=="importXlsx";)e=e.parent;return{schema:e}},oe=t=>!t||!Array.isArray(t)?[]:t,ne=()=>{const{service:t,resource:e}=p.useBlockRequestContext();p.useAPIClient();const s=f.useFieldSchema(),o=p.useCompile(),{getCollectionJoinField:x,getCollectionField:a}=p.useCollectionManager_deprecated(),{name:n,title:d,getField:h}=p.useCollection_deprecated();E.useTranslation(w);const{schema:r}=te(s);return{run(){return _(this,null,function*(){var b,T;const{importColumns:g,explain:m}=H.cloneDeep((T=(b=r==null?void 0:r["x-action-settings"])==null?void 0:b.importSettings)!=null?T:{}),u=oe(g).map(I=>{var N,M;const A=a(`${n}.${I.dataIndex[0]}`);if(A){if(I.defaultTitle=o((N=A==null?void 0:A.uiSchema)==null?void 0:N.title)||A.name,I.dataIndex.length>1){const P=x(`${n}.${I.dataIndex.join(".")}`);if(!P)return;I.defaultTitle=I.defaultTitle+"/"+o((M=P==null?void 0:P.uiSchema)==null?void 0:M.title)||P.name}return A.interface==="chinaRegion"&&I.dataIndex.push("name"),I}}).filter(Boolean),{data:v}=yield e.downloadXlsxTemplate({values:{title:o(d),explain:m,columns:o(u)}},{method:"post",responseType:"blob"}),S=new Blob([v],{type:"application/x-xls"});ee.saveAs(S,`${o(d)}.xlsx`)})}}},re=()=>{const{service:t,resource:e}=p.useBlockRequestContext(),s=p.useAPIClient(),o=f.useFieldSchema(),x=p.useCompile(),{getCollectionJoinField:a,getCollectionField:n}=p.useCollectionManager_deprecated(),{name:d,title:h,getField:r}=p.useCollection_deprecated();E.useTranslation(w);const{schema:i}=te(o),g=f.useForm(),{setVisible:m,fieldSchema:u}=p.useActionContext(),{setImportModalVisible:v,setImportStatus:S,setImportResult:b}=Q();return{run(){return _(this,null,function*(){var ce,pe,le;const{importColumns:I,explain:A}=H.cloneDeep((pe=(ce=i==null?void 0:i["x-action-settings"])==null?void 0:ce.importSettings)!=null?pe:{}),N=oe(I).map(C=>{var de,me;const j=n(`${d}.${C.dataIndex[0]}`);if(j){if(C.defaultTitle=x((de=j==null?void 0:j.uiSchema)==null?void 0:de.title)||j.name,C.dataIndex.length>1){const L=a(`${d}.${C.dataIndex.join(".")}`);if(!L)return;C.defaultTitle=C.defaultTitle+"/"+x((me=L==null?void 0:L.uiSchema)==null?void 0:me.title)||L.name}return j.interface==="chinaRegion"&&C.dataIndex.push("name"),C}}).filter(Boolean),M=new FormData,P=g.values.upload.map(C=>C.originFileObj);M.append("file",P[0]),M.append("columns",JSON.stringify(N)),M.append("explain",A),m(!1),v(!0),S(O.IMPORTING);try{const{data:C}=yield s.axios.post(`${d}:importXlsx`,M,{timeout:6e5});b(C),g.reset(),yield(le=t==null?void 0:t.refresh)==null?void 0:le.call(t),S(O.IMPORTED)}catch(C){v(!1),m(!0)}})}}},ae=t=>{const{uploadValidator:e,beforeUploadHandler:s,validateUpload:o}=$();return c.jsx(p.SchemaComponentOptions,{components:{ImportActionInitializer:K,ImportDesigner:Y,ImportWarning:J},scope:{uploadValidator:e,validateUpload:o,beforeUploadHandler:s,useDownloadXlsxTemplateAction:ne,useImportStartAction:re},children:c.jsx(ie,{children:t.children})})},ie=t=>{const[e,s]=y.useState(!1),[o,x]=y.useState(O.IMPORTING),[a,n]=y.useState(null);return c.jsxs(z.Provider,{value:{importModalVisible:e,setImportModalVisible:s,importStatus:o,setImportStatus:x,importResult:a,setImportResult:n},children:[U.createPortal(c.jsx(Ie,{}),document.body),t.children]})},be=new p.SchemaSettings({name:"actionSettings:import",items:[{name:"editButton",Component:p.ButtonEditor,useComponentProps(){const{buttonEditorProps:t}=p.useSchemaToolbar();return t}},{name:"importableFields",type:"actionModal",useComponentProps(){var d,h,r;const t=f.useField(),e=f.useFieldSchema(),{t:s}=E.useTranslation(),{dn:o}=p.useDesignable(),[x,a]=y.useState(),{importSettingsSchema:n}=$();return y.useEffect(()=>{a(n)},[t.address,(d=e==null?void 0:e["x-action-settings"])==null?void 0:d.importSettings]),{title:s("Importable fields"),schema:x,initialValues:D({},(r=(h=e==null?void 0:e["x-action-settings"])==null?void 0:h.importSettings)!=null?r:{}),components:{ArrayItems:B.ArrayItems},onSubmit:({importColumns:i,explain:g})=>{const m=i==null?void 0:i.filter(u=>{var v;return(v=u==null?void 0:u.dataIndex)==null?void 0:v.length}).map(u=>({dataIndex:u.dataIndex.map(v=>{var S;return(S=v.name)!=null?S:v}),title:u.title}));e["x-action-settings"].importSettings={importColumns:m,explain:g},o.emit("patch",{schema:{"x-uid":e["x-uid"],"x-action-settings":e["x-action-settings"]}}),o.refresh()}}}},{name:"divider",type:"divider"},{name:"delete",type:"remove",useComponentProps(){const{t}=E.useTranslation();return{removeParentsIfNoChildren:!0,breakRemoveOn:e=>e["x-component"]==="Space"||e["x-component"].endsWith("ActionBar"),confirm:{title:t("Delete action")}}}}]});class se extends p.Plugin{load(){return _(this,null,function*(){this.app.use(ae);const e={title:"{{t('Import')}}",Component:"ImportActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action":"importXlsx","x-acl-action-props":{skipScopeCheck:!0}},useVisible(){const o=p.useCollection_deprecated();return(o.template!=="view"||(o==null?void 0:o.writableView))&&o.template!=="file"&&o.template!=="sql"}},s=this.app.schemaInitializerManager.get("table:configureActions");s==null||s.add("enableActions.import",e),this.app.schemaInitializerManager.addItem("gantt:configureActions","enableActions.import",e),this.app.schemaSettingsManager.add(be)})}}l.ImportActionInitializer=K,l.ImportContextProvider=ie,l.ImportDesigner=Y,l.ImportPluginProvider=ae,l.ImportWarning=J,l.PluginActionImportClient=se,l.default=se,l.useCurrentSchema=W,l.useDownloadXlsxTemplateAction=ne,l.useImportStartAction=re,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
33
+ `,children:[n===B.IMPORTING&&i.jsx(M.Spin,{indicator:i.jsx(R.LoadingOutlined,{style:{fontSize:24},spin:!0}),tip:e("Excel data importing")}),n===B.IMPORTED&&i.jsxs(M.Space,{direction:"vertical",align:"center",children:[i.jsx(R.ExclamationCircleFilled,{style:{fontSize:72,color:"#1890ff"}}),i.jsx("p",{children:e("Import done, total success have {{successCount}} , total failure have {{failureCount}}",j({},m!=null?m:{}))}),i.jsxs(M.Space,{children:[(m==null?void 0:m.failureCount)>0&&i.jsx(M.Button,{onClick:o,children:e("To download the failure data")}),i.jsx(M.Button,{type:"primary",onClick:h,children:e("Done")})]})]})]})})},Q=t=>{let e=t;for(;e&&e["x-action"]!=="importXlsx";)e=e.parent;return{schema:e}},Z=t=>!t||!Array.isArray(t)?[]:t,ee=()=>{const{service:t,resource:e}=c.useBlockRequestContext();c.useAPIClient();const l=T.useFieldSchema(),n=c.useCompile(),{getCollectionJoinField:x,getCollectionField:s}=c.useCollectionManager_deprecated(),{name:r,title:m,getField:h}=c.useCollection_deprecated();F.useTranslation(w);const{schema:o}=Q(l);return{run(){return q(this,null,function*(){var b,E;const{importColumns:f,explain:d}=V.cloneDeep((E=(b=o==null?void 0:o["x-action-settings"])==null?void 0:b.importSettings)!=null?E:{}),u=Z(f).map(S=>{var _,P;const A=s(`${r}.${S.dataIndex[0]}`);if(A){if(S.defaultTitle=n((_=A==null?void 0:A.uiSchema)==null?void 0:_.title)||A.name,S.dataIndex.length>1){const D=x(`${r}.${S.dataIndex.join(".")}`);if(!D)return;S.defaultTitle=S.defaultTitle+"/"+n((P=D==null?void 0:D.uiSchema)==null?void 0:P.title)||D.name}return A.interface==="chinaRegion"&&S.dataIndex.push("name"),S}}).filter(Boolean),{data:v}=yield e.downloadXlsxTemplate({values:{title:n(m),explain:d,columns:n(u)}},{method:"post",responseType:"blob"}),I=new Blob([v],{type:"application/x-xls"});Y.saveAs(I,`${n(m)}.xlsx`)})}}},te=()=>{const{service:t,resource:e}=c.useBlockRequestContext(),l=c.useAPIClient(),n=T.useFieldSchema(),x=c.useCompile(),{getCollectionJoinField:s,getCollectionField:r}=c.useCollectionManager_deprecated(),{name:m,title:h,getField:o}=c.useCollection_deprecated();F.useTranslation(w);const{schema:a}=Q(n),f=T.useForm(),{setVisible:d,fieldSchema:u}=c.useActionContext(),{setImportModalVisible:v,setImportStatus:I,setImportResult:b}=J();return{run(){return q(this,null,function*(){var ae,ie,se;const{importColumns:S,explain:A}=V.cloneDeep((ie=(ae=a==null?void 0:a["x-action-settings"])==null?void 0:ae.importSettings)!=null?ie:{}),_=Z(S).map(C=>{var ce,pe;const O=r(`${m}.${C.dataIndex[0]}`);if(O){if(C.defaultTitle=x((ce=O==null?void 0:O.uiSchema)==null?void 0:ce.title)||O.name,C.dataIndex.length>1){const L=s(`${m}.${C.dataIndex.join(".")}`);if(!L)return;C.defaultTitle=C.defaultTitle+"/"+x((pe=L==null?void 0:L.uiSchema)==null?void 0:pe.title)||L.name}return O.interface==="chinaRegion"&&C.dataIndex.push("name"),C}}).filter(Boolean),P=new FormData,D=f.values.upload.map(C=>C.originFileObj);P.append("file",D[0]),P.append("columns",JSON.stringify(_)),P.append("explain",A),d(!1),v(!0),I(B.IMPORTING);try{const{data:C}=yield l.axios.post(`${m}:importXlsx`,P,{timeout:6e5});b(C),f.reset(),yield(se=t==null?void 0:t.refresh)==null?void 0:se.call(t),I(B.IMPORTED)}catch(C){v(!1),d(!0)}})}}},oe=t=>{const{uploadValidator:e,beforeUploadHandler:l,validateUpload:n}=$();return i.jsx(c.SchemaComponentOptions,{components:{ImportActionInitializer:G,ImportDesigner:W,ImportWarning:X},scope:{uploadValidator:e,validateUpload:n,beforeUploadHandler:l,useDownloadXlsxTemplateAction:ee,useImportStartAction:te},children:i.jsx(ne,{children:t.children})})},ne=t=>{const[e,l]=y.useState(!1),[n,x]=y.useState(B.IMPORTING),[s,r]=y.useState(null);return i.jsxs(z.Provider,{value:{importModalVisible:e,setImportModalVisible:l,importStatus:n,setImportStatus:x,importResult:s,setImportResult:r},children:[U.createPortal(i.jsx(ye,{}),document.body),t.children]})},ve=new c.SchemaSettings({name:"actionSettings:import",items:[{name:"editButton",Component:c.ButtonEditor,useComponentProps(){const{buttonEditorProps:t}=c.useSchemaToolbar();return t}},{name:"importableFields",type:"actionModal",useComponentProps(){var m,h,o;const t=T.useField(),e=T.useFieldSchema(),{t:l}=F.useTranslation(),{dn:n}=c.useDesignable(),[x,s]=y.useState(),{importSettingsSchema:r}=$();return y.useEffect(()=>{s(r)},[t.address,(m=e==null?void 0:e["x-action-settings"])==null?void 0:m.importSettings]),{title:l("Importable fields"),schema:x,initialValues:j({},(o=(h=e==null?void 0:e["x-action-settings"])==null?void 0:h.importSettings)!=null?o:{}),components:{ArrayItems:N.ArrayItems},onSubmit:({importColumns:a,explain:f})=>{const d=a==null?void 0:a.filter(u=>{var v;return(v=u==null?void 0:u.dataIndex)==null?void 0:v.length}).map(u=>({dataIndex:u.dataIndex.map(v=>{var I;return(I=v.name)!=null?I:v}),title:u.title}));e["x-action-settings"].importSettings={importColumns:d,explain:f},n.emit("patch",{schema:{"x-uid":e["x-uid"],"x-action-settings":e["x-action-settings"]}}),n.refresh()}}}},{name:"divider",type:"divider"},{name:"delete",type:"remove",useComponentProps(){const{t}=F.useTranslation();return{removeParentsIfNoChildren:!0,breakRemoveOn:e=>e["x-component"]==="Space"||e["x-component"].endsWith("ActionBar"),confirm:{title:t("Delete action")}}}}]});class re extends c.Plugin{load(){return q(this,null,function*(){this.app.use(oe);const e={title:"{{t('Import')}}",Component:"ImportActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action":"importXlsx","x-acl-action-props":{skipScopeCheck:!0}},useVisible(){const n=c.useCollection_deprecated();return(n.template!=="view"||(n==null?void 0:n.writableView))&&n.template!=="file"&&n.template!=="sql"}},l=this.app.schemaInitializerManager.get("table:configureActions");l==null||l.add("enableActions.import",e),this.app.schemaInitializerManager.addItem("gantt:configureActions","enableActions.import",e),this.app.schemaSettingsManager.add(ve)})}}p.ImportActionInitializer=G,p.ImportContextProvider=ne,p.ImportDesigner=W,p.ImportPluginProvider=oe,p.ImportWarning=X,p.PluginActionImportClient=re,p.default=re,p.useDownloadXlsxTemplateAction=ee,p.useImportStartAction=te,Object.defineProperties(p,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -10,18 +10,18 @@
10
10
  module.exports = {
11
11
  "@formily/react": "2.3.0",
12
12
  "@formily/shared": "2.3.0",
13
- "@nocobase/client": "1.0.0-alpha.13",
14
- "react": "18.2.0",
13
+ "@nocobase/client": "1.0.0-alpha.15",
15
14
  "antd": "5.12.8",
15
+ "react": "18.2.0",
16
16
  "@formily/antd-v5": "1.1.9",
17
17
  "react-i18next": "11.18.6",
18
18
  "@ant-design/icons": "5.2.6",
19
19
  "react-dom": "18.2.0",
20
20
  "lodash": "4.17.21",
21
21
  "@formily/core": "2.3.0",
22
- "@nocobase/server": "1.0.0-alpha.13",
23
- "@nocobase/actions": "1.0.0-alpha.13",
24
- "@nocobase/database": "1.0.0-alpha.13",
25
- "@nocobase/utils": "1.0.0-alpha.13",
22
+ "@nocobase/server": "1.0.0-alpha.15",
23
+ "@nocobase/actions": "1.0.0-alpha.15",
24
+ "@nocobase/database": "1.0.0-alpha.15",
25
+ "@nocobase/utils": "1.0.0-alpha.15",
26
26
  "mathjs": "10.6.4"
27
27
  };
@@ -1 +1 @@
1
- {"name":"node-xlsx","author":"Olivier Louvignes <olivier@mg-crea.com>","version":"0.16.2","description":"NodeJS Excel files parser & builder","main":"lib/index.js","scripts":{"start":"yarn test:watch","test":"NODE_ENV=test jest --runInBand","test:watch":"yarn test -- --watch","test:coverage":"yarn test -- --coverage","lint":"NODE_ENV=test eslint src/ test/","build":"rimraf lib/*; NODE_ENV=production babel src/ -d lib/ -s","build:watch":"yarn build -- -w","prepublish":"yarn build"},"repository":"github:mgcrea/node-xlsx","license":"Apache-2.0","dependencies":{"@babel/runtime":"^7.14.6","buffer-from":"^1.1.1","xlsx":"^0.17.0"},"devDependencies":{"@babel/cli":"^7.14.5","@babel/core":"^7.14.6","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-runtime":"^7.14.5","@babel/preset-env":"^7.14.7","babel-eslint":"^10.1.0","codacy-coverage":"^3.4.0","debug-utils":"^0.5.3","eslint":"^7.30.0","eslint-config-airbnb-base":"^14.2.1","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.23.4","expect":"^27.0.6","jest":"^27.0.6","rimraf":"^3.0.2"},"engines":{"node":">=4.0.0"},"keywords":["excel","parser","builder","xlsx","xls"],"jest":{"testEnvironment":"node","setupFiles":["<rootDir>/test/setup.js"]},"_lastModified":"2024-05-14T09:27:26.322Z"}
1
+ {"name":"node-xlsx","author":"Olivier Louvignes <olivier@mg-crea.com>","version":"0.16.2","description":"NodeJS Excel files parser & builder","main":"lib/index.js","scripts":{"start":"yarn test:watch","test":"NODE_ENV=test jest --runInBand","test:watch":"yarn test -- --watch","test:coverage":"yarn test -- --coverage","lint":"NODE_ENV=test eslint src/ test/","build":"rimraf lib/*; NODE_ENV=production babel src/ -d lib/ -s","build:watch":"yarn build -- -w","prepublish":"yarn build"},"repository":"github:mgcrea/node-xlsx","license":"Apache-2.0","dependencies":{"@babel/runtime":"^7.14.6","buffer-from":"^1.1.1","xlsx":"^0.17.0"},"devDependencies":{"@babel/cli":"^7.14.5","@babel/core":"^7.14.6","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-runtime":"^7.14.5","@babel/preset-env":"^7.14.7","babel-eslint":"^10.1.0","codacy-coverage":"^3.4.0","debug-utils":"^0.5.3","eslint":"^7.30.0","eslint-config-airbnb-base":"^14.2.1","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.23.4","expect":"^27.0.6","jest":"^27.0.6","rimraf":"^3.0.2"},"engines":{"node":">=4.0.0"},"keywords":["excel","parser","builder","xlsx","xls"],"jest":{"testEnvironment":"node","setupFiles":["<rootDir>/test/setup.js"]},"_lastModified":"2024-05-21T03:00:01.905Z"}
@@ -1 +1 @@
1
- {"name":"xlsx","version":"0.17.5","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","unpkg":"dist/xlsx.full.min.js","jsdelivr":"dist/xlsx.full.min.js","types":"types/index.d.ts","browser":{"buffer":false,"crypto":false,"stream":false,"process":false,"fs":false},"dependencies":{"adler-32":"~1.2.0","cfb":"^1.1.4","codepage":"~1.15.0","crc-32":"~1.2.0","ssf":"~0.11.2","wmf":"~1.0.1","word":"~0.3.0"},"devDependencies":{"@sheetjs/uglify-js":"~2.7.3","@types/node":"^8.5.9","acorn":"7.4.1","alex":"^9.1.0","blanket":"~1.2.3","commander":"~2.17.1","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","typescript":"2.2.0"},"repository":{"type":"git","url":"git://github.com/SheetJS/sheetjs.git"},"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/","bugs":{"url":"https://github.com/SheetJS/sheetjs/issues"},"license":"Apache-2.0","engines":{"node":">=0.8"},"_lastModified":"2024-05-14T09:27:28.855Z"}
1
+ {"name":"xlsx","version":"0.17.5","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","unpkg":"dist/xlsx.full.min.js","jsdelivr":"dist/xlsx.full.min.js","types":"types/index.d.ts","browser":{"buffer":false,"crypto":false,"stream":false,"process":false,"fs":false},"dependencies":{"adler-32":"~1.2.0","cfb":"^1.1.4","codepage":"~1.15.0","crc-32":"~1.2.0","ssf":"~0.11.2","wmf":"~1.0.1","word":"~0.3.0"},"devDependencies":{"@sheetjs/uglify-js":"~2.7.3","@types/node":"^8.5.9","acorn":"7.4.1","alex":"^9.1.0","blanket":"~1.2.3","commander":"~2.17.1","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","typescript":"2.2.0"},"repository":{"type":"git","url":"git://github.com/SheetJS/sheetjs.git"},"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/","bugs":{"url":"https://github.com/SheetJS/sheetjs/issues"},"license":"Apache-2.0","engines":{"node":">=0.8"},"_lastModified":"2024-05-21T03:00:04.298Z"}
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.0.0-alpha.13",
7
+ "version": "1.0.0-alpha.15",
8
8
  "license": "AGPL-3.0",
9
9
  "main": "./dist/server/index.js",
10
10
  "homepage": "https://docs.nocobase.com/handbook/action-import",
@@ -34,7 +34,7 @@
34
34
  "@nocobase/test": "1.x",
35
35
  "@nocobase/utils": "1.x"
36
36
  },
37
- "gitHead": "bd97adef70762a6691b5b58ca6572672a8cdf838",
37
+ "gitHead": "2793d371368e094ea2bba04cfbe9b9b73c44edba",
38
38
  "keywords": [
39
39
  "Actions"
40
40
  ]