@kingteza/crud-component 1.0.40 → 1.0.42

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.
Files changed (68) hide show
  1. package/common/button/Button.cjs.js +1 -1
  2. package/common/button/Button.es.js +19 -20
  3. package/common/button/CloneButtonTable.cjs.js +1 -1
  4. package/common/button/CloneButtonTable.es.js +9 -10
  5. package/common/button/DeleteButtonTable.cjs.js +1 -1
  6. package/common/button/DeleteButtonTable.es.js +29 -33
  7. package/common/button/ExportButton.cjs.js +1 -1
  8. package/common/button/ExportButton.es.js +10 -11
  9. package/common/button/HideButtonTable.cjs.js +1 -1
  10. package/common/button/HideButtonTable.es.js +22 -23
  11. package/common/button/ImportButton.cjs.js +1 -1
  12. package/common/button/ImportButton.es.js +19 -20
  13. package/common/button/NewButton.cjs.js +1 -1
  14. package/common/button/NewButton.es.js +13 -14
  15. package/common/button/PrintButton.cjs.js +1 -1
  16. package/common/button/PrintButton.es.js +11 -12
  17. package/common/button/RefreshButton.cjs.js +1 -1
  18. package/common/button/RefreshButton.es.js +10 -11
  19. package/common/button/UnHideButton.cjs.js +1 -1
  20. package/common/button/UnHideButton.es.js +37 -38
  21. package/common/button/UpdateButtonTable.cjs.js +1 -1
  22. package/common/button/UpdateButtonTable.es.js +8 -9
  23. package/common/button/ViewButtonTable.cjs.js +1 -1
  24. package/common/button/ViewButtonTable.es.js +10 -11
  25. package/common/date-picker/DatePicker.cjs.js +1 -1
  26. package/common/date-picker/DatePicker.es.js +40 -41
  27. package/common/date-picker/TimePicker.cjs.js +1 -1
  28. package/common/date-picker/TimePicker.es.js +47 -48
  29. package/common/loading/LoadingIndicator.cjs.js +1 -1
  30. package/common/loading/LoadingIndicator.es.js +6 -7
  31. package/common/picker/ImagePicker.cjs.js +1 -1
  32. package/common/picker/ImagePicker.es.js +80 -81
  33. package/common/select/SelectComponent.cjs.js +1 -1
  34. package/common/select/SelectComponent.es.js +33 -34
  35. package/common/tag/StatusTag.cjs.js +1 -1
  36. package/common/tag/StatusTag.es.js +12 -13
  37. package/common/text-field/NumberField.cjs.js +1 -1
  38. package/common/text-field/NumberField.es.js +41 -42
  39. package/common/text-field/TextArea.cjs.js +1 -1
  40. package/common/text-field/TextArea.es.js +15 -16
  41. package/common/text-field/TextField.cjs.js +1 -1
  42. package/common/text-field/TextField.es.js +50 -51
  43. package/common/wizard/WizardResult.cjs.js +1 -1
  44. package/common/wizard/WizardResult.es.js +36 -38
  45. package/crud/CrudComponent.cjs.js +1 -1
  46. package/crud/CrudComponent.es.js +77 -78
  47. package/crud/CrudField.cjs.js +1 -1
  48. package/crud/CrudField.es.js +126 -127
  49. package/crud/CrudFormWizard.cjs.js +1 -1
  50. package/crud/CrudFormWizard.es.js +47 -48
  51. package/crud/FileCrudField.cjs.js +1 -1
  52. package/crud/FileCrudField.es.js +72 -73
  53. package/crud/import/CrudImportButton.cjs.js +1 -1
  54. package/crud/import/CrudImportButton.es.js +10 -11
  55. package/crud/import/CrudImportComponent.cjs.js +2 -2
  56. package/crud/import/CrudImportComponent.es.js +56 -57
  57. package/crud/view/CrudDecListView.cjs.js +1 -1
  58. package/crud/view/CrudDecListView.es.js +11 -12
  59. package/crud/view/CrudViewer.cjs.js +1 -1
  60. package/crud/view/CrudViewer.es.js +120 -121
  61. package/crud/view/CrudViewerUtil.cjs.js +1 -1
  62. package/crud/view/CrudViewerUtil.es.js +15 -17
  63. package/locale/index.cjs.js +1 -1
  64. package/locale/index.d.ts +4 -0
  65. package/locale/index.es.js +36 -24
  66. package/package.json +1 -1
  67. package/util/ValidationUtil.cjs.js +1 -1
  68. package/util/ValidationUtil.es.js +26 -23
@@ -1,93 +1,92 @@
1
- import { jsx as t, Fragment as T, jsxs as F } from "react/jsx-runtime";
2
- import { LeftOutlined as v, SaveOutlined as w, RightOutlined as x } from "@ant-design/icons";
3
- import { Form as k, Divider as A, Row as E, Col as S } from "antd";
4
- import { useMemo as y, useEffect as O } from "react";
5
- import { useTranslation as W } from "react-i18next";
6
- import { TRANSLATION_NAMESPACE as j } from "../locale/hooks/translation-constants.es.js";
7
- import { CrudFormFields as z } from "./CrudForm.es.js";
8
- import B from "../common/wizard/WizardViewForm.es.js";
9
- import C from "../common/button/Button.es.js";
10
- function H({
1
+ import { jsx as t, Fragment as v, jsxs as F } from "react/jsx-runtime";
2
+ import { LeftOutlined as w, SaveOutlined as x, RightOutlined as T } from "@ant-design/icons";
3
+ import { Form as k, Divider as W, Row as j, Col as y } from "antd";
4
+ import { useMemo as C, useEffect as z } from "react";
5
+ import { useTranslationLib as B } from "../locale/index.es.js";
6
+ import { CrudFormFields as O } from "./CrudForm.es.js";
7
+ import E from "../common/wizard/WizardViewForm.es.js";
8
+ import S from "../common/button/Button.es.js";
9
+ function I({
11
10
  fields: d,
12
11
  className: f,
13
12
  onDeleteFile: u,
14
13
  onUploadFile: l,
15
14
  purpose: m,
16
- wizard: e = [],
15
+ wizard: r = [],
17
16
  updatingValue: s,
18
17
  onSave: h,
19
18
  submitting: g
20
19
  }) {
21
- const a = y(() => e.map((o) => {
22
- let r = !0;
20
+ const a = C(() => r.map((o) => {
21
+ let e = !0;
23
22
  const n = d.filter(
24
23
  (i) => o.fields.includes(i.name)
25
24
  );
26
- return n.forEach((i) => r && (r = i.hidden ?? !1)), {
25
+ return n.forEach((i) => e && (e = i.hidden ?? !1)), {
27
26
  ...o,
28
- hidden: r,
27
+ hidden: e,
29
28
  fieldThatShouldShowing: n
30
29
  };
31
- }), [d, e]), c = y(
30
+ }), [d, r]), c = C(
32
31
  () => a.filter((o) => !o.hidden),
33
32
  [a]
34
33
  );
35
- return /* @__PURE__ */ t(T, { children: /* @__PURE__ */ t(
36
- B,
34
+ return /* @__PURE__ */ t(v, { children: /* @__PURE__ */ t(
35
+ E,
37
36
  {
38
- onSubmit: (o, r) => {
39
- console.log(r), h(r);
37
+ onSubmit: (o, e) => {
38
+ console.log(e), h(e);
40
39
  },
41
40
  className: f,
42
41
  pages: c.map(
43
- ({ title: o, icon: r, fieldThatShouldShowing: n, hidden: i }, p) => ({
42
+ ({ title: o, icon: e, fieldThatShouldShowing: n, hidden: i }, b) => ({
44
43
  title: o,
45
- icon: r,
44
+ icon: e,
46
45
  hidden: i,
47
- component: (b) => /* @__PURE__ */ t(
48
- N,
46
+ component: (p) => /* @__PURE__ */ t(
47
+ L,
49
48
  {
50
49
  fields: n,
51
50
  onDeleteFile: u,
52
51
  onUploadFile: l,
53
52
  purpose: m,
54
- i: p,
53
+ i: b,
55
54
  updatingValue: s,
56
- backward: b.backward,
57
- forward: b.forward,
55
+ backward: p.backward,
56
+ forward: p.forward,
58
57
  wizard: c,
59
58
  submitting: g
60
59
  },
61
- p
60
+ b
62
61
  )
63
62
  })
64
63
  )
65
64
  }
66
65
  ) });
67
66
  }
68
- function N({
67
+ function L({
69
68
  fields: d,
70
69
  onDeleteFile: f,
71
70
  onUploadFile: u,
72
71
  purpose: l,
73
72
  wizard: m = [],
74
- i: e,
73
+ i: r,
75
74
  forward: s,
76
75
  backward: h,
77
76
  submitting: g,
78
77
  updatingValue: a
79
78
  }) {
80
- const c = m[e], { t: o } = W(j), [r] = k.useForm();
81
- return O(() => {
79
+ const c = m[r], { t: o } = B(), [e] = k.useForm();
80
+ return z(() => {
82
81
  if (a && (l === "update" || l === "clone")) {
83
82
  const n = {};
84
83
  for (const i of d)
85
84
  n[i.name] = a[i.name];
86
- r.setFieldsValue(n);
85
+ e.setFieldsValue(n);
87
86
  }
88
- }, [d, r, l, a]), /* @__PURE__ */ F(k, { name: String(e), form: r, layout: "vertical", children: [
87
+ }, [d, e, l, a]), /* @__PURE__ */ F(k, { name: String(r), form: e, layout: "vertical", children: [
89
88
  /* @__PURE__ */ t(
90
- z,
89
+ O,
91
90
  {
92
91
  fields: d,
93
92
  formBuilder: c.formBuilder,
@@ -97,13 +96,13 @@ function N({
97
96
  purpose: l
98
97
  }
99
98
  ),
100
- /* @__PURE__ */ t(A, {}),
101
- /* @__PURE__ */ F(E, { gutter: [8, 8], children: [
102
- e > 0 && /* @__PURE__ */ t(S, { md: 12, children: /* @__PURE__ */ t(
103
- C,
99
+ /* @__PURE__ */ t(W, {}),
100
+ /* @__PURE__ */ F(j, { gutter: [8, 8], children: [
101
+ r > 0 && /* @__PURE__ */ t(y, { md: 12, children: /* @__PURE__ */ t(
102
+ S,
104
103
  {
105
104
  block: !0,
106
- icon: /* @__PURE__ */ t(v, {}),
105
+ icon: /* @__PURE__ */ t(w, {}),
107
106
  htmlType: "button",
108
107
  type: "default",
109
108
  size: "large",
@@ -111,30 +110,30 @@ function N({
111
110
  children: o("str.back")
112
111
  }
113
112
  ) }),
114
- /* @__PURE__ */ t(S, { md: e > 0 ? 12 : 24, children: /* @__PURE__ */ t(
115
- C,
113
+ /* @__PURE__ */ t(y, { md: r > 0 ? 12 : 24, children: /* @__PURE__ */ t(
114
+ S,
116
115
  {
117
116
  block: !0,
118
- icon: m.length - 1 === e ? /* @__PURE__ */ t(w, {}) : /* @__PURE__ */ t(x, {}),
117
+ icon: m.length - 1 === r ? /* @__PURE__ */ t(x, {}) : /* @__PURE__ */ t(T, {}),
119
118
  htmlType: "submit",
120
119
  type: "primary",
121
120
  loading: g,
122
121
  size: "large",
123
122
  onClick: () => {
124
- r.validateFields().then((n) => {
123
+ e.validateFields().then((n) => {
125
124
  s(
126
125
  n,
127
- m.length - 1 === e,
128
- m.length - 1 === e
126
+ m.length - 1 === r,
127
+ m.length - 1 === r
129
128
  );
130
129
  });
131
130
  },
132
- children: m.length - 1 === e ? o("str." + (l === "update" ? "update" : "save")) : o("str.next")
131
+ children: m.length - 1 === r ? o("str." + (l === "update" ? "update" : "save")) : o("str.next")
133
132
  }
134
133
  ) })
135
134
  ] })
136
135
  ] });
137
136
  }
138
137
  export {
139
- H as default
138
+ I as default
140
139
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime");;/* empty css */const d=require("@ant-design/icons"),F=require("antd"),A=require("mime"),c=require("react"),B=require("react-i18next"),H=require("../locale/hooks/translation-constants.cjs.js"),z=require("../util/ValidationUtil.cjs.js"),P=require("../common/button/Button.cjs.js"),G=require("../common/layout/VerticalSpace.cjs.js");function J({name:n,label:e,required:l,provider:s,onUploading:a,onRemoved:h,fieldClassName:j,accept:p,rules:N,maxCount:O=1,block:k,...U}){const f=F.Form.useFormInstance(),x=F.Form.useWatch(n,f),[q,S]=c.useState(!1),[b,_]=c.useState(!1),$=c.useCallback(async r=>{var i,u;try{const{file:o}=r,g=o.name;S(!0),_(!0),a==null||a(!0);const C=g??"",V=C.split("."),L=V[V.length-1],W=s.generateFileName(C),M=`${await s.getInitialPath()}/${W}.${L}`;console.log({filePath:M});const E=await s.upload({...o,originFileObj:o},M);a==null||a(!1),f.setFieldValue(n,E),(i=r.onSuccess)==null||i.call(r,E)}catch(o){(u=r.onError)==null||u.call(r,o)}finally{S(!1)}},[f,n,a,s]),[w,I]=c.useState([]);c.useEffect(()=>{!b&&x&&Promise.all((Array.isArray(x)?x:[x]).map(async r=>{const i=A.getType(r),u=r.split("/").pop(),o=await s.getRealUrl(r);return{uid:r,url:o,type:i,name:u}})).then(r=>I(()=>{const i=r.map(({url:u,type:o,uid:g,name:C})=>({uid:g,url:u,type:o,response:g,thumbUrl:u,name:C}));return console.log(i),i}))},[x,b,q,s]);const R=c.useCallback(async r=>{const i=r.response,u=i||f.getFieldValue(n);await s.delete(u),h==null||h(),r&&f.setFieldsValue({[n]:null})},[f,n,h,s]);return t.jsxs(F.Form.Item,{label:e,required:l,name:n,className:j,rules:[...l?z.required(e):[],...N??[]],children:[t.jsx("input",{hidden:!0}),t.jsx(F.Upload,{...U,fileList:w,className:((w==null?void 0:w.length)??0)>=O?"hide-upload":"",maxCount:O,customRequest:$,onRemove:R,listType:"picture",onChange:({fileList:r})=>{I(r)},style:k?{width:"100%"}:void 0,children:t.jsx(P,{loading:q,children:"Upload File"})})]})}const K=({provider:n,value:e})=>{const[l,s]=c.useState();return c.useEffect(()=>{e&&n.getRealUrl(e).then(a=>{s({mimeType:A.getType(e),url:a,fileName:e.split("/").pop()??e})})},[n,e]),l?t.jsx(D,{fileName:l.fileName,url:l==null?void 0:l.url,mimeType:l==null?void 0:l.mimeType}):t.jsx(t.Fragment,{})},D=({url:n,mimeType:e="",fileName:l})=>{const s=c.useMemo(()=>e!=null&&e.includes("image")?"image":e!=null&&e.includes("pdf")?"pdf":e!=null&&e.includes("word")?"word":e!=null&&e.includes("text")?"text":e!=null&&e.includes("presentation")?"presentation":e!=null&&e.includes("excel")||e!=null&&e.includes("spreadsheet")?"excel":"file",[e]),a=c.useMemo(()=>{switch(s){case"image":return t.jsx(d.FileImageOutlined,{});case"pdf":return t.jsx(d.FilePdfOutlined,{});case"word":return t.jsx(d.FileWordOutlined,{});case"text":return t.jsx(d.FileTextOutlined,{});case"excel":return t.jsx(d.FileExcelOutlined,{});case"presentation":return t.jsx(d.FilePptOutlined,{});default:return t.jsx(d.FileOutlined,{})}},[s]),[h,j]=c.useState(!1),{t:p}=B.useTranslation(H.TRANSLATION_NAMESPACE);return s!=="file"&&s!=="text"?t.jsxs(t.Fragment,{children:[t.jsx(F.Modal,{open:h,title:l,onCancel:()=>j(!1),footer:t.jsx(t.Fragment,{}),width:"100%",style:{top:"8px",minHeight:"700px"},destroyOnClose:!0,children:t.jsxs(G,{children:[t.jsx(P,{tooltip:l,icon:t.jsx(d.ExportOutlined,{}),target:"_blank",href:n,style:{textDecoration:"none"},children:p("str.openInNewTab")}),s==="image"?t.jsx("img",{src:n,alt:l,style:{width:"100%"}}):s==="pdf"?t.jsxs("iframe",{title:l,src:n,width:"100%",height:"700px",children:["This browser does not support PDFs. Please download the PDF to view it:",t.jsx("a",{href:n,children:"Download PDF"}),"."]}):t.jsxs("iframe",{title:l,src:`https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(n)}`,width:"100%",height:"700px",children:["This browser does not support open ",s.toUpperCase(),". Please download the",s.toUpperCase()," to view it:",t.jsxs("a",{href:n,children:["Download ",s.toUpperCase()]}),"."]})]})}),t.jsx(P,{tooltip:l,icon:a,shape:"circle",onClick:()=>j(!0)})]}):t.jsx(P,{tooltip:l,icon:a,target:"_blank",href:n,shape:"circle"})};exports.FileCellValue=D;exports.FileCrudCellValue=K;exports.default=J;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime");;/* empty css */const d=require("@ant-design/icons"),F=require("antd"),k=require("mime"),c=require("react"),B=require("../locale/index.cjs.js"),H=require("../util/ValidationUtil.cjs.js"),p=require("../common/button/Button.cjs.js"),z=require("../common/layout/VerticalSpace.cjs.js");function G({name:n,label:e,required:l,provider:s,onUploading:a,onRemoved:h,fieldClassName:j,accept:P,rules:U,maxCount:O=1,block:_,...$}){const f=F.Form.useFormInstance(),x=F.Form.useWatch(n,f),[b,q]=c.useState(!1),[V,N]=c.useState(!1),A=c.useCallback(async r=>{var i,u;try{const{file:o}=r,g=o.name;q(!0),N(!0),a==null||a(!0);const C=g??"",I=C.split("."),R=I[I.length-1],W=s.generateFileName(C),M=`${await s.getInitialPath()}/${W}.${R}`;console.log({filePath:M});const D=await s.upload({...o,originFileObj:o},M);a==null||a(!1),f.setFieldValue(n,D),(i=r.onSuccess)==null||i.call(r,D)}catch(o){(u=r.onError)==null||u.call(r,o)}finally{q(!1)}},[f,n,a,s]),[w,S]=c.useState([]);c.useEffect(()=>{!V&&x&&Promise.all((Array.isArray(x)?x:[x]).map(async r=>{const i=k.getType(r),u=r.split("/").pop(),o=await s.getRealUrl(r);return{uid:r,url:o,type:i,name:u}})).then(r=>S(()=>{const i=r.map(({url:u,type:o,uid:g,name:C})=>({uid:g,url:u,type:o,response:g,thumbUrl:u,name:C}));return console.log(i),i}))},[x,V,b,s]);const L=c.useCallback(async r=>{const i=r.response,u=i||f.getFieldValue(n);await s.delete(u),h==null||h(),r&&f.setFieldsValue({[n]:null})},[f,n,h,s]);return t.jsxs(F.Form.Item,{label:e,required:l,name:n,className:j,rules:[...l?H.required(e):[],...U??[]],children:[t.jsx("input",{hidden:!0}),t.jsx(F.Upload,{...$,fileList:w,className:((w==null?void 0:w.length)??0)>=O?"hide-upload":"",maxCount:O,customRequest:A,onRemove:L,listType:"picture",onChange:({fileList:r})=>{S(r)},style:_?{width:"100%"}:void 0,children:t.jsx(p,{loading:b,children:"Upload File"})})]})}const J=({provider:n,value:e})=>{const[l,s]=c.useState();return c.useEffect(()=>{e&&n.getRealUrl(e).then(a=>{s({mimeType:k.getType(e),url:a,fileName:e.split("/").pop()??e})})},[n,e]),l?t.jsx(E,{fileName:l.fileName,url:l==null?void 0:l.url,mimeType:l==null?void 0:l.mimeType}):t.jsx(t.Fragment,{})},E=({url:n,mimeType:e="",fileName:l})=>{const s=c.useMemo(()=>e!=null&&e.includes("image")?"image":e!=null&&e.includes("pdf")?"pdf":e!=null&&e.includes("word")?"word":e!=null&&e.includes("text")?"text":e!=null&&e.includes("presentation")?"presentation":e!=null&&e.includes("excel")||e!=null&&e.includes("spreadsheet")?"excel":"file",[e]),a=c.useMemo(()=>{switch(s){case"image":return t.jsx(d.FileImageOutlined,{});case"pdf":return t.jsx(d.FilePdfOutlined,{});case"word":return t.jsx(d.FileWordOutlined,{});case"text":return t.jsx(d.FileTextOutlined,{});case"excel":return t.jsx(d.FileExcelOutlined,{});case"presentation":return t.jsx(d.FilePptOutlined,{});default:return t.jsx(d.FileOutlined,{})}},[s]),[h,j]=c.useState(!1),{t:P}=B.useTranslationLib();return s!=="file"&&s!=="text"?t.jsxs(t.Fragment,{children:[t.jsx(F.Modal,{open:h,title:l,onCancel:()=>j(!1),footer:t.jsx(t.Fragment,{}),width:"100%",style:{top:"8px",minHeight:"700px"},destroyOnClose:!0,children:t.jsxs(z,{children:[t.jsx(p,{tooltip:l,icon:t.jsx(d.ExportOutlined,{}),target:"_blank",href:n,style:{textDecoration:"none"},children:P("str.openInNewTab")}),s==="image"?t.jsx("img",{src:n,alt:l,style:{width:"100%"}}):s==="pdf"?t.jsxs("iframe",{title:l,src:n,width:"100%",height:"700px",children:["This browser does not support PDFs. Please download the PDF to view it:",t.jsx("a",{href:n,children:"Download PDF"}),"."]}):t.jsxs("iframe",{title:l,src:`https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(n)}`,width:"100%",height:"700px",children:["This browser does not support open ",s.toUpperCase(),". Please download the",s.toUpperCase()," to view it:",t.jsxs("a",{href:n,children:["Download ",s.toUpperCase()]}),"."]})]})}),t.jsx(p,{tooltip:l,icon:a,shape:"circle",onClick:()=>j(!0)})]}):t.jsx(p,{tooltip:l,icon:a,target:"_blank",href:n,shape:"circle"})};exports.FileCellValue=E;exports.FileCrudCellValue=J;exports.default=G;
@@ -1,71 +1,70 @@
1
1
  import { jsxs as f, jsx as s, Fragment as O } from "react/jsx-runtime";
2
2
  /* empty css */
3
- import { FileOutlined as G, FilePptOutlined as J, FileExcelOutlined as K, FileTextOutlined as Q, FileWordOutlined as X, FilePdfOutlined as Y, FileImageOutlined as Z, ExportOutlined as v } from "@ant-design/icons";
3
+ import { FileOutlined as J, FilePptOutlined as K, FileExcelOutlined as Q, FileTextOutlined as R, FileWordOutlined as X, FilePdfOutlined as Y, FileImageOutlined as Z, ExportOutlined as v } from "@ant-design/icons";
4
4
  import { Form as P, Upload as y, Modal as m } from "antd";
5
- import $ from "mime";
6
- import { useState as p, useCallback as U, useEffect as j, useMemo as k } from "react";
7
- import { useTranslation as T } from "react-i18next";
8
- import { TRANSLATION_NAMESPACE as tt } from "../locale/hooks/translation-constants.es.js";
9
- import et from "../util/ValidationUtil.es.js";
5
+ import S from "mime";
6
+ import { useState as p, useCallback as j, useEffect as A, useMemo as N } from "react";
7
+ import { useTranslationLib as T } from "../locale/index.es.js";
8
+ import tt from "../util/ValidationUtil.es.js";
10
9
  import C from "../common/button/Button.es.js";
11
- import st from "../common/layout/VerticalSpace.es.js";
12
- function wt({
10
+ import et from "../common/layout/VerticalSpace.es.js";
11
+ function ht({
13
12
  name: n,
14
13
  label: t,
15
- required: r,
14
+ required: l,
16
15
  provider: e,
17
16
  onUploading: a,
18
17
  onRemoved: u,
19
18
  fieldClassName: w,
20
- accept: I,
21
- rules: _,
22
- maxCount: V = 1,
23
- block: L,
24
- ...W
19
+ accept: b,
20
+ rules: L,
21
+ maxCount: I = 1,
22
+ block: W,
23
+ ..._
25
24
  }) {
26
- const d = P.useFormInstance(), h = P.useWatch(n, d), [b, A] = p(!1), [D, q] = p(!1), B = U(
27
- async (l) => {
25
+ const d = P.useFormInstance(), h = P.useWatch(n, d), [V, D] = p(!1), [U, q] = p(!1), B = j(
26
+ async (r) => {
28
27
  var c, o;
29
28
  try {
30
- const { file: i } = l, x = i.name;
31
- A(!0), q(!0), a == null || a(!0);
32
- const g = x ?? "", N = g.split("."), R = N[N.length - 1], z = e.generateFileName(g), M = `${await e.getInitialPath()}/${z}.${R}`;
29
+ const { file: i } = r, x = i.name;
30
+ D(!0), q(!0), a == null || a(!0);
31
+ const g = x ?? "", E = g.split("."), z = E[E.length - 1], G = e.generateFileName(g), M = `${await e.getInitialPath()}/${G}.${z}`;
33
32
  console.log({ filePath: M });
34
- const S = await e.upload(
33
+ const $ = await e.upload(
35
34
  { ...i, originFileObj: i },
36
35
  M
37
36
  );
38
- a == null || a(!1), d.setFieldValue(n, S), (c = l.onSuccess) == null || c.call(l, S);
37
+ a == null || a(!1), d.setFieldValue(n, $), (c = r.onSuccess) == null || c.call(r, $);
39
38
  } catch (i) {
40
- (o = l.onError) == null || o.call(l, i);
39
+ (o = r.onError) == null || o.call(r, i);
41
40
  } finally {
42
- A(!1);
41
+ D(!1);
43
42
  }
44
43
  },
45
44
  [d, n, a, e]
46
- ), [F, E] = p([]);
47
- j(() => {
48
- !D && h && Promise.all(
45
+ ), [F, k] = p([]);
46
+ A(() => {
47
+ !U && h && Promise.all(
49
48
  (Array.isArray(h) ? h : [h]).map(
50
- async (l) => {
51
- const c = $.getType(l), o = l.split("/").pop(), i = await e.getRealUrl(l);
49
+ async (r) => {
50
+ const c = S.getType(r), o = r.split("/").pop(), i = await e.getRealUrl(r);
52
51
  return {
53
- uid: l,
52
+ uid: r,
54
53
  url: i,
55
54
  type: c,
56
55
  name: o
57
56
  };
58
57
  }
59
58
  )
60
- ).then((l) => E(() => {
61
- const c = l.map(({ url: o, type: i, uid: x, name: g }) => ({ uid: x, url: o, type: i, response: x, thumbUrl: o, name: g }));
59
+ ).then((r) => k(() => {
60
+ const c = r.map(({ url: o, type: i, uid: x, name: g }) => ({ uid: x, url: o, type: i, response: x, thumbUrl: o, name: g }));
62
61
  return console.log(c), c;
63
62
  }));
64
- }, [h, D, b, e]);
65
- const H = U(
66
- async (l) => {
67
- const c = l.response, o = c || d.getFieldValue(n);
68
- await e.delete(o), u == null || u(), l && d.setFieldsValue({ [n]: null });
63
+ }, [h, U, V, e]);
64
+ const H = j(
65
+ async (r) => {
66
+ const c = r.response, o = c || d.getFieldValue(n);
67
+ await e.delete(o), u == null || u(), r && d.setFieldsValue({ [n]: null });
69
68
  },
70
69
  [d, n, u, e]
71
70
  );
@@ -73,56 +72,56 @@ function wt({
73
72
  P.Item,
74
73
  {
75
74
  label: t,
76
- required: r,
75
+ required: l,
77
76
  name: n,
78
77
  className: w,
79
78
  rules: [
80
- ...r ? et.required(t) : [],
81
- ..._ ?? []
79
+ ...l ? tt.required(t) : [],
80
+ ...L ?? []
82
81
  ],
83
82
  children: [
84
83
  /* @__PURE__ */ s("input", { hidden: !0 }),
85
84
  /* @__PURE__ */ s(
86
85
  y,
87
86
  {
88
- ...W,
87
+ ..._,
89
88
  fileList: F,
90
- className: ((F == null ? void 0 : F.length) ?? 0) >= V ? "hide-upload" : "",
91
- maxCount: V,
89
+ className: ((F == null ? void 0 : F.length) ?? 0) >= I ? "hide-upload" : "",
90
+ maxCount: I,
92
91
  customRequest: B,
93
92
  onRemove: H,
94
93
  listType: "picture",
95
- onChange: ({ fileList: l }) => {
96
- E(l);
94
+ onChange: ({ fileList: r }) => {
95
+ k(r);
97
96
  },
98
- style: L ? { width: "100%" } : void 0,
99
- children: /* @__PURE__ */ s(C, { loading: b, children: "Upload File" })
97
+ style: W ? { width: "100%" } : void 0,
98
+ children: /* @__PURE__ */ s(C, { loading: V, children: "Upload File" })
100
99
  }
101
100
  )
102
101
  ]
103
102
  }
104
103
  );
105
104
  }
106
- const Ft = ({ provider: n, value: t }) => {
107
- const [r, e] = p();
108
- return j(() => {
105
+ const pt = ({ provider: n, value: t }) => {
106
+ const [l, e] = p();
107
+ return A(() => {
109
108
  t && n.getRealUrl(t).then((a) => {
110
109
  e({
111
- mimeType: $.getType(t),
110
+ mimeType: S.getType(t),
112
111
  url: a,
113
112
  fileName: t.split("/").pop() ?? t
114
113
  });
115
114
  });
116
- }, [n, t]), r ? /* @__PURE__ */ s(
117
- rt,
115
+ }, [n, t]), l ? /* @__PURE__ */ s(
116
+ st,
118
117
  {
119
- fileName: r.fileName,
120
- url: r == null ? void 0 : r.url,
121
- mimeType: r == null ? void 0 : r.mimeType
118
+ fileName: l.fileName,
119
+ url: l == null ? void 0 : l.url,
120
+ mimeType: l == null ? void 0 : l.mimeType
122
121
  }
123
122
  ) : /* @__PURE__ */ s(O, {});
124
- }, rt = ({ url: n, mimeType: t = "", fileName: r }) => {
125
- const e = k(() => t != null && t.includes("image") ? "image" : t != null && t.includes("pdf") ? "pdf" : t != null && t.includes("word") ? "word" : t != null && t.includes("text") ? "text" : t != null && t.includes("presentation") ? "presentation" : t != null && t.includes("excel") || t != null && t.includes("spreadsheet") ? "excel" : "file", [t]), a = k(() => {
123
+ }, st = ({ url: n, mimeType: t = "", fileName: l }) => {
124
+ const e = N(() => t != null && t.includes("image") ? "image" : t != null && t.includes("pdf") ? "pdf" : t != null && t.includes("word") ? "word" : t != null && t.includes("text") ? "text" : t != null && t.includes("presentation") ? "presentation" : t != null && t.includes("excel") || t != null && t.includes("spreadsheet") ? "excel" : "file", [t]), a = N(() => {
126
125
  switch (e) {
127
126
  case "image":
128
127
  return /* @__PURE__ */ s(Z, {});
@@ -131,46 +130,46 @@ const Ft = ({ provider: n, value: t }) => {
131
130
  case "word":
132
131
  return /* @__PURE__ */ s(X, {});
133
132
  case "text":
134
- return /* @__PURE__ */ s(Q, {});
133
+ return /* @__PURE__ */ s(R, {});
135
134
  case "excel":
136
- return /* @__PURE__ */ s(K, {});
135
+ return /* @__PURE__ */ s(Q, {});
137
136
  case "presentation":
138
- return /* @__PURE__ */ s(J, {});
137
+ return /* @__PURE__ */ s(K, {});
139
138
  default:
140
- return /* @__PURE__ */ s(G, {});
139
+ return /* @__PURE__ */ s(J, {});
141
140
  }
142
- }, [e]), [u, w] = p(!1), { t: I } = T(tt);
141
+ }, [e]), [u, w] = p(!1), { t: b } = T();
143
142
  return e !== "file" && e !== "text" ? /* @__PURE__ */ f(O, { children: [
144
143
  /* @__PURE__ */ s(
145
144
  m,
146
145
  {
147
146
  open: u,
148
- title: r,
147
+ title: l,
149
148
  onCancel: () => w(!1),
150
149
  footer: /* @__PURE__ */ s(O, {}),
151
150
  width: "100%",
152
151
  style: { top: "8px", minHeight: "700px" },
153
152
  destroyOnClose: !0,
154
- children: /* @__PURE__ */ f(st, { children: [
153
+ children: /* @__PURE__ */ f(et, { children: [
155
154
  /* @__PURE__ */ s(
156
155
  C,
157
156
  {
158
- tooltip: r,
157
+ tooltip: l,
159
158
  icon: /* @__PURE__ */ s(v, {}),
160
159
  target: "_blank",
161
160
  href: n,
162
161
  style: { textDecoration: "none" },
163
- children: I("str.openInNewTab")
162
+ children: b("str.openInNewTab")
164
163
  }
165
164
  ),
166
- e === "image" ? /* @__PURE__ */ s("img", { src: n, alt: r, style: { width: "100%" } }) : e === "pdf" ? /* @__PURE__ */ f("iframe", { title: r, src: n, width: "100%", height: "700px", children: [
165
+ e === "image" ? /* @__PURE__ */ s("img", { src: n, alt: l, style: { width: "100%" } }) : e === "pdf" ? /* @__PURE__ */ f("iframe", { title: l, src: n, width: "100%", height: "700px", children: [
167
166
  "This browser does not support PDFs. Please download the PDF to view it:",
168
167
  /* @__PURE__ */ s("a", { href: n, children: "Download PDF" }),
169
168
  "."
170
169
  ] }) : /* @__PURE__ */ f(
171
170
  "iframe",
172
171
  {
173
- title: r,
172
+ title: l,
174
173
  src: `https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(
175
174
  n
176
175
  )}`,
@@ -196,7 +195,7 @@ const Ft = ({ provider: n, value: t }) => {
196
195
  /* @__PURE__ */ s(
197
196
  C,
198
197
  {
199
- tooltip: r,
198
+ tooltip: l,
200
199
  icon: a,
201
200
  shape: "circle",
202
201
  onClick: () => w(!0)
@@ -205,7 +204,7 @@ const Ft = ({ provider: n, value: t }) => {
205
204
  ] }) : /* @__PURE__ */ s(
206
205
  C,
207
206
  {
208
- tooltip: r,
207
+ tooltip: l,
209
208
  icon: a,
210
209
  target: "_blank",
211
210
  href: n,
@@ -214,7 +213,7 @@ const Ft = ({ provider: n, value: t }) => {
214
213
  );
215
214
  };
216
215
  export {
217
- rt as FileCellValue,
218
- Ft as FileCrudCellValue,
219
- wt as default
216
+ st as FileCellValue,
217
+ pt as FileCrudCellValue,
218
+ ht as default
220
219
  };
@@ -1 +1 @@
1
- "use strict";const t=require("react/jsx-runtime"),s=require("@ant-design/icons"),i=require("react"),u=require("react-i18next"),c=require("../../locale/hooks/translation-constants.cjs.js"),p=require("./CrudImportComponent.cjs.js"),a=require("../../common/button/Button.cjs.js");function m(n){const{t:r}=u.useTranslation(c.TRANSLATION_NAMESPACE),[o,e]=i.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsx(p,{open:o,onCloseMethod:e,...n}),t.jsx(a,{icon:t.jsx(s.ImportOutlined,{}),onClick:()=>e(!0),children:r("str.import")})]})}module.exports=m;
1
+ "use strict";const t=require("react/jsx-runtime"),s=require("@ant-design/icons"),i=require("react"),u=require("../../locale/index.cjs.js"),c=require("./CrudImportComponent.cjs.js"),p=require("../../common/button/Button.cjs.js");function m(n){const{t:r}=u.useTranslationLib(),[o,e]=i.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsx(c,{open:o,onCloseMethod:e,...n}),t.jsx(p,{icon:t.jsx(s.ImportOutlined,{}),onClick:()=>e(!0),children:r("str.import")})]})}module.exports=m;
@@ -1,31 +1,30 @@
1
1
  import { jsxs as e, Fragment as p, jsx as o } from "react/jsx-runtime";
2
2
  import { ImportOutlined as i } from "@ant-design/icons";
3
3
  import { useState as s } from "react";
4
- import { useTranslation as u } from "react-i18next";
5
- import { TRANSLATION_NAMESPACE as f } from "../../locale/hooks/translation-constants.es.js";
6
- import l from "./CrudImportComponent.es.js";
7
- import a from "../../common/button/Button.es.js";
8
- function N(r) {
9
- const { t: m } = u(f), [n, t] = s(!1);
4
+ import { useTranslationLib as u } from "../../locale/index.es.js";
5
+ import f from "./CrudImportComponent.es.js";
6
+ import l from "../../common/button/Button.es.js";
7
+ function x(r) {
8
+ const { t: n } = u(), [m, t] = s(!1);
10
9
  return /* @__PURE__ */ e(p, { children: [
11
10
  /* @__PURE__ */ o(
12
- l,
11
+ f,
13
12
  {
14
- open: n,
13
+ open: m,
15
14
  onCloseMethod: t,
16
15
  ...r
17
16
  }
18
17
  ),
19
18
  /* @__PURE__ */ o(
20
- a,
19
+ l,
21
20
  {
22
21
  icon: /* @__PURE__ */ o(i, {}),
23
22
  onClick: () => t(!0),
24
- children: m("str.import")
23
+ children: n("str.import")
25
24
  }
26
25
  )
27
26
  ] });
28
27
  }
29
28
  export {
30
- N as default
29
+ x as default
31
30
  };
@@ -1,2 +1,2 @@
1
- "use strict";const n=require("react/jsx-runtime"),q=require("@ant-design/icons"),O=require("papaparse"),d=require("antd"),V=require("file-saver"),a=require("react"),W=require("react-i18next"),R=require("../../locale/hooks/translation-constants.cjs.js"),L=require("../view/CrudViewer.cjs.js"),z=require("../../util/DateUtil.cjs.js"),_=require("../../common/button/Button.cjs.js"),$=require("../../common/button/ImportButton.cjs.js");function U({onCloseMethod:C,open:w,fields:T,importProps:o}){const[u,A]=a.useState([]),[y,k]=a.useState(!1),[v,N]=a.useState(0);a.useEffect(()=>{w||(A([]),k(!1))},[w]);const p=a.useMemo(()=>new Map(T.filter(e=>{var t;return!e.hidden&&!((t=e.importProps)!=null&&t.hidden)&&!e.readonly}).map(e=>[e.name,e])),[T]),S=a.useMemo(()=>Array.from(p.values()).flatMap(e=>{var t;return[e.name,...((t=e.importProps)==null?void 0:t.extraFields)??[]]}),[p]),F=a.useCallback(async function(){const e=`${S.join(",")}
2
- `,t=new Blob([e],{type:"text/csv;charset=utf-8;"});V.saveAs(t,(o==null?void 0:o.name)+" - "+z.formatDateTimeWithSecond(new Date).replaceAll(":","-")+".csv")},[S,o==null?void 0:o.name]),{t:i}=W.useTranslation(R.TRANSLATION_NAMESPACE),B=a.useCallback(async e=>{const t=new FileReader;t.onerror=console.error,t.onload=async r=>{var s;const c=(s=r==null?void 0:r.target)==null?void 0:s.result,l=O.parse(c,{header:!0});A(l.data)},t.readAsText(e)},[]),g=a.useMemo(()=>{var t,r,c;let e=!1;for(const l of u)for(const[s,f]of p.entries()){const h=l[s],m=h||!isNaN(h);if(f.required&&!m)if((r=(t=f.importProps)==null?void 0:t.extraFields)!=null&&r.length)for(const j of((c=f.importProps)==null?void 0:c.extraFields)??[])if(l[j]||!isNaN(l[j])){e=!1;break}else return!0;else return!0}return e},[u,p]),x=a.useCallback(e=>(t,r)=>{var l,s,f;const c=t||!isNaN(t);if(e.required&&!c){let h=i("err.validation.required");if((s=(l=e.importProps)==null?void 0:l.extraFields)!=null&&s.length){const m=(f=e.importProps)==null?void 0:f.extraFields;(m==null?void 0:m.find(E=>!r[E]))&&(h="Either one of these fields is required: "+[e.name,...m].join(", "))}return n.jsxs(d.Tooltip,{className:"d-flex",title:h,children:[n.jsx(q.WarningTwoTone,{twoToneColor:"#ee9702"}),t]})}return t},[i]),I=a.useCallback(async e=>{N(e)},[]),b=a.useCallback(async()=>{try{k(!0),await o.onClickImport(u,I),C(!1)}finally{k(!1),N(0)}},[u,o,C,I]),{modal:D}=d.App.useApp(),M=a.useCallback(async()=>{g?D.warning?D.warning({title:i("str.warning"),content:i("qus.importWithIssues"),okText:i("str.import"),onOk:b,okCancel:!0,closable:!0}):(console.error("You must wrap your react app with App component. https://ant.design/components/app"),window.confirm(i("qus.importWithIssues"))&&b()):b()},[g,b,i]);return n.jsxs(d.Modal,{title:[i("str.import"),o==null?void 0:o.name].filter(Boolean).join(" "),width:"100%",open:w,onOk:M,destroyOnClose:!0,onCancel:()=>C(!1),okText:i("str.import"),confirmLoading:y,okButtonProps:{disabled:!(u!=null&&u.length)},footer:(e,{OkBtn:t,CancelBtn:r})=>n.jsxs(d.Space,{children:[n.jsx(r,{}),n.jsx(t,{}),g&&n.jsx(d.Tooltip,{className:"d-flex",title:"Some fields have issue. Please review before submit.",children:n.jsx(q.WarningTwoTone,{twoToneColor:"#ee9702"})})]}),children:[n.jsxs(d.Space,{children:[n.jsx(_,{onClick:F,icon:n.jsx(q.DownloadOutlined,{}),children:i("str.downloadCsvTemplate")}),n.jsx($.ImportButton,{disabled:y,type:"default",onClick:B,accept:".csv",children:i("str.importCsvFile")})]}),n.jsx(d.Spin,{spinning:y,indicator:v?n.jsx(d.Progress,{type:"circle",percent:v*100,size:50,format:e=>`${parseInt(e)}%`}):void 0,children:n.jsx(L,{data:u,bordered:!0,size:"small",fields:Array.from(p.values()).flatMap(e=>{var t,r,c,l;return e.type==="text"?[{...e,label:e.name,render:x(e)},...((r=(t=e.importProps)==null?void 0:t.extraFields)==null?void 0:r.map(s=>({...e,name:s,label:s,render:x(e)})))??[]]:e.type==="select"?[{...e,label:e.name,type:"text",render:x(e)},...((l=(c=e.importProps)==null?void 0:c.extraFields)==null?void 0:l.map(s=>({...e,name:s,label:s,type:"text",render:x(e)})))??[]]:[{...e,label:e.name,render:x(e)}]})})})]})}module.exports=U;
1
+ "use strict";const n=require("react/jsx-runtime"),q=require("@ant-design/icons"),V=require("papaparse"),d=require("antd"),W=require("file-saver"),a=require("react"),O=require("../../locale/index.cjs.js"),L=require("../view/CrudViewer.cjs.js"),R=require("../../util/DateUtil.cjs.js"),z=require("../../common/button/Button.cjs.js"),$=require("../../common/button/ImportButton.cjs.js");function U({onCloseMethod:w,open:y,fields:T,importProps:o}){const[u,v]=a.useState([]),[C,k]=a.useState(!1),[A,D]=a.useState(0);a.useEffect(()=>{y||(v([]),k(!1))},[y]);const p=a.useMemo(()=>new Map(T.filter(e=>{var t;return!e.hidden&&!((t=e.importProps)!=null&&t.hidden)&&!e.readonly}).map(e=>[e.name,e])),[T]),S=a.useMemo(()=>Array.from(p.values()).flatMap(e=>{var t;return[e.name,...((t=e.importProps)==null?void 0:t.extraFields)??[]]}),[p]),E=a.useCallback(async function(){const e=`${S.join(",")}
2
+ `,t=new Blob([e],{type:"text/csv;charset=utf-8;"});W.saveAs(t,(o==null?void 0:o.name)+" - "+R.formatDateTimeWithSecond(new Date).replaceAll(":","-")+".csv")},[S,o==null?void 0:o.name]),{t:i}=O.useTranslationLib(),B=a.useCallback(async e=>{const t=new FileReader;t.onerror=console.error,t.onload=async r=>{var s;const c=(s=r==null?void 0:r.target)==null?void 0:s.result,l=V.parse(c,{header:!0});v(l.data)},t.readAsText(e)},[]),g=a.useMemo(()=>{var t,r,c;let e=!1;for(const l of u)for(const[s,f]of p.entries()){const h=l[s],m=h||!isNaN(h);if(f.required&&!m)if((r=(t=f.importProps)==null?void 0:t.extraFields)!=null&&r.length)for(const j of((c=f.importProps)==null?void 0:c.extraFields)??[])if(l[j]||!isNaN(l[j])){e=!1;break}else return!0;else return!0}return e},[u,p]),x=a.useCallback(e=>(t,r)=>{var l,s,f;const c=t||!isNaN(t);if(e.required&&!c){let h=i("err.validation.required");if((s=(l=e.importProps)==null?void 0:l.extraFields)!=null&&s.length){const m=(f=e.importProps)==null?void 0:f.extraFields;(m==null?void 0:m.find(N=>!r[N]))&&(h="Either one of these fields is required: "+[e.name,...m].join(", "))}return n.jsxs(d.Tooltip,{className:"d-flex",title:h,children:[n.jsx(q.WarningTwoTone,{twoToneColor:"#ee9702"}),t]})}return t},[i]),F=a.useCallback(async e=>{D(e)},[]),b=a.useCallback(async()=>{try{k(!0),await o.onClickImport(u,F),w(!1)}finally{k(!1),D(0)}},[u,o,w,F]),{modal:I}=d.App.useApp(),M=a.useCallback(async()=>{g?I.warning?I.warning({title:i("str.warning"),content:i("qus.importWithIssues"),okText:i("str.import"),onOk:b,okCancel:!0,closable:!0}):(console.error("You must wrap your react app with App component. https://ant.design/components/app"),window.confirm(i("qus.importWithIssues"))&&b()):b()},[g,b,i]);return n.jsxs(d.Modal,{title:[i("str.import"),o==null?void 0:o.name].filter(Boolean).join(" "),width:"100%",open:y,onOk:M,destroyOnClose:!0,onCancel:()=>w(!1),okText:i("str.import"),confirmLoading:C,okButtonProps:{disabled:!(u!=null&&u.length)},footer:(e,{OkBtn:t,CancelBtn:r})=>n.jsxs(d.Space,{children:[n.jsx(r,{}),n.jsx(t,{}),g&&n.jsx(d.Tooltip,{className:"d-flex",title:"Some fields have issue. Please review before submit.",children:n.jsx(q.WarningTwoTone,{twoToneColor:"#ee9702"})})]}),children:[n.jsxs(d.Space,{children:[n.jsx(z,{onClick:E,icon:n.jsx(q.DownloadOutlined,{}),children:i("str.downloadCsvTemplate")}),n.jsx($.ImportButton,{disabled:C,type:"default",onClick:B,accept:".csv",children:i("str.importCsvFile")})]}),n.jsx(d.Spin,{spinning:C,indicator:A?n.jsx(d.Progress,{type:"circle",percent:A*100,size:50,format:e=>`${parseInt(e)}%`}):void 0,children:n.jsx(L,{data:u,bordered:!0,size:"small",fields:Array.from(p.values()).flatMap(e=>{var t,r,c,l;return e.type==="text"?[{...e,label:e.name,render:x(e)},...((r=(t=e.importProps)==null?void 0:t.extraFields)==null?void 0:r.map(s=>({...e,name:s,label:s,render:x(e)})))??[]]:e.type==="select"?[{...e,label:e.name,type:"text",render:x(e)},...((l=(c=e.importProps)==null?void 0:c.extraFields)==null?void 0:l.map(s=>({...e,name:s,label:s,type:"text",render:x(e)})))??[]]:[{...e,label:e.name,render:x(e)}]})})})]})}module.exports=U;