@tachybase/plugin-action-import 1.3.21 → 1.3.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/dist/client/index.js +6 -6
- package/dist/externalVersion.js +6 -8
- package/dist/node_modules/mathjs/package.json +1 -1
- package/dist/node_modules/node-xlsx/node_modules/.bin/xlsx +2 -2
- package/dist/node_modules/node-xlsx/package.json +1 -1
- package/dist/node_modules/xlsx/node_modules/.bin/crc32 +2 -2
- package/dist/node_modules/xlsx/package.json +1 -1
- package/dist/server/actions/downloadXlsxTemplate.d.ts +1 -1
- package/dist/server/actions/importXlsx.d.ts +1 -1
- package/dist/server/actions/importXlsx.js +2 -2
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/middleware/index.d.ts +1 -1
- package/dist/server/middleware/index.js +2 -2
- package/dist/server/utils/transform.js +4 -3
- package/package.json +13 -20
package/README.md
CHANGED
|
@@ -185,7 +185,7 @@ Excel 数据导入插件。
|
|
|
185
185
|
通过 `db.registerFieldValueParsers()` 方法注册自定义的 `ValueParser`,如:
|
|
186
186
|
|
|
187
187
|
```ts
|
|
188
|
-
import { BaseValueParser } from '@
|
|
188
|
+
import { BaseValueParser } from '@tego/server';
|
|
189
189
|
|
|
190
190
|
class PointValueParser extends BaseValueParser {
|
|
191
191
|
async setValue(value) {
|
package/README.zh-CN.md
CHANGED
|
@@ -185,7 +185,7 @@ Excel 数据导入插件。
|
|
|
185
185
|
通过 `db.registerFieldValueParsers()` 方法注册自定义的 `ValueParser`,如:
|
|
186
186
|
|
|
187
187
|
```ts
|
|
188
|
-
import { BaseValueParser } from '@
|
|
188
|
+
import { BaseValueParser } from '@tego/server';
|
|
189
189
|
|
|
190
190
|
class PointValueParser extends BaseValueParser {
|
|
191
191
|
async setValue(value) {
|
package/dist/client/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(d,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("@tachybase/client"),require("react/jsx-runtime"),require("react"),require("react-dom"),require("@ant-design/icons"),require("antd"),require("react-i18next"),require("@tachybase/schema"),require("lodash"),require("@tego/client")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","react/jsx-runtime","react","react-dom","@ant-design/icons","antd","react-i18next","@tachybase/schema","lodash","@tego/client"],o):(d=typeof globalThis!="undefined"?globalThis:d||self,o(d["@tachybase/plugin-action-import"]={},d["@tachybase/client"],d.jsxRuntime,d.react,d["react-dom"],d["@ant-design/icons"],d.antd,d["react-i18next"],d["@tachybase/schema"],d.lodash,d["@tego/client"]))})(this,function(d,o,m,w,L,_,T,C,g,O,X){"use strict";var be=Object.defineProperty,Ae=Object.defineProperties;var we=Object.getOwnPropertyDescriptors;var me=Object.getOwnPropertySymbols;var Ce=Object.prototype.hasOwnProperty,Te=Object.prototype.propertyIsEnumerable;var ue=(d,o,m)=>o in d?be(d,o,{enumerable:!0,configurable:!0,writable:!0,value:m}):d[o]=m,B=(d,o)=>{for(var m in o||(o={}))Ce.call(o,m)&&ue(d,m,o[m]);if(me)for(var m of me(o))Te.call(o,m)&&ue(d,m,o[m]);return d},H=(d,o)=>Ae(d,we(o));var R=(d,o,m)=>new Promise((w,L)=>{var _=g=>{try{C(m.next(g))}catch(O){L(O)}},T=g=>{try{C(m.throw(g))}catch(O){L(O)}},C=g=>g.done?w(g.value):Promise.resolve(g.value).then(_,T);C((m=m.apply(d,o)).next())});const V=w.createContext(null);V.displayName="ImportContext";const G=()=>w.useContext(V);var k=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},q={exports:{}},xe=q.exports,J;function he(){return J||(J=1,function(t,e){(function(c,n){n()})(xe,function(){function c(s,p){return typeof p=="undefined"?p={autoBom:!1}:typeof p!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),p={autoBom:!p}),p.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(s.type)?new Blob(["\uFEFF",s],{type:s.type}):s}function n(s,p,f){var a=new XMLHttpRequest;a.open("GET",s),a.responseType="blob",a.onload=function(){h(a.response,p,f)},a.onerror=function(){console.error("could not download file")},a.send()}function u(s){var p=new XMLHttpRequest;p.open("HEAD",s,!1);try{p.send()}catch(f){}return 200<=p.status&&299>=p.status}function i(s){try{s.dispatchEvent(new MouseEvent("click"))}catch(f){var p=document.createEvent("MouseEvents");p.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),s.dispatchEvent(p)}}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,l=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&&!l?function(s,p,f){var a=r.URL||r.webkitURL,x=document.createElement("a");p=p||s.name||"download",x.download=p,x.rel="noopener",typeof s=="string"?(x.href=s,x.origin===location.origin?i(x):u(x.href)?n(s,p,f):i(x,x.target="_blank")):(x.href=a.createObjectURL(s),setTimeout(function(){a.revokeObjectURL(x.href)},4e4),setTimeout(function(){i(x)},0))}:"msSaveOrOpenBlob"in navigator?function(s,p,f){if(p=p||s.name||"download",typeof s!="string")navigator.msSaveOrOpenBlob(c(s,f),p);else if(u(s))n(s,p,f);else{var a=document.createElement("a");a.href=s,a.target="_blank",setTimeout(function(){i(a)})}}:function(s,p,f,a){if(a=a||open("","_blank"),a&&(a.document.title=a.document.body.innerText="downloading..."),typeof s=="string")return n(s,p,f);var x=s.type==="application/octet-stream",v=/constructor/i.test(r.HTMLElement)||r.safari,S=/CriOS\/[\d]+/.test(navigator.userAgent);if((S||x&&v||l)&&typeof FileReader!="undefined"){var b=new FileReader;b.onloadend=function(){var y=b.result;y=S?y:y.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=y:location=y,a=null},b.readAsDataURL(s)}else{var F=r.URL||r.webkitURL,E=F.createObjectURL(s);a?a.location=E:location.href=E,a=null,setTimeout(function(){F.revokeObjectURL(E)},4e4)}});r.saveAs=h.saveAs=h,t.exports=h})}(q)),q.exports}var W=he();const I="action-import",$={IMPORTING:1,IMPORTED:2},fe=t=>{const{t:e}=C.useTranslation(I),{importModalVisible:c,importStatus:n,importResult:u,setImportModalVisible:i}=G(),{data:r,meta:l}=u!=null?u:{},h=()=>{i(!1)},s=()=>{const p=new Int8Array(r==null?void 0:r.data),f=new Blob([p],{type:"application/x-xls"});W.saveAs(f,"fail.xlsx")};return m.jsx(T.Modal,{title:e("Import Data"),width:"50%",styles:{body:{height:"calc(80vh - 200px)"}},open:c,footer:null,closable:n===$.IMPORTED,onCancel:h,children:m.jsxs("div",{className:o.css`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: center;
|
|
4
4
|
align-items: center;
|
|
5
5
|
height: 100%;
|
|
6
|
-
`,children:[n===$.IMPORTING&&
|
|
6
|
+
`,children:[n===$.IMPORTING&&m.jsx(T.Spin,{indicator:m.jsx(_.LoadingOutlined,{style:{fontSize:24},spin:!0}),tip:e("Excel data importing")}),n===$.IMPORTED&&m.jsxs(T.Space,{direction:"vertical",align:"center",children:[m.jsx(_.ExclamationCircleFilled,{style:{fontSize:72,color:"#1890ff"}}),m.jsx("p",{children:e("Import done, total success have {{successCount}} , total failure have {{failureCount}}",B({},l!=null?l:{}))}),m.jsxs(T.Space,{children:[(l==null?void 0:l.failureCount)>0&&m.jsx(T.Button,{onClick:s,children:e("To download the failure data")}),m.jsx(T.Button,{type:"primary",onClick:h,children:e("Done")})]})]})]})})},K=t=>{let e=t;for(;e&&e["x-action"]!=="importXlsx";)e=e.parent;return{schema:e}},Y=t=>!t||!Array.isArray(t)?[]:t,Q=()=>{const{service:t,resource:e}=o.useBlockRequestContext();o.useAPIClient();const c=g.useFieldSchema(),n=o.useCompile(),{getCollectionJoinField:u,getCollectionField:i}=o.useCollectionManager_deprecated(),{name:r,title:l,getField:h}=o.useCollection_deprecated(),{t:s}=C.useTranslation(I),{schema:p}=K(c);return{run(){return R(this,null,function*(){var F,E;const{importColumns:a,explain:x}=O.cloneDeep((E=(F=p==null?void 0:p["x-action-settings"])==null?void 0:F.importSettings)!=null?E:{}),v=Y(a).map(y=>{var D,N;const M=i(`${r}.${y.dataIndex[0]}`);if(M){if(y.defaultTitle=n((D=M==null?void 0:M.uiSchema)==null?void 0:D.title)||M.name,y.dataIndex.length>1){const P=u(`${r}.${y.dataIndex.join(".")}`);if(!P)return;y.defaultTitle=y.defaultTitle+"/"+n((N=P==null?void 0:P.uiSchema)==null?void 0:N.title)||P.name}return M.interface==="chinaRegion"&&y.dataIndex.push("name"),y}}).filter(Boolean),{data:S}=yield e.downloadXlsxTemplate({values:{title:n(l),explain:x,columns:n(v)}},{method:"post",responseType:"blob"}),b=new Blob([S],{type:"application/x-xls"});W.saveAs(b,`${n(l)}.xlsx`)})}}},Z=()=>{const{service:t,resource:e}=o.useBlockRequestContext(),c=o.useAPIClient(),n=g.useFieldSchema(),u=o.useCompile(),{getCollectionJoinField:i,getCollectionField:r}=o.useCollectionManager_deprecated(),{name:l,title:h,getField:s}=o.useCollection_deprecated(),{t:p}=C.useTranslation(I),{schema:f}=K(n),a=g.useForm(),{setVisible:x}=o.useActionContext(),{setImportModalVisible:v,setImportStatus:S,setImportResult:b}=G();return{run(){return R(this,null,function*(){var P,ce,pe;const{importColumns:E,explain:y}=O.cloneDeep((ce=(P=f==null?void 0:f["x-action-settings"])==null?void 0:P.importSettings)!=null?ce:{}),M=Y(E).map(A=>{var le,de;const j=r(`${l}.${A.dataIndex[0]}`);if(j){if(A.defaultTitle=u((le=j==null?void 0:j.uiSchema)==null?void 0:le.title)||j.name,A.dataIndex.length>1){const U=i(`${l}.${A.dataIndex.join(".")}`);if(!U)return;A.defaultTitle=A.defaultTitle+"/"+u((de=U==null?void 0:U.uiSchema)==null?void 0:de.title)||U.name}return j.interface==="chinaRegion"&&A.dataIndex.push("name"),A}}).filter(Boolean),D=new FormData,N=a.values.upload.map(A=>A.originFileObj);D.append("file",N[0]),D.append("columns",JSON.stringify(M)),D.append("explain",y),x(!1),v(!0),S($.IMPORTING);try{const{data:A}=yield c.axios.post(`${l}:importXlsx`,D,{timeout:6e5});b(A),a.reset(),yield(pe=t==null?void 0:t.refresh)==null?void 0:pe.call(t),S($.IMPORTED)}catch(A){v(!1),x(!0)}})}}},ge=["id","createdAt","createdBy","updatedAt","updatedBy"],ee=t=>{const{getCollectionFields:e}=o.useCollectionManager_deprecated(),c=e(t),n=(i,r)=>{var h;if(!i.interface||ge.includes(i.interface))return;const l={name:i.name,title:((h=i==null?void 0:i.uiSchema)==null?void 0:h.title)||i.name,schema:i==null?void 0:i.uiSchema};if(!i.target||r>=2)return l;if(i.target){const s=e(i.target),p=u(s,r+1).filter(Boolean);l.children=l.children||[],l.children.push(...p)}return l},u=(i,r)=>{const l=[];return i.forEach(h=>{const s=n(h,r);s&&l.push(s)}),l};return u(c,1)},ve=["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel"],z=()=>{const{t}=C.useTranslation(I),{name:e}=o.useCollection_deprecated(),c=ee(e);return{importSettingsSchema:{type:"void","x-component":"Grid",properties:{explain:{type:"string",title:`{{ t("Import explain", {ns: "${I}"}) }}`,"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:o.css`
|
|
7
7
|
width: 100%;
|
|
8
8
|
& .ant-space-item:nth-child(2) {
|
|
9
9
|
flex: 1;
|
|
10
10
|
}
|
|
11
|
-
`},properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},dataIndex:{type:"array","x-decorator":"FormItem","x-component":o.Cascader,required:!0,enum:c,"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: "${
|
|
11
|
+
`},properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},dataIndex:{type:"array","x-decorator":"FormItem","x-component":o.Cascader,required:!0,enum:c,"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: "${I}"}) }}`,"x-component":"ArrayItems.Addition","x-component-props":{className:o.css`
|
|
12
12
|
border-color: var(--colorSettings);
|
|
13
13
|
color: var(--colorSettings);
|
|
14
14
|
&.ant-btn-dashed:hover {
|
|
15
15
|
border-color: var(--colorSettings);
|
|
16
16
|
color: var(--colorSettings);
|
|
17
17
|
}
|
|
18
|
-
`}}}}}},beforeUploadHandler(){return!1},uploadValidator(n,
|
|
18
|
+
`}}}}}},beforeUploadHandler(){return!1},uploadValidator(n,u){var r;if(n.length>1)return{type:"error",message:t("Only one file is allowed to be uploaded")};const i=(r=n[0])!=null?r:{};return i.size>10*1024*1024?{type:"error",message:t("File size cannot exceed 10M")}:ve.includes(i.type)?"":{type:"error",message:t("Please upload the file of Excel")}},validateUpload(n,u,i){var l;const[r]=i;u.disabled=(r==null?void 0:r.length)===0,u.componentProps=H(B({},u.componentProps),{disabled:(r==null?void 0:r.length)===0||((l=n.errors)==null?void 0:l.length)>0})}}},te=t=>{const{uploadValidator:e,beforeUploadHandler:c,validateUpload:n}=z();return m.jsx(o.SchemaComponentOptions,{components:{ImportActionInitializer:ae,ImportDesigner:se},scope:{uploadValidator:e,validateUpload:n,beforeUploadHandler:c,useDownloadXlsxTemplateAction:Q,useImportStartAction:Z},children:m.jsx(oe,{children:t.children})})},oe=t=>{const[e,c]=w.useState(!1),[n,u]=w.useState($.IMPORTING),[i,r]=w.useState(null);return m.jsxs(V.Provider,{value:{importModalVisible:e,setImportModalVisible:c,importStatus:n,setImportStatus:u,importResult:i,setImportResult:r},children:[L.createPortal(m.jsx(fe,{}),document.body),t.children]})},ye=new o.SchemaSettings({name:"actionSettings:import",items:[{name:"editButton",Component:o.ButtonEditor,useComponentProps(){const{buttonEditorProps:t}=o.useSchemaToolbar();return t}},{name:"importableFields",type:"actionModal",useComponentProps(){var l,h;const t=g.useField(),e=g.useFieldSchema(),{t:c}=C.useTranslation(),{dn:n}=o.useDesignable(),[u,i]=w.useState(),{importSettingsSchema:r}=z();return w.useEffect(()=>{i(r)},[t.address,(l=e==null?void 0:e["x-action-settings"])==null?void 0:l.importSettings]),{title:c("Importable fields"),schema:u,initialValues:B({},(h=e==null?void 0:e["x-action-settings"])==null?void 0:h.importSettings),components:{ArrayItems:X.ArrayItems},onSubmit:({importColumns:s,explain:p})=>{const f=s==null?void 0:s.filter(a=>{var x;return(x=a==null?void 0:a.dataIndex)==null?void 0:x.length}).map(a=>({dataIndex:a.dataIndex.map(x=>{var v;return(v=x.name)!=null?v:x}),title:a.title}));e["x-action-settings"].importSettings={importColumns:f,explain:p},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}=C.useTranslation();return{removeParentsIfNoChildren:!0,breakRemoveOn:e=>e["x-component"]==="Space"||e["x-component"].endsWith("ActionBar"),confirm:{title:t("Delete action")}}}}]}),ne=(t,e,c)=>t.reduceProperties((n,u)=>{if(u[e]===c)return u;const i=ne(u,e,c);return i||n}),Se=(t,e)=>e(t),re=(t,e,c=ne,n=Se)=>{const u=g.useFieldSchema(),{remove:i}=o.useDesignable(),r=c(u,e,t);return{schema:r,exists:!!r,remove(){r&&n(r,i)}}},Ie=t=>({importColumns:t==null?void 0:t.filter(c=>!c.children).map(c=>({dataIndex:[c.name]})),explain:""}),ae=()=>{const t=o.useSchemaInitializerItem(),{insert:e}=o.useSchemaInitializer(),{exists:c,remove:n}=re("importXlsx","x-action",t.find,t.remove),{name:u}=o.useCollection_deprecated(),i=ee(u),r={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: "${I}" }) }}`,"x-component":"Action.Container","x-decorator":"Form","x-component-props":{width:"50%",className:o.css`
|
|
19
19
|
.ant-formily-item-label {
|
|
20
20
|
height: var(--controlHeightLG);
|
|
21
21
|
}
|
|
22
|
-
`},properties:{formLayout:{type:"void","x-component":"FormLayout",properties:{download:{type:"void",title:`{{ t("Step 1: Download template", {ns: "${
|
|
22
|
+
`},properties:{formLayout:{type:"void","x-component":"FormLayout",properties:{download:{type:"void",title:`{{ t("Step 1: Download template", {ns: "${I}" }) }}`,"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: "${I}" }) }}`}},downloadAction:{type:"void",title:`{{ t("Download template", {ns: "${I}" }) }}`,"x-component":"Action","x-component-props":{className:o.css`
|
|
23
23
|
margin-top: 5px;
|
|
24
|
-
`,useAction:"{{ useDownloadXlsxTemplateAction }}"}}}},upload:{type:"array",title:`{{ t("Step 2: Upload Excel", {ns: "${
|
|
24
|
+
`,useAction:"{{ useDownloadXlsxTemplateAction }}"}}}},upload:{type:"array",title:`{{ t("Step 2: Upload Excel", {ns: "${I}" }) }}`,"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: "${I}" }) }}`,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: "${I}" }) }}`,"x-component":"Action","x-component-props":{type:"primary",htmlType:"submit",useAction:"{{ useImportStartAction }}"},"x-reactions":{dependencies:["upload"],fulfill:{run:"validateUpload($form, $self, $deps)"}}}}}}}}}}};return m.jsx(o.SchemaInitializerSwitch,H(B({},t),{checked:c,title:t.title,onClick:()=>{var h;if(c)return n();r["x-action-settings"].importSettings=Ie(i);const l=g.merge(r||{},t.schema||{});(h=t==null?void 0:t.schemaInitialize)==null||h.call(t,l),e(l)}}))},se=()=>{var l,h,s,p,f;const t=g.useField(),e=g.useFieldSchema(),{t:c}=C.useTranslation(),{dn:n}=o.useDesignable(),[u,i]=w.useState(),{importSettingsSchema:r}=z();return w.useEffect(()=>{i(r)},[t.address,(l=e==null?void 0:e["x-action-settings"])==null?void 0:l.importSettings]),m.jsxs(o.GeneralSchemaDesigner,{disableInitializer:!0,children:[m.jsx(o.SchemaSettingsModalItem,{title:c("Edit button"),schema:{type:"object",title:c("Edit button"),properties:{title:{"x-decorator":"FormItem","x-component":"Input",title:c("Button title"),default:e.title,"x-component-props":{}},icon:{"x-decorator":"FormItem","x-component":"IconPicker",title:c("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:c("Button background color"),default:(s=e==null?void 0:e["x-component-props"])!=null&&s.danger?"danger":((p=e==null?void 0:e["x-component-props"])==null?void 0:p.type)==="primary"?"primary":"default",enum:[{value:"default",label:'{{t("Default")}}'},{value:"primary",label:'{{t("Highlight")}}'},{value:"danger",label:'{{t("Danger red")}}'}]}}},onSubmit:({title:a,icon:x,type:v})=>{e.title=a,t.title=a,t.componentProps.icon=x,t.componentProps.danger=v==="danger",t.componentProps.type=v,e["x-component-props"]=e["x-component-props"]||{},e["x-component-props"].icon=x,e["x-component-props"].danger=v==="danger",e["x-component-props"].type=v,n.emit("patch",{schema:{"x-uid":e["x-uid"],title:a,"x-component-props":B({},e["x-component-props"])}}),n.refresh()}}),m.jsx(o.SchemaSettingsActionModalItem,{title:c("Importable fields"),schema:u,initialValues:B({},(f=e==null?void 0:e["x-action-settings"])==null?void 0:f.importSettings),components:{ArrayItems:X.ArrayItems},onSubmit:({importColumns:a,explain:x})=>{const v=a==null?void 0:a.filter(S=>{var b;return(b=S==null?void 0:S.dataIndex)==null?void 0:b.length}).map(S=>({dataIndex:S.dataIndex.map(b=>{var F;return(F=b.name)!=null?F:b}),title:S.title}));e["x-action-settings"].importSettings={importColumns:v,explain:x},n.emit("patch",{schema:{"x-uid":e["x-uid"],"x-action-settings":e["x-action-settings"]}}),n.refresh()}}),m.jsx(o.SchemaSettingsDivider,{}),m.jsx(o.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:a=>a["x-component"]==="Space"||a["x-component"].endsWith("ActionBar"),confirm:{title:c("Delete action")}})]})};class ie extends o.Plugin{load(){return R(this,null,function*(){this.app.use(te);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=o.useCollection_deprecated();return(n.template!=="view"||(n==null?void 0:n.writableView))&&n.template!=="file"&&n.template!=="sql"}},c=this.app.schemaInitializerManager.get("table:configureActions");c==null||c.add("enableActions.import",e),this.app.schemaInitializerManager.addItem("gantt:configureActions","enableActions.import",e),this.app.schemaSettingsManager.add(ye)})}}d.ImportActionInitializer=ae,d.ImportContextProvider=oe,d.ImportDesigner=se,d.ImportPlugin=ie,d.ImportPluginProvider=te,d.default=ie,d.useCurrentSchema=re,d.useDownloadXlsxTemplateAction=Q,d.useImportStartAction=Z,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/externalVersion.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
"react": "18.3.1",
|
|
3
|
-
"@tachybase/client": "1.3.
|
|
4
|
-
"@tachybase/schema": "1.3.
|
|
5
|
-
"@
|
|
3
|
+
"@tachybase/client": "1.3.23",
|
|
4
|
+
"@tachybase/schema": "1.3.43",
|
|
5
|
+
"@tego/client": "1.3.43",
|
|
6
6
|
"react-i18next": "15.2.0",
|
|
7
|
-
"@ant-design/icons": "5.
|
|
7
|
+
"@ant-design/icons": "5.6.1",
|
|
8
8
|
"antd": "5.22.5",
|
|
9
9
|
"react-dom": "18.3.1",
|
|
10
10
|
"lodash": "4.17.21",
|
|
11
|
-
"@
|
|
12
|
-
"
|
|
13
|
-
"@tachybase/database": "1.3.21",
|
|
14
|
-
"@tachybase/utils": "1.3.21"
|
|
11
|
+
"@tego/server": "1.3.43",
|
|
12
|
+
"dayjs": "1.11.13"
|
|
15
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"mathjs","version":"10.6.4","description":"Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with different data types like numbers, big numbers, complex numbers, fractions, units, and matrices.","author":"Jos de Jong <wjosdejong@gmail.com> (https://github.com/josdejong)","homepage":"https://mathjs.org","repository":{"type":"git","url":"https://github.com/josdejong/mathjs.git"},"license":"Apache-2.0","keywords":["math","mathematics","functions","numeric","algebra","parser","expression","number","bignumber","complex","fraction","matrix","unit"],"dependencies":{"@babel/runtime":"^7.18.6","complex.js":"^2.1.1","decimal.js":"^10.3.1","escape-latex":"^1.2.0","fraction.js":"^4.2.0","javascript-natural-sort":"^0.7.1","seedrandom":"^3.0.5","tiny-emitter":"^2.1.0","typed-function":"^2.1.0"},"devDependencies":{"@babel/core":"7.18.6","@babel/plugin-transform-object-assign":"7.18.6","@babel/plugin-transform-runtime":"7.18.6","@babel/preset-env":"7.18.6","@babel/register":"7.18.6","@types/assert":"1.5.6","@types/mocha":"9.1.1","@typescript-eslint/eslint-plugin":"5.30.0","@typescript-eslint/parser":"5.30.0","assert":"2.0.0","babel-loader":"8.2.5","benchmark":"2.1.4","codecov":"3.8.3","core-js":"3.23.3","del":"6.1.1","dtslint":"4.2.1","eslint":"8.18.0","eslint-config-prettier":"8.5.0","eslint-config-standard":"17.0.0","eslint-plugin-import":"2.26.0","eslint-plugin-mocha":"10.0.5","eslint-plugin-n":"15.2.3","eslint-plugin-prettier":"4.1.0","eslint-plugin-promise":"6.0.0","expect-type":"0.13.0","expr-eval":"2.0.2","fancy-log":"2.0.0","glob":"7.2.0","gulp":"4.0.2","gulp-babel":"8.0.0","handlebars":"4.7.7","istanbul":"0.4.5","jsep":"1.3.6","karma":"6.4.0","karma-browserstack-launcher":"1.6.0","karma-firefox-launcher":"2.1.2","karma-mocha":"2.0.1","karma-mocha-reporter":"2.2.5","karma-webpack":"4.0.2","math-expression-evaluator":"1.3.14","mkdirp":"1.0.4","mocha":"8.4.0","ndarray":"1.0.19","ndarray-determinant":"1.0.0","ndarray-gemm":"1.0.0","ndarray-ops":"1.2.2","ndarray-pack":"1.2.1","numericjs":"1.2.6","nyc":"15.1.0","pad-right":"0.2.2","prettier":"2.7.1","process":"0.11.10","sylvester":"0.0.21","ts-node":"10.8.1","typescript":"4.7.4","webpack":"4.46.0","zeros":"1.0.0"},"type":"module","main":"./lib/cjs","types":"./types/index.d.ts","module":"./lib/esm","unpkg":"./lib/browser/math.js","jsdelivr":"./lib/browser/math.js","exports":{".":{"types":"./types/index.d.ts","import":"./lib/esm/index.js","require":"./lib/cjs/index.js"},"./number":{"types":"./types/index.d.ts","import":"./lib/esm/number.js","require":"./lib/cjs/number.js"},"./lib/esm/number":{"types":"./types/index.d.ts","import":"./lib/esm/number.js","require":"./lib/cjs/number.js"},"./package.json":"./package.json","./lib/browser/math.js":"./lib/browser/math.js","./lib/browser/math.js.map":"./lib/browser/math.js.map","./dist/math.js":"./dist/math.js","./dist/math.min.js":"./dist/math.min.js","./main/es5/index.js":"./main/es5/index.js","./main/es5/number.js":"./main/es5/number.js","./main/esm/index.js":"./main/esm/index.js","./main/esm/number.js":"./main/esm/number.js","./number.js":"./number.cjs"},"files":["bin","dist","lib","main","types","number.cjs","LICENSE","NOTICE","README.md","HISTORY.md","CONTRIBUTING.md"],"directories":{"bin":"./bin","lib":"./lib"},"scripts":{"build":"gulp --gulpfile gulpfile.cjs && npm run update-authors","build-and-test":"npm run build && npm run test:all && npm run lint","build:clean":"gulp --gulpfile gulpfile.cjs clean","build:docs":"gulp --gulpfile gulpfile.cjs docs","compile":"gulp --gulpfile gulpfile.cjs compile","watch":"gulp --gulpfile gulpfile.cjs watch","lint":"eslint --cache --max-warnings 0 src/ test/ types/","format":"npm run lint -- --fix","validate:ascii":"gulp --gulpfile gulpfile.cjs validate:ascii","test":"npm run test:src && npm run lint","test:src":"mocha test/unit-tests","test:generated":"mocha test/generated-code-tests","test:node":"mocha test/node-tests/*.test.js test/node-tests/**/*.test.js","test:all":"npm run test:src && npm run test:generated && npm run test:node && npm run test:types","test:browser":"karma start test/browser-test-config/local-karma.js","test:browserstack":"karma start test/browser-test-config/browserstack-karma.js","test:types":"cd types && node --loader ts-node/esm ./index.ts","coverage":"nyc --reporter=lcov --reporter=text-summary mocha test/unit-tests && echo \"\nDetailed coverage report is available at ./coverage/lcov-report/index.html\"","prepublishOnly":"npm run test:all && npm run lint","prepare":"npm run build","update-authors":"node ./tools/update-authors.js"},"bin":{"mathjs":"./bin/cli.js"},"engines":{"node":">= 14"},"bugs":{"url":"https://github.com/josdejong/mathjs/issues"},"browserslist":["IE 11"],"sideEffects":false,"_lastModified":"2025-
|
|
1
|
+
{"name":"mathjs","version":"10.6.4","description":"Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with different data types like numbers, big numbers, complex numbers, fractions, units, and matrices.","author":"Jos de Jong <wjosdejong@gmail.com> (https://github.com/josdejong)","homepage":"https://mathjs.org","repository":{"type":"git","url":"https://github.com/josdejong/mathjs.git"},"license":"Apache-2.0","keywords":["math","mathematics","functions","numeric","algebra","parser","expression","number","bignumber","complex","fraction","matrix","unit"],"dependencies":{"@babel/runtime":"^7.18.6","complex.js":"^2.1.1","decimal.js":"^10.3.1","escape-latex":"^1.2.0","fraction.js":"^4.2.0","javascript-natural-sort":"^0.7.1","seedrandom":"^3.0.5","tiny-emitter":"^2.1.0","typed-function":"^2.1.0"},"devDependencies":{"@babel/core":"7.18.6","@babel/plugin-transform-object-assign":"7.18.6","@babel/plugin-transform-runtime":"7.18.6","@babel/preset-env":"7.18.6","@babel/register":"7.18.6","@types/assert":"1.5.6","@types/mocha":"9.1.1","@typescript-eslint/eslint-plugin":"5.30.0","@typescript-eslint/parser":"5.30.0","assert":"2.0.0","babel-loader":"8.2.5","benchmark":"2.1.4","codecov":"3.8.3","core-js":"3.23.3","del":"6.1.1","dtslint":"4.2.1","eslint":"8.18.0","eslint-config-prettier":"8.5.0","eslint-config-standard":"17.0.0","eslint-plugin-import":"2.26.0","eslint-plugin-mocha":"10.0.5","eslint-plugin-n":"15.2.3","eslint-plugin-prettier":"4.1.0","eslint-plugin-promise":"6.0.0","expect-type":"0.13.0","expr-eval":"2.0.2","fancy-log":"2.0.0","glob":"7.2.0","gulp":"4.0.2","gulp-babel":"8.0.0","handlebars":"4.7.7","istanbul":"0.4.5","jsep":"1.3.6","karma":"6.4.0","karma-browserstack-launcher":"1.6.0","karma-firefox-launcher":"2.1.2","karma-mocha":"2.0.1","karma-mocha-reporter":"2.2.5","karma-webpack":"4.0.2","math-expression-evaluator":"1.3.14","mkdirp":"1.0.4","mocha":"8.4.0","ndarray":"1.0.19","ndarray-determinant":"1.0.0","ndarray-gemm":"1.0.0","ndarray-ops":"1.2.2","ndarray-pack":"1.2.1","numericjs":"1.2.6","nyc":"15.1.0","pad-right":"0.2.2","prettier":"2.7.1","process":"0.11.10","sylvester":"0.0.21","ts-node":"10.8.1","typescript":"4.7.4","webpack":"4.46.0","zeros":"1.0.0"},"type":"module","main":"./lib/cjs","types":"./types/index.d.ts","module":"./lib/esm","unpkg":"./lib/browser/math.js","jsdelivr":"./lib/browser/math.js","exports":{".":{"types":"./types/index.d.ts","import":"./lib/esm/index.js","require":"./lib/cjs/index.js"},"./number":{"types":"./types/index.d.ts","import":"./lib/esm/number.js","require":"./lib/cjs/number.js"},"./lib/esm/number":{"types":"./types/index.d.ts","import":"./lib/esm/number.js","require":"./lib/cjs/number.js"},"./package.json":"./package.json","./lib/browser/math.js":"./lib/browser/math.js","./lib/browser/math.js.map":"./lib/browser/math.js.map","./dist/math.js":"./dist/math.js","./dist/math.min.js":"./dist/math.min.js","./main/es5/index.js":"./main/es5/index.js","./main/es5/number.js":"./main/es5/number.js","./main/esm/index.js":"./main/esm/index.js","./main/esm/number.js":"./main/esm/number.js","./number.js":"./number.cjs"},"files":["bin","dist","lib","main","types","number.cjs","LICENSE","NOTICE","README.md","HISTORY.md","CONTRIBUTING.md"],"directories":{"bin":"./bin","lib":"./lib"},"scripts":{"build":"gulp --gulpfile gulpfile.cjs && npm run update-authors","build-and-test":"npm run build && npm run test:all && npm run lint","build:clean":"gulp --gulpfile gulpfile.cjs clean","build:docs":"gulp --gulpfile gulpfile.cjs docs","compile":"gulp --gulpfile gulpfile.cjs compile","watch":"gulp --gulpfile gulpfile.cjs watch","lint":"eslint --cache --max-warnings 0 src/ test/ types/","format":"npm run lint -- --fix","validate:ascii":"gulp --gulpfile gulpfile.cjs validate:ascii","test":"npm run test:src && npm run lint","test:src":"mocha test/unit-tests","test:generated":"mocha test/generated-code-tests","test:node":"mocha test/node-tests/*.test.js test/node-tests/**/*.test.js","test:all":"npm run test:src && npm run test:generated && npm run test:node && npm run test:types","test:browser":"karma start test/browser-test-config/local-karma.js","test:browserstack":"karma start test/browser-test-config/browserstack-karma.js","test:types":"cd types && node --loader ts-node/esm ./index.ts","coverage":"nyc --reporter=lcov --reporter=text-summary mocha test/unit-tests && echo \"\nDetailed coverage report is available at ./coverage/lcov-report/index.html\"","prepublishOnly":"npm run test:all && npm run lint","prepare":"npm run build","update-authors":"node ./tools/update-authors.js"},"bin":{"mathjs":"./bin/cli.js"},"engines":{"node":">= 14"},"bugs":{"url":"https://github.com/josdejong/mathjs/issues"},"browserslist":["IE 11"],"sideEffects":false,"_lastModified":"2025-08-02T21:25:43.313Z"}
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/tego/tego/node_modules/.pnpm/xlsx@https+++cdn.sheetjs.com+xlsx-0.20.2+xlsx-0.20.2.tgz/node_modules/xlsx/bin/node_modules:/home/runner/work/tego/tego/node_modules/.pnpm/xlsx@https+++cdn.sheetjs.com+xlsx-0.20.2+xlsx-0.20.2.tgz/node_modules/xlsx/node_modules:/home/runner/work/tego/tego/node_modules/.pnpm/xlsx@https+++cdn.sheetjs.com+xlsx-0.20.2+xlsx-0.20.2.tgz/node_modules:/home/runner/work/tego/tego/node_modules/.pnpm/node_modules"
|
|
13
|
+
export NODE_PATH="/home/runner/work/tego-standard/tego-standard/node_modules/.pnpm/xlsx@https+++cdn.sheetjs.com+xlsx-0.20.2+xlsx-0.20.2.tgz/node_modules/xlsx/bin/node_modules:/home/runner/work/tego-standard/tego-standard/node_modules/.pnpm/xlsx@https+++cdn.sheetjs.com+xlsx-0.20.2+xlsx-0.20.2.tgz/node_modules/xlsx/node_modules:/home/runner/work/tego-standard/tego-standard/node_modules/.pnpm/xlsx@https+++cdn.sheetjs.com+xlsx-0.20.2+xlsx-0.20.2.tgz/node_modules:/home/runner/work/tego-standard/tego-standard/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/tego/tego/node_modules/.pnpm/xlsx@https+++cdn.sheetjs.com+xlsx-0.20.2+xlsx-0.20.2.tgz/node_modules/xlsx/bin/node_modules:/home/runner/work/tego/tego/node_modules/.pnpm/xlsx@https+++cdn.sheetjs.com+xlsx-0.20.2+xlsx-0.20.2.tgz/node_modules/xlsx/node_modules:/home/runner/work/tego/tego/node_modules/.pnpm/xlsx@https+++cdn.sheetjs.com+xlsx-0.20.2+xlsx-0.20.2.tgz/node_modules:/home/runner/work/tego/tego/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
15
|
+
export NODE_PATH="/home/runner/work/tego-standard/tego-standard/node_modules/.pnpm/xlsx@https+++cdn.sheetjs.com+xlsx-0.20.2+xlsx-0.20.2.tgz/node_modules/xlsx/bin/node_modules:/home/runner/work/tego-standard/tego-standard/node_modules/.pnpm/xlsx@https+++cdn.sheetjs.com+xlsx-0.20.2+xlsx-0.20.2.tgz/node_modules/xlsx/node_modules:/home/runner/work/tego-standard/tego-standard/node_modules/.pnpm/xlsx@https+++cdn.sheetjs.com+xlsx-0.20.2+xlsx-0.20.2.tgz/node_modules:/home/runner/work/tego-standard/tego-standard/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../../../../../xlsx@https+++cdn.sheetjs.com+xlsx-0.20.2+xlsx-0.20.2.tgz/node_modules/xlsx/bin/xlsx.njs" "$@"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"node-xlsx","author":"Olivier Louvignes <olivier@mg-crea.com>","version":"0.24.0","description":"NodeJS Excel files parser & builder","type":"module","main":"./dist/index.cjs","exports":{".":{"require":"./dist/index.cjs","import":"./dist/index.js","types":"./dist/index.d.ts"}},"bin":{"node-xlsx":"./dist/bin/cli.js"},"files":["dist"],"scripts":{"start":"npm run spec -- --watch","build":"tsup --entry src/index.ts --format cjs,esm --sourcemap --dts --clean --entry src/bin/cli.ts","lint":"eslint src/ test/","prettycheck":"prettier --check src/ test/","prettify":"prettier --write src/ test/","typecheck":"tsc --noEmit","spec":"DEBUG=node-xlsx* vitest --run","watch":"DEBUG=node-xlsx* vitest --watch","test":"npm run lint && npm run prettycheck && npm run typecheck && npm run spec","prepublishOnly":"npm run build"},"repository":"github:mgcrea/node-xlsx","license":"Apache-2.0","dependencies":{"xlsx":"https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz"},"devDependencies":{"@mgcrea/eslint-config-node":"^0.10.0","@tsconfig/node-lts":"^20.1.1","@types/node":"^20.12.7","eslint":"^8.57.0","prettier":"^3.2.5","prettier-plugin-organize-imports":"^3.2.4","tsup":"^8.0.2","typescript":"^5.4.5","vite-tsconfig-paths":"^4.3.2","vitest":"^1.5.0"},"engines":{"node":">=10.0.0"},"keywords":["excel","parser","builder","xlsx","xls"],"_lastModified":"2025-
|
|
1
|
+
{"name":"node-xlsx","author":"Olivier Louvignes <olivier@mg-crea.com>","version":"0.24.0","description":"NodeJS Excel files parser & builder","type":"module","main":"./dist/index.cjs","exports":{".":{"require":"./dist/index.cjs","import":"./dist/index.js","types":"./dist/index.d.ts"}},"bin":{"node-xlsx":"./dist/bin/cli.js"},"files":["dist"],"scripts":{"start":"npm run spec -- --watch","build":"tsup --entry src/index.ts --format cjs,esm --sourcemap --dts --clean --entry src/bin/cli.ts","lint":"eslint src/ test/","prettycheck":"prettier --check src/ test/","prettify":"prettier --write src/ test/","typecheck":"tsc --noEmit","spec":"DEBUG=node-xlsx* vitest --run","watch":"DEBUG=node-xlsx* vitest --watch","test":"npm run lint && npm run prettycheck && npm run typecheck && npm run spec","prepublishOnly":"npm run build"},"repository":"github:mgcrea/node-xlsx","license":"Apache-2.0","dependencies":{"xlsx":"https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz"},"devDependencies":{"@mgcrea/eslint-config-node":"^0.10.0","@tsconfig/node-lts":"^20.1.1","@types/node":"^20.12.7","eslint":"^8.57.0","prettier":"^3.2.5","prettier-plugin-organize-imports":"^3.2.4","tsup":"^8.0.2","typescript":"^5.4.5","vite-tsconfig-paths":"^4.3.2","vitest":"^1.5.0"},"engines":{"node":">=10.0.0"},"keywords":["excel","parser","builder","xlsx","xls"],"_lastModified":"2025-08-02T21:25:35.621Z"}
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/tego/tego/node_modules/.pnpm/crc-32@1.2.2/node_modules/crc-32/bin/node_modules:/home/runner/work/tego/tego/node_modules/.pnpm/crc-32@1.2.2/node_modules/crc-32/node_modules:/home/runner/work/tego/tego/node_modules/.pnpm/crc-32@1.2.2/node_modules:/home/runner/work/tego/tego/node_modules/.pnpm/node_modules"
|
|
13
|
+
export NODE_PATH="/home/runner/work/tego-standard/tego-standard/node_modules/.pnpm/crc-32@1.2.2/node_modules/crc-32/bin/node_modules:/home/runner/work/tego-standard/tego-standard/node_modules/.pnpm/crc-32@1.2.2/node_modules/crc-32/node_modules:/home/runner/work/tego-standard/tego-standard/node_modules/.pnpm/crc-32@1.2.2/node_modules:/home/runner/work/tego-standard/tego-standard/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/tego/tego/node_modules/.pnpm/crc-32@1.2.2/node_modules/crc-32/bin/node_modules:/home/runner/work/tego/tego/node_modules/.pnpm/crc-32@1.2.2/node_modules/crc-32/node_modules:/home/runner/work/tego/tego/node_modules/.pnpm/crc-32@1.2.2/node_modules:/home/runner/work/tego/tego/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
15
|
+
export NODE_PATH="/home/runner/work/tego-standard/tego-standard/node_modules/.pnpm/crc-32@1.2.2/node_modules/crc-32/bin/node_modules:/home/runner/work/tego-standard/tego-standard/node_modules/.pnpm/crc-32@1.2.2/node_modules/crc-32/node_modules:/home/runner/work/tego-standard/tego-standard/node_modules/.pnpm/crc-32@1.2.2/node_modules:/home/runner/work/tego-standard/tego-standard/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../../../../../crc-32@1.2.2/node_modules/crc-32/bin/crc32.njs" "$@"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"xlsx","version":"0.18.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","module":"xlsx.mjs","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},"sideEffects":false,"dependencies":{"adler-32":"~1.3.0","cfb":"~1.2.1","codepage":"~1.15.0","crc-32":"~1.2.1","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":"8.1.1","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":"2025-
|
|
1
|
+
{"name":"xlsx","version":"0.18.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","module":"xlsx.mjs","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},"sideEffects":false,"dependencies":{"adler-32":"~1.3.0","cfb":"~1.2.1","codepage":"~1.15.0","crc-32":"~1.2.1","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":"8.1.1","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":"2025-08-02T21:25:37.939Z"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Context, Next } from '@
|
|
1
|
+
import { Context, Next } from '@tego/server';
|
|
2
2
|
export declare function downloadXlsxTemplate(ctx: Context, next: Next): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Context, Next } from '@
|
|
1
|
+
import { Context, Next } from '@tego/server';
|
|
2
2
|
export declare function importXlsx(ctx: Context, next: Next): Promise<void>;
|
|
@@ -30,7 +30,7 @@ __export(importXlsx_exports, {
|
|
|
30
30
|
importXlsx: () => importXlsx
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(importXlsx_exports);
|
|
33
|
-
var
|
|
33
|
+
var import_server = require("@tego/server");
|
|
34
34
|
var import_node_xlsx = __toESM(require("node-xlsx"));
|
|
35
35
|
var import_xlsx = __toESM(require("xlsx"));
|
|
36
36
|
var import__ = require("../../");
|
|
@@ -166,7 +166,7 @@ async function importXlsx(ctx, next) {
|
|
|
166
166
|
ctx.body = {
|
|
167
167
|
rows: import_node_xlsx.default.build([
|
|
168
168
|
{
|
|
169
|
-
name: `${(0,
|
|
169
|
+
name: `${(0, import_server.uid)()}.xlsx`,
|
|
170
170
|
data: [importer.headerRow].concat(failure),
|
|
171
171
|
options: {}
|
|
172
172
|
}
|
package/dist/server/index.d.ts
CHANGED
package/dist/server/index.js
CHANGED
|
@@ -21,7 +21,7 @@ __export(server_exports, {
|
|
|
21
21
|
default: () => server_default
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(server_exports);
|
|
24
|
-
var import_server = require("@
|
|
24
|
+
var import_server = require("@tego/server");
|
|
25
25
|
var import__ = require("..");
|
|
26
26
|
var import_actions = require("./actions");
|
|
27
27
|
var import_locale = require("./locale");
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Context, Next } from '@
|
|
1
|
+
import { Context, Next } from '@tego/server';
|
|
2
2
|
export declare function importMiddleware(ctx: Context, next: Next): Promise<any>;
|
|
@@ -20,12 +20,12 @@ __export(middleware_exports, {
|
|
|
20
20
|
importMiddleware: () => importMiddleware
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(middleware_exports);
|
|
23
|
-
var
|
|
23
|
+
var import_server = require("@tego/server");
|
|
24
24
|
async function importMiddleware(ctx, next) {
|
|
25
25
|
if (ctx.action.actionName !== "importXlsx") {
|
|
26
26
|
return next();
|
|
27
27
|
}
|
|
28
|
-
const upload = (0,
|
|
28
|
+
const upload = (0, import_server.koaMulter)().single("file");
|
|
29
29
|
return upload(ctx, next);
|
|
30
30
|
}
|
|
31
31
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -50,7 +50,8 @@ __export(transform_exports, {
|
|
|
50
50
|
time: () => time
|
|
51
51
|
});
|
|
52
52
|
module.exports = __toCommonJS(transform_exports);
|
|
53
|
-
var
|
|
53
|
+
var import_server = require("@tego/server");
|
|
54
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
54
55
|
var math = __toESM(require("mathjs"));
|
|
55
56
|
var import__ = require("../../");
|
|
56
57
|
async function _({ value, field }) {
|
|
@@ -142,7 +143,7 @@ async function datetime({ value, field, ctx }) {
|
|
|
142
143
|
}
|
|
143
144
|
const utcOffset = ctx.get("X-Timezone");
|
|
144
145
|
const props = ((_b = (_a = field.options) == null ? void 0 : _a.uiSchema) == null ? void 0 : _b["x-component-props"]) ?? {};
|
|
145
|
-
const m = (0,
|
|
146
|
+
const m = (0, import_server.str2moment)(value, { ...props, utcOffset });
|
|
146
147
|
if (!m.isValid()) {
|
|
147
148
|
throw new Error(ctx.t("Incorrect date format", { ns: import__.namespace }));
|
|
148
149
|
}
|
|
@@ -152,7 +153,7 @@ async function time({ value, field, ctx }) {
|
|
|
152
153
|
var _a, _b;
|
|
153
154
|
const { format } = ((_b = (_a = field.options) == null ? void 0 : _a.uiSchema) == null ? void 0 : _b["x-component-props"]) ?? {};
|
|
154
155
|
if (format) {
|
|
155
|
-
const m = (0,
|
|
156
|
+
const m = (0, import_dayjs.default)(value, format);
|
|
156
157
|
if (!m.isValid()) {
|
|
157
158
|
throw new Error(ctx.t("Incorrect time format", { ns: import__.namespace }));
|
|
158
159
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/plugin-action-import",
|
|
3
3
|
"displayName": "Action: Import records",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.23",
|
|
5
5
|
"description": "Import records using excel templates. You can configure which fields to import and templates will be generated automatically.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"Actions"
|
|
@@ -10,31 +10,24 @@
|
|
|
10
10
|
"main": "./dist/server/index.js",
|
|
11
11
|
"dependencies": {},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@ant-design/icons": "
|
|
14
|
-
"@
|
|
13
|
+
"@ant-design/icons": "^5.6.1",
|
|
14
|
+
"@tachybase/schema": "^1.3.43",
|
|
15
|
+
"@tachybase/test": "^1.3.43",
|
|
16
|
+
"@tego/client": "^1.3.43",
|
|
17
|
+
"@tego/server": "^1.3.43",
|
|
15
18
|
"antd": "5.22.5",
|
|
19
|
+
"dayjs": "^1.11.13",
|
|
16
20
|
"file-saver": "^2.0.5",
|
|
17
21
|
"lodash": "4.17.21",
|
|
18
22
|
"mathjs": "^10.6.4",
|
|
19
23
|
"node-xlsx": "^0.24.0",
|
|
20
|
-
"react": "
|
|
21
|
-
"react-dom": "
|
|
22
|
-
"react-i18next": "
|
|
23
|
-
"xlsx": "
|
|
24
|
-
"@tachybase/
|
|
25
|
-
"@tachybase/schema": "1.3.21"
|
|
26
|
-
},
|
|
27
|
-
"peerDependencies": {
|
|
28
|
-
"@tachybase/client": "1.3.21",
|
|
29
|
-
"@tachybase/actions": "1.3.21",
|
|
30
|
-
"@tachybase/database": "1.3.21",
|
|
31
|
-
"@tachybase/test": "1.3.21",
|
|
32
|
-
"@tachybase/utils": "1.3.21",
|
|
33
|
-
"@tachybase/server": "1.3.21"
|
|
24
|
+
"react": "18.3.1",
|
|
25
|
+
"react-dom": "18.3.1",
|
|
26
|
+
"react-i18next": "15.2.0",
|
|
27
|
+
"xlsx": "0.18.5",
|
|
28
|
+
"@tachybase/client": "1.3.23"
|
|
34
29
|
},
|
|
35
30
|
"description.zh-CN": "使用 Excel 模板导入数据,可以配置导入哪些字段,自动生成模板。",
|
|
36
31
|
"displayName.zh-CN": "操作:导入记录",
|
|
37
|
-
"scripts": {
|
|
38
|
-
"build": "tachybase-build --no-dts @tachybase/plugin-action-import"
|
|
39
|
-
}
|
|
32
|
+
"scripts": {}
|
|
40
33
|
}
|