@kingteza/crud-component 1.0.14 → 1.0.16

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 (105) hide show
  1. package/dist/components/common/DatePicker/DatePicker.cjs +1 -1
  2. package/dist/components/common/DatePicker/DatePicker.js +42 -42
  3. package/dist/components/common/DatePicker/TimePicker.cjs +1 -1
  4. package/dist/components/common/DatePicker/TimePicker.js +39 -39
  5. package/dist/components/common/appearance/Hider.cjs +1 -1
  6. package/dist/components/common/appearance/Hider.js +3 -3
  7. package/dist/components/common/button/Button.cjs +1 -1
  8. package/dist/components/common/button/Button.js +19 -19
  9. package/dist/components/common/button/CloneButtonTable.cjs +1 -1
  10. package/dist/components/common/button/CloneButtonTable.js +11 -11
  11. package/dist/components/common/button/DeleteButtonTable.cjs +1 -1
  12. package/dist/components/common/button/DeleteButtonTable.js +29 -29
  13. package/dist/components/common/button/ExportButton.cjs +1 -1
  14. package/dist/components/common/button/ExportButton.js +17 -17
  15. package/dist/components/common/button/HideButtonTable.cjs +1 -1
  16. package/dist/components/common/button/HideButtonTable.js +35 -35
  17. package/dist/components/common/button/ImportButton.cjs +1 -1
  18. package/dist/components/common/button/ImportButton.js +28 -28
  19. package/dist/components/common/button/NewButton.cjs +1 -1
  20. package/dist/components/common/button/NewButton.js +14 -14
  21. package/dist/components/common/button/PrintButton.cjs +1 -1
  22. package/dist/components/common/button/PrintButton.js +14 -14
  23. package/dist/components/common/button/RefreshButton.cjs +1 -1
  24. package/dist/components/common/button/RefreshButton.js +16 -16
  25. package/dist/components/common/button/UnHideButton.cjs +1 -1
  26. package/dist/components/common/button/UnHideButton.js +37 -37
  27. package/dist/components/common/button/UpdateButtonTable.cjs +1 -1
  28. package/dist/components/common/button/UpdateButtonTable.js +11 -11
  29. package/dist/components/common/button/ViewButtonTable.cjs +1 -1
  30. package/dist/components/common/button/ViewButtonTable.js +10 -10
  31. package/dist/components/common/check-box/CheckBox.cjs +1 -1
  32. package/dist/components/common/check-box/CheckBox.js +20 -20
  33. package/dist/components/common/description/DescList.cjs +1 -1
  34. package/dist/components/common/description/DescList.js +9 -9
  35. package/dist/components/common/layout/VerticalSpace.cjs +1 -1
  36. package/dist/components/common/layout/VerticalSpace.js +3 -3
  37. package/dist/components/common/loading/LoadingIndicator.cjs +1 -1
  38. package/dist/components/common/loading/LoadingIndicator.js +12 -12
  39. package/dist/components/common/picker/ImagePicker.cjs +1 -1
  40. package/dist/components/common/picker/ImagePicker.js +173 -176
  41. package/dist/components/common/radio/RadioGroupComponent.cjs +1 -1
  42. package/dist/components/common/radio/RadioGroupComponent.js +6 -6
  43. package/dist/components/common/report/SelectFieldInReport.cjs +1 -1
  44. package/dist/components/common/report/SelectFieldInReport.js +11 -11
  45. package/dist/components/common/select/CustomSelectOption.cjs +1 -1
  46. package/dist/components/common/select/CustomSelectOption.js +7 -7
  47. package/dist/components/common/select/SelectComponent.cjs +1 -1
  48. package/dist/components/common/select/SelectComponent.js +36 -36
  49. package/dist/components/common/show-more/index.cjs +1 -1
  50. package/dist/components/common/show-more/index.js +5 -5
  51. package/dist/components/common/tab/TabViewWithRoute.cjs +1 -1
  52. package/dist/components/common/tab/TabViewWithRoute.js +23 -22
  53. package/dist/components/common/table/table.cjs +1 -1
  54. package/dist/components/common/table/table.js +12 -12
  55. package/dist/components/common/tag/StatusTag.cjs +1 -1
  56. package/dist/components/common/tag/StatusTag.js +13 -13
  57. package/dist/components/common/text-field/NumberField.cjs +1 -1
  58. package/dist/components/common/text-field/NumberField.js +43 -43
  59. package/dist/components/common/text-field/PhoneNumberField.cjs +1 -1
  60. package/dist/components/common/text-field/PhoneNumberField.js +4 -4
  61. package/dist/components/common/text-field/TextArea.cjs +1 -1
  62. package/dist/components/common/text-field/TextArea.js +20 -20
  63. package/dist/components/common/text-field/TextField.cjs +1 -1
  64. package/dist/components/common/text-field/TextField.js +47 -47
  65. package/dist/components/common/tooltip/TooltipComponent.cjs +1 -1
  66. package/dist/components/common/tooltip/TooltipComponent.js +3 -3
  67. package/dist/components/common/wizard/WizardResult.cjs +1 -1
  68. package/dist/components/common/wizard/WizardResult.js +37 -38
  69. package/dist/components/common/wizard/WizardViewForm.cjs +1 -1
  70. package/dist/components/common/wizard/WizardViewForm.js +43 -43
  71. package/dist/components/crud/CrudComponent.cjs +1 -1
  72. package/dist/components/crud/CrudComponent.js +130 -130
  73. package/dist/components/crud/CrudField.cjs +1 -1
  74. package/dist/components/crud/CrudField.js +217 -217
  75. package/dist/components/crud/CrudForm.cjs +1 -1
  76. package/dist/components/crud/CrudForm.js +55 -55
  77. package/dist/components/crud/CrudFormWizard.cjs +1 -1
  78. package/dist/components/crud/CrudFormWizard.js +82 -84
  79. package/dist/components/crud/CrudReportComponent.cjs +3 -3
  80. package/dist/components/crud/CrudReportComponent.js +123 -123
  81. package/dist/components/crud/CrudSearchComponent.cjs +1 -1
  82. package/dist/components/crud/CrudSearchComponent.js +43 -43
  83. package/dist/components/crud/FileCrudField.cjs +1 -1
  84. package/dist/components/crud/FileCrudField.js +118 -125
  85. package/dist/components/crud/ImageCrudField.cjs +1 -1
  86. package/dist/components/crud/ImageCrudField.js +56 -56
  87. package/dist/components/crud/import/CrudImportButton.cjs +1 -1
  88. package/dist/components/crud/import/CrudImportButton.js +18 -18
  89. package/dist/components/crud/import/CrudImportComponent.cjs +2 -2
  90. package/dist/components/crud/import/CrudImportComponent.js +108 -109
  91. package/dist/components/crud/view/CrudDecListView.cjs +1 -1
  92. package/dist/components/crud/view/CrudDecListView.js +22 -22
  93. package/dist/components/crud/view/CrudViewer.cjs +1 -1
  94. package/dist/components/crud/view/CrudViewer.js +152 -152
  95. package/dist/components/crud/view/CrudViewerUtil.cjs +1 -1
  96. package/dist/components/crud/view/CrudViewerUtil.js +33 -34
  97. package/dist/locale/index.cjs +1 -1
  98. package/dist/locale/index.js +2 -2
  99. package/dist/util/DateUtil.cjs +1 -1
  100. package/dist/util/DateUtil.js +4 -4
  101. package/dist/util/ImageUtil.cjs +1 -1
  102. package/dist/util/ImageUtil.js +1 -1
  103. package/dist/util/ValidationUtil.cjs +1 -1
  104. package/dist/util/ValidationUtil.js +1 -1
  105. package/package.json +1 -1
@@ -1,16 +1,16 @@
1
- import { j as i } from "../../../_virtual/jsx-runtime.js";
2
- import { Descriptions as s } from "antd";
3
- import { useMemo as a } from "react";
4
- import c from "../../../util/NumberUtil.js";
5
- const u = s.Item, j = ({ list: t, keepEmptyValues: e, ...n }) => {
6
- const m = a(() => {
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { Descriptions as n } from "antd";
3
+ import { useMemo as c } from "react";
4
+ import a from "../../../util/NumberUtil.js";
5
+ const u = n.Item, h = ({ list: t, keepEmptyValues: e, ...m }) => {
6
+ const s = c(() => {
7
7
  const r = e ? t : t.filter((o) => o && !!o.value);
8
8
  return r.forEach((o) => {
9
- !o.noFormatting && !isNaN(o.value) && (o.value = c.toMoney(o.value));
9
+ !o.noFormatting && !isNaN(o.value) && (o.value = a.toMoney(o.value));
10
10
  }), r;
11
11
  }, [e, t]);
12
- return /* @__PURE__ */ i.jsx(s, { ...n, children: m.map(({ label: r, value: o }) => /* @__PURE__ */ i.jsx(u, { label: r, children: o }, r)) });
12
+ return /* @__PURE__ */ i(n, { ...m, children: s.map(({ label: r, value: o }) => /* @__PURE__ */ i(u, { label: r, children: o }, r)) });
13
13
  };
14
14
  export {
15
- j as default
15
+ h as default
16
16
  };
@@ -1 +1 @@
1
- "use strict";const r=require("../../../_virtual/jsx-runtime.cjs"),s=require("antd"),c=({children:e,className:t=""})=>r.jsxRuntimeExports.jsx(s.Space,{direction:"vertical",className:[t,"w-100"].join(" "),children:e});module.exports=c;
1
+ "use strict";const r=require("react/jsx-runtime"),c=require("antd"),s=({children:e,className:t=""})=>r.jsx(c.Space,{direction:"vertical",className:[t,"w-100"].join(" "),children:e});module.exports=s;
@@ -1,6 +1,6 @@
1
- import { j as e } from "../../../_virtual/jsx-runtime.js";
1
+ import { jsx as t } from "react/jsx-runtime";
2
2
  import { Space as a } from "antd";
3
- const s = ({ children: r, className: t = "" }) => /* @__PURE__ */ e.jsx(a, { direction: "vertical", className: [t, "w-100"].join(" "), children: r });
3
+ const i = ({ children: r, className: e = "" }) => /* @__PURE__ */ t(a, { direction: "vertical", className: [e, "w-100"].join(" "), children: r });
4
4
  export {
5
- s as default
5
+ i as default
6
6
  };
@@ -1 +1 @@
1
- "use strict";const t=require("../../../_virtual/jsx-runtime.cjs"),e=require("antd"),a=require("../button/Button.cjs"),i=require("../../../locale/hooks/translation-constants.cjs"),u=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),c=({loading:r,children:n,error:o})=>{const{t:s}=u.useTranslation(i.TRANSLATION_NAMESPACE);return t.jsxRuntimeExports.jsx(e.Skeleton,{loading:r,paragraph:!0,className:"h-100",children:o?t.jsxRuntimeExports.jsx(e.Result,{status:"404",title:404,subTitle:s("err.notFound"),className:"",extra:t.jsxRuntimeExports.jsx(a,{to:-1,type:"primary",children:s("str.goBack")})}):n})};module.exports=c;
1
+ "use strict";const t=require("react/jsx-runtime"),r=require("antd"),o=require("react-i18next"),i=require("../button/Button.cjs"),c=require("../../../locale/hooks/translation-constants.cjs"),u=({loading:s,children:n,error:a})=>{const{t:e}=o.useTranslation(c.TRANSLATION_NAMESPACE);return t.jsx(r.Skeleton,{loading:s,paragraph:!0,className:"h-100",children:a?t.jsx(r.Result,{status:"404",title:404,subTitle:e("err.notFound"),className:"",extra:t.jsx(i,{to:-1,type:"primary",children:e("str.goBack")})}):n})};module.exports=u;
@@ -1,24 +1,24 @@
1
- import { j as t } from "../../../_virtual/jsx-runtime.js";
2
- import { Skeleton as a, Result as n } from "antd";
3
- import m from "../button/Button.js";
4
- import { TRANSLATION_NAMESPACE as i } from "../../../locale/hooks/translation-constants.js";
5
- import { useTranslation as p } from "../../../node_modules/react-i18next/dist/es/useTranslation.js";
6
- const f = ({ loading: o, children: s, error: e }) => {
7
- const { t: r } = p(i);
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { Skeleton as n, Result as s } from "antd";
3
+ import { useTranslation as m } from "react-i18next";
4
+ import i from "../button/Button.js";
5
+ import { TRANSLATION_NAMESPACE as p } from "../../../locale/hooks/translation-constants.js";
6
+ const N = ({ loading: o, children: e, error: a }) => {
7
+ const { t: r } = m(p);
8
8
  return (
9
9
  // <Spin spinning={loading} className="h-100">
10
- /* @__PURE__ */ t.jsx(a, { loading: o, paragraph: !0, className: "h-100", children: e ? /* @__PURE__ */ t.jsx(
11
- n,
10
+ /* @__PURE__ */ t(n, { loading: o, paragraph: !0, className: "h-100", children: a ? /* @__PURE__ */ t(
11
+ s,
12
12
  {
13
13
  status: "404",
14
14
  title: 404,
15
15
  subTitle: r("err.notFound"),
16
16
  className: "",
17
- extra: /* @__PURE__ */ t.jsx(m, { to: -1, type: "primary", children: r("str.goBack") })
17
+ extra: /* @__PURE__ */ t(i, { to: -1, type: "primary", children: r("str.goBack") })
18
18
  }
19
- ) : s })
19
+ ) : e })
20
20
  );
21
21
  };
22
22
  export {
23
- f as default
23
+ N as default
24
24
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../../_virtual/jsx-runtime.cjs");;/* empty css */;/* empty css */const O=require("antd"),s=require("react"),fe=require("../../../node_modules/react-cropper/dist/react-cropper.es.cjs"),ge=require("../../../locale/hooks/translation-constants.cjs"),P=require("../button/Button.cjs"),Re=require("../../../util/ImageUtil.cjs"),he=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),Ee=require("../../../node_modules/@ant-design/icons/es/icons/RotateLeftOutlined.cjs"),we=require("../../../node_modules/@ant-design/icons/es/icons/RotateRightOutlined.cjs"),X=require("../../../node_modules/@ant-design/icons/es/icons/UploadOutlined.cjs"),Ce=require("../../../node_modules/@ant-design/icons/es/icons/LoadingOutlined.cjs"),ve=O.Form.Item;function Q(r){return new Promise((u,x)=>{const n=new FileReader;n.readAsDataURL(r),n.onload=()=>u(n.result),n.onerror=p=>x(p)})}const be=({values:r=[],required:u,buttonType:x,label:n,name:p,onChange:m,aspectRatio:U,buttonTitle:R,hidePreview:h,buttonSize:j="large",showButtonText:f=!0,showOnlyIcon:A=!1,icon:v=t.jsxRuntimeExports.jsx(X,{}),loading:b,maxCount:E=1,onAdd:l,onRemove:S,listType:y,..._})=>{const[Z,ee]=s.useState(""),[te,se]=s.useState(""),[re,D]=s.useState(!1),I=s.useRef(),i=s.useRef(),[a,F]=s.useState([]),[g,N]=s.useState(),ne=s.useRef(),oe=()=>D(!1),ie=async e=>{!e.url&&!e.preview&&(e.preview=await Q(e.originFileObj)),se(e.url||e.preview),D(!0),ee(e.name)},[z,q]=s.useState(!1),ae=()=>{},B=e=>{var o;(o=i==null?void 0:i.current)==null||o.cropper.rotate(e?-90:90)};s.useEffect(()=>{m==null||m(a[0],a)},[a,m]);const ce=()=>{var C;const e=(C=i==null?void 0:i.current)==null?void 0:C.cropper.getCroppedCanvas(),{type:o,size:c,name:d,uid:w}=I.current;q(!0),e==null||e.toBlob(async me=>{const je=Object.assign(new File([me],d,{type:o}),{uid:w}),H=await Re.resizeImage(je),G=await Q(H),K={url:G,name:d,uid:w,type:o,size:c,thumbUrl:G,originFileObj:H};if(l)try{q(!0),await l(K)}finally{q(!1)}F([K,...a]),q(!1)}),N(void 0)},le=()=>{N(void 0),I.current=void 0},T=s.useCallback(e=>{const o=e;if(o){I.current=o;const c=new FileReader;c.addEventListener("load",()=>{var d;if(typeof c.result=="string"){N(c.result);const w=localStorage.getItem("cropper.box"),C=w?JSON.parse(w):void 0;C&&((d=i==null?void 0:i.current)==null||d.cropper.setCropBoxData(C)),setTimeout(()=>{$()},100)}}),c.readAsDataURL(o)}},[]);s.useEffect(()=>{if(r!=null&&r.length||typeof r=="string"){const e=Array.isArray(r)?r.map(o=>[{uid:r,url:o}]):[{uid:r,url:r}];F(e)}},[r]);const{t:M}=he.useTranslation(ge.TRANSLATION_NAMESPACE),ue=s.useMemo(()=>u?{required:u,validator:(e,o,c)=>{g||a!=null&&a.length?c():c(`${n??""} ${M("err.validation.required")}`)}}:void 0,[u,g,a==null?void 0:a.length,n,M]),L=R??M("message.fileUploadMessage2"),J=s.useMemo(()=>t.jsxRuntimeExports.jsx(Y,{showLoadingIndicator:z,_buttonTitle:L,buttonSize:j,buttonType:x,fileList:a,hidePreview:h,icon:v,loading:b,listType:y,maxCount:E,onChangeFile:T,onRemove:S,showButtonText:f,handlePreview:ie,setFileList:F}),[z,L,j,x,a,h,v,b,y,E,T,S,f]);ne.current=J.props.beforeUpload;const[de,V]=s.useState(0),[xe,W]=s.useState(0),[k,pe]=s.useState();s.useEffect(()=>{const e=setTimeout(()=>{k&&localStorage.setItem("cropper.box",JSON.stringify(k))},400);return()=>clearTimeout(e)},[k]),s.useEffect(()=>{g||(V(0),W(0))},[g]);const $=s.useCallback(async()=>{var o;const e=(o=i==null?void 0:i.current)==null?void 0:o.cropper;if(e){const{width:c,height:d}=e.getCroppedCanvas();pe(e.getCropBoxData()),V(c),W(d)}},[]);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(ve,{label:n,..._,name:p,className:"mb-0",rules:[ue,..._.rules??[]],children:J}),t.jsxRuntimeExports.jsxs(O.Modal,{open:!!g,maskClosable:!1,onOk:ce,closable:!1,onCancel:le,children:[t.jsxRuntimeExports.jsx(fe.Cropper,{ref:i,src:g,cropmove:$,viewMode:1,aspectRatio:U,cropend:()=>ae()}),t.jsxRuntimeExports.jsx("p",{className:"text-center",children:[de,xe].join(" ⨉ ")}),t.jsxRuntimeExports.jsxs("div",{className:"mt-2 d-flex justify-content-center",children:[t.jsxRuntimeExports.jsx(P,{size:"large",icon:t.jsxRuntimeExports.jsx(Ee,{}),onClick:()=>B(!0)}),t.jsxRuntimeExports.jsx(P,{size:"large",icon:t.jsxRuntimeExports.jsx(we,{}),onClick:()=>B(!1)})]})]}),t.jsxRuntimeExports.jsx(O.Modal,{open:re,title:Z,footer:null,onCancel:oe,children:t.jsxRuntimeExports.jsx("div",{className:"text-center",children:t.jsxRuntimeExports.jsx("img",{alt:"example",style:{maxWidth:"400px"},src:te})})})]})},Y=({_buttonTitle:r,buttonSize:u,buttonType:x,fileList:n,hidePreview:p,icon:m,loading:U,maxCount:R,onChangeFile:h,onRemove:j,showButtonText:f,handlePreview:A,setFileList:v,showLoadingIndicator:b,listType:E="picture"})=>t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs(O.Upload,{accept:"image/x-png,image/gif,image/jpeg",fileList:n,defaultFileList:n,onChange:()=>{},className:(n.length>=R?" hide-upload ":"")+" mb-0",multiple:!1,onPreview:p?void 0:A,onDrop:l=>(h(l.dataTransfer.files.item(0)),!1),listType:E,showUploadList:!p,onRemove:l=>{const S=n.filter(y=>l.uid!==y.uid);j==null||j(l),v(S)},beforeUpload:async l=>(h(l),!1),maxCount:R,children:[b&&t.jsxRuntimeExports.jsx(Ce,{}),t.jsxRuntimeExports.jsx("div",{className:"d-flex flex-column",children:n.length<R&&(E==="picture-circle"?t.jsxRuntimeExports.jsx(X,{}):t.jsxRuntimeExports.jsx(P,{loading:U,tooltip:f?void 0:r,size:u,icon:m,type:f?x:"text",children:f?r:void 0}))})]},n.length)});exports.UploadComponent=Y;exports.default=be;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime");;/* empty css */;/* empty css */const S=require("@ant-design/icons"),F=require("antd"),s=require("react"),xe=require("react-cropper"),he=require("react-i18next"),je=require("../../../locale/hooks/translation-constants.cjs"),E=require("../button/Button.cjs"),we=require("../../../util/ImageUtil.cjs"),Ce=F.Form.Item;function X(r){return new Promise((d,p)=>{const n=new FileReader;n.readAsDataURL(r),n.onload=()=>d(n.result),n.onerror=f=>p(f)})}const ve=({values:r=[],required:d,buttonType:p,label:n,name:f,onChange:m,aspectRatio:N,buttonTitle:j,hidePreview:w,buttonSize:g="large",showButtonText:x=!0,showOnlyIcon:D=!1,icon:y=t.jsx(S.UploadOutlined,{}),loading:O,maxCount:C=1,onAdd:l,onRemove:U,listType:I,..._})=>{const[Z,ee]=s.useState(""),[te,se]=s.useState(""),[re,z]=s.useState(!1),q=s.useRef(),a=s.useRef(),[i,M]=s.useState([]),[h,k]=s.useState(),ne=s.useRef(),oe=()=>z(!1),ae=async e=>{!e.url&&!e.preview&&(e.preview=await X(e.originFileObj)),se(e.url||e.preview),z(!0),ee(e.name)},[B,R]=s.useState(!1),ie=()=>{},T=e=>{var o;(o=a==null?void 0:a.current)==null||o.cropper.rotate(e?-90:90)};s.useEffect(()=>{m==null||m(i[0],i)},[i,m]);const ce=()=>{var b;const e=(b=a==null?void 0:a.current)==null?void 0:b.cropper.getCroppedCanvas(),{type:o,size:c,name:u,uid:v}=q.current;R(!0),e==null||e.toBlob(async me=>{const ge=Object.assign(new File([me],u,{type:o}),{uid:v}),G=await we.resizeImage(ge),K=await X(G),Q={url:K,name:u,uid:v,type:o,size:c,thumbUrl:K,originFileObj:G};if(l)try{R(!0),await l(Q)}finally{R(!1)}M([Q,...i]),R(!1)}),k(void 0)},le=()=>{k(void 0),q.current=void 0},L=s.useCallback(e=>{const o=e;if(o){q.current=o;const c=new FileReader;c.addEventListener("load",()=>{var u;if(typeof c.result=="string"){k(c.result);const v=localStorage.getItem("cropper.box"),b=v?JSON.parse(v):void 0;b&&((u=a==null?void 0:a.current)==null||u.cropper.setCropBoxData(b)),setTimeout(()=>{H()},100)}}),c.readAsDataURL(o)}},[]);s.useEffect(()=>{if(r!=null&&r.length||typeof r=="string"){const e=Array.isArray(r)?r.map(o=>[{uid:r,url:o}]):[{uid:r,url:r}];M(e)}},[r]);const{t:P}=he.useTranslation(je.TRANSLATION_NAMESPACE),de=s.useMemo(()=>d?{required:d,validator:(e,o,c)=>{h||i!=null&&i.length?c():c(`${n??""} ${P("err.validation.required")}`)}}:void 0,[d,h,i==null?void 0:i.length,n,P]),J=j??P("message.fileUploadMessage2"),V=s.useMemo(()=>t.jsx(Y,{showLoadingIndicator:B,_buttonTitle:J,buttonSize:g,buttonType:p,fileList:i,hidePreview:w,icon:y,loading:O,listType:I,maxCount:C,onChangeFile:L,onRemove:U,showButtonText:x,handlePreview:ae,setFileList:M}),[B,J,g,p,i,w,y,O,I,C,L,U,x]);ne.current=V.props.beforeUpload;const[ue,W]=s.useState(0),[pe,$]=s.useState(0),[A,fe]=s.useState();s.useEffect(()=>{const e=setTimeout(()=>{A&&localStorage.setItem("cropper.box",JSON.stringify(A))},400);return()=>clearTimeout(e)},[A]),s.useEffect(()=>{h||(W(0),$(0))},[h]);const H=s.useCallback(async()=>{var o;const e=(o=a==null?void 0:a.current)==null?void 0:o.cropper;if(e){const{width:c,height:u}=e.getCroppedCanvas();fe(e.getCropBoxData()),W(c),$(u)}},[]);return t.jsxs(t.Fragment,{children:[t.jsx(Ce,{label:n,..._,name:f,className:"mb-0",rules:[de,..._.rules??[]],children:V}),t.jsxs(F.Modal,{open:!!h,maskClosable:!1,onOk:ce,closable:!1,onCancel:le,children:[t.jsx(xe.Cropper,{ref:a,src:h,cropmove:H,viewMode:1,aspectRatio:N,cropend:()=>ie()}),t.jsx("p",{className:"text-center",children:[ue,pe].join(" ⨉ ")}),t.jsxs("div",{className:"mt-2 d-flex justify-content-center",children:[t.jsx(E,{size:"large",icon:t.jsx(S.RotateLeftOutlined,{}),onClick:()=>T(!0)}),t.jsx(E,{size:"large",icon:t.jsx(S.RotateRightOutlined,{}),onClick:()=>T(!1)})]})]}),t.jsx(F.Modal,{open:re,title:Z,footer:null,onCancel:oe,children:t.jsx("div",{className:"text-center",children:t.jsx("img",{alt:"example",style:{maxWidth:"400px"},src:te})})})]})},Y=({_buttonTitle:r,buttonSize:d,buttonType:p,fileList:n,hidePreview:f,icon:m,loading:N,maxCount:j,onChangeFile:w,onRemove:g,showButtonText:x,handlePreview:D,setFileList:y,showLoadingIndicator:O,listType:C="picture"})=>t.jsx(t.Fragment,{children:t.jsxs(F.Upload,{accept:"image/x-png,image/gif,image/jpeg",fileList:n,defaultFileList:n,onChange:()=>{},className:(n.length>=j?" hide-upload ":"")+" mb-0",multiple:!1,onPreview:f?void 0:D,onDrop:l=>(w(l.dataTransfer.files.item(0)),!1),listType:C,showUploadList:!f,onRemove:l=>{const U=n.filter(I=>l.uid!==I.uid);g==null||g(l),y(U)},beforeUpload:async l=>(w(l),!1),maxCount:j,children:[O&&t.jsx(S.LoadingOutlined,{}),t.jsx("div",{className:"d-flex flex-column",children:n.length<j&&(C==="picture-circle"?t.jsx(S.UploadOutlined,{}):t.jsx(E,{loading:N,tooltip:x?void 0:r,size:d,icon:m,type:x?p:"text",children:x?r:void 0}))})]},n.length)});exports.UploadComponent=Y;exports.default=ve;
@@ -1,277 +1,274 @@
1
- import { j as t } from "../../../_virtual/jsx-runtime.js";
1
+ import { jsx as t, jsxs as S, Fragment as oe } from "react/jsx-runtime";
2
2
  /* empty css */
3
3
  /* empty css */
4
- import { Form as Ce, Modal as Z, Upload as ve } from "antd";
5
- import M, { useRef as _, useState as h, useEffect as U, useCallback as q, useMemo as ee } from "react";
6
- import { Cropper as Ie } from "../../../node_modules/react-cropper/dist/react-cropper.es.js";
7
- import { TRANSLATION_NAMESPACE as be } from "../../../locale/hooks/translation-constants.js";
8
- import z from "../button/Button.js";
9
- import ye from "../../../util/ImageUtil.js";
10
- import { useTranslation as Re } from "../../../node_modules/react-i18next/dist/es/useTranslation.js";
11
- import Fe from "../../../node_modules/@ant-design/icons/es/icons/RotateLeftOutlined.js";
12
- import Ne from "../../../node_modules/@ant-design/icons/es/icons/RotateRightOutlined.js";
13
- import re from "../../../node_modules/@ant-design/icons/es/icons/UploadOutlined.js";
14
- import Ue from "../../../node_modules/@ant-design/icons/es/icons/LoadingOutlined.js";
15
- const Se = Ce.Item;
16
- function te(r) {
17
- return new Promise((l, m) => {
4
+ import { RotateLeftOutlined as ye, RotateRightOutlined as Ie, UploadOutlined as ne, LoadingOutlined as Oe } from "@ant-design/icons";
5
+ import { Form as Ue, Modal as q, Upload as Ne } from "antd";
6
+ import z, { useRef as B, useState as w, useEffect as R, useCallback as ee, useMemo as te } from "react";
7
+ import { Cropper as Fe } from "react-cropper";
8
+ import { useTranslation as Re } from "react-i18next";
9
+ import { TRANSLATION_NAMESPACE as Se } from "../../../locale/hooks/translation-constants.js";
10
+ import E from "../button/Button.js";
11
+ import je from "../../../util/ImageUtil.js";
12
+ const ke = Ue.Item;
13
+ function re(r) {
14
+ return new Promise((l, p) => {
18
15
  const o = new FileReader();
19
- o.readAsDataURL(r), o.onload = () => l(o.result), o.onerror = (p) => m(p);
16
+ o.readAsDataURL(r), o.onload = () => l(o.result), o.onerror = (m) => p(m);
20
17
  });
21
18
  }
22
- const He = ({
19
+ const We = ({
23
20
  values: r = [],
24
21
  required: l,
25
- buttonType: m,
22
+ buttonType: p,
26
23
  label: o,
27
- name: p,
24
+ name: m,
28
25
  onChange: f,
29
- aspectRatio: S,
30
- buttonTitle: j,
31
- hidePreview: w,
26
+ aspectRatio: j,
27
+ buttonTitle: C,
28
+ hidePreview: v,
32
29
  buttonSize: u = "large",
33
30
  showButtonText: g = !0,
34
- showOnlyIcon: B = !1,
35
- icon: b = /* @__PURE__ */ t.jsx(re, {}),
36
- loading: y,
37
- maxCount: C = 1,
31
+ showOnlyIcon: _ = !1,
32
+ icon: I = /* @__PURE__ */ t(ne, {}),
33
+ loading: O,
34
+ maxCount: b = 1,
38
35
  onAdd: c,
39
- onRemove: R,
40
- listType: F,
41
- ...E
36
+ onRemove: U,
37
+ listType: N,
38
+ ...L
42
39
  }) => {
43
- const [oe, se] = M.useState(""), [ne, ie] = M.useState(""), [ae, $] = M.useState(!1), O = _(), n = _(), [i, k] = h([]), [x, A] = h(), ce = _(), le = () => $(!1), de = async (e) => {
44
- !e.url && !e.preview && (e.preview = await te(e.originFileObj)), ie(e.url || e.preview), $(!0), se(e.name);
45
- }, [T, N] = h(!1), me = () => {
46
- }, J = (e) => {
47
- var s;
48
- (s = n == null ? void 0 : n.current) == null || s.cropper.rotate(e ? -90 : 90);
40
+ const [ie, ae] = z.useState(""), [se, ce] = z.useState(""), [le, T] = z.useState(!1), k = B(), i = B(), [a, A] = w([]), [h, P] = w(), de = B(), pe = () => T(!1), me = async (e) => {
41
+ !e.url && !e.preview && (e.preview = await re(e.originFileObj)), ce(e.url || e.preview), T(!0), ae(e.name);
42
+ }, [J, F] = w(!1), fe = () => {
43
+ }, V = (e) => {
44
+ var n;
45
+ (n = i == null ? void 0 : i.current) == null || n.cropper.rotate(e ? -90 : 90);
49
46
  };
50
- U(() => {
51
- f == null || f(i[0], i);
52
- }, [i, f]);
53
- const pe = () => {
54
- var I;
55
- const e = (I = n == null ? void 0 : n.current) == null ? void 0 : I.cropper.getCroppedCanvas(), { type: s, size: a, name: d, uid: v } = O.current;
56
- N(!0), e == null || e.toBlob(async (je) => {
57
- const we = Object.assign(new File([je], d, { type: s }), {
58
- uid: v
59
- }), Q = await ye.resizeImage(we), X = await te(Q), Y = {
60
- url: X,
47
+ R(() => {
48
+ f == null || f(a[0], a);
49
+ }, [a, f]);
50
+ const ue = () => {
51
+ var y;
52
+ const e = (y = i == null ? void 0 : i.current) == null ? void 0 : y.cropper.getCroppedCanvas(), { type: n, size: s, name: d, uid: x } = k.current;
53
+ F(!0), e == null || e.toBlob(async (be) => {
54
+ const xe = Object.assign(new File([be], d, { type: n }), {
55
+ uid: x
56
+ }), X = await je.resizeImage(xe), Y = await re(X), Z = {
57
+ url: Y,
61
58
  name: d,
62
- uid: v,
63
- type: s,
64
- size: a,
65
- thumbUrl: X,
66
- originFileObj: Q
59
+ uid: x,
60
+ type: n,
61
+ size: s,
62
+ thumbUrl: Y,
63
+ originFileObj: X
67
64
  };
68
65
  if (c)
69
66
  try {
70
- N(!0), await c(Y);
67
+ F(!0), await c(Z);
71
68
  } finally {
72
- N(!1);
69
+ F(!1);
73
70
  }
74
- k([Y, ...i]), N(!1);
75
- }), A(void 0);
76
- }, fe = () => {
77
- A(void 0), O.current = void 0;
78
- }, V = q((e) => {
79
- const s = e;
80
- if (s) {
81
- O.current = s;
82
- const a = new FileReader();
83
- a.addEventListener("load", () => {
71
+ A([Z, ...a]), F(!1);
72
+ }), P(void 0);
73
+ }, ge = () => {
74
+ P(void 0), k.current = void 0;
75
+ }, W = ee((e) => {
76
+ const n = e;
77
+ if (n) {
78
+ k.current = n;
79
+ const s = new FileReader();
80
+ s.addEventListener("load", () => {
84
81
  var d;
85
- if (typeof a.result == "string") {
86
- A(a.result);
87
- const v = localStorage.getItem("cropper.box"), I = v ? JSON.parse(v) : void 0;
88
- I && ((d = n == null ? void 0 : n.current) == null || d.cropper.setCropBoxData(I)), setTimeout(() => {
89
- K();
82
+ if (typeof s.result == "string") {
83
+ P(s.result);
84
+ const x = localStorage.getItem("cropper.box"), y = x ? JSON.parse(x) : void 0;
85
+ y && ((d = i == null ? void 0 : i.current) == null || d.cropper.setCropBoxData(y)), setTimeout(() => {
86
+ Q();
90
87
  }, 100);
91
88
  }
92
- }), a.readAsDataURL(s);
89
+ }), s.readAsDataURL(n);
93
90
  }
94
91
  }, []);
95
- U(() => {
92
+ R(() => {
96
93
  if (r != null && r.length || typeof r == "string") {
97
- const e = Array.isArray(r) ? r.map((s) => [{ uid: r, url: s }]) : [{ uid: r, url: r }];
98
- k(e);
94
+ const e = Array.isArray(r) ? r.map((n) => [{ uid: r, url: n }]) : [{ uid: r, url: r }];
95
+ A(e);
99
96
  }
100
97
  }, [r]);
101
- const { t: P } = Re(be), ue = ee(
98
+ const { t: D } = Re(Se), he = te(
102
99
  () => l ? {
103
100
  required: l,
104
- validator: (e, s, a) => {
105
- x || i != null && i.length ? a() : a(`${o ?? ""} ${P("err.validation.required")}`);
101
+ validator: (e, n, s) => {
102
+ h || a != null && a.length ? s() : s(`${o ?? ""} ${D("err.validation.required")}`);
106
103
  }
107
104
  } : void 0,
108
- [l, x, i == null ? void 0 : i.length, o, P]
109
- ), W = j ?? P("message.fileUploadMessage2"), H = ee(
110
- () => /* @__PURE__ */ t.jsx(
111
- Oe,
105
+ [l, h, a == null ? void 0 : a.length, o, D]
106
+ ), $ = C ?? D("message.fileUploadMessage2"), H = te(
107
+ () => /* @__PURE__ */ t(
108
+ Ae,
112
109
  {
113
- showLoadingIndicator: T,
114
- _buttonTitle: W,
110
+ showLoadingIndicator: J,
111
+ _buttonTitle: $,
115
112
  buttonSize: u,
116
- buttonType: m,
117
- fileList: i,
118
- hidePreview: w,
119
- icon: b,
120
- loading: y,
121
- listType: F,
122
- maxCount: C,
123
- onChangeFile: V,
124
- onRemove: R,
113
+ buttonType: p,
114
+ fileList: a,
115
+ hidePreview: v,
116
+ icon: I,
117
+ loading: O,
118
+ listType: N,
119
+ maxCount: b,
120
+ onChangeFile: W,
121
+ onRemove: U,
125
122
  showButtonText: g,
126
- handlePreview: de,
127
- setFileList: k
123
+ handlePreview: me,
124
+ setFileList: A
128
125
  }
129
126
  ),
130
127
  [
131
- T,
132
- W,
128
+ J,
129
+ $,
133
130
  u,
134
- m,
135
- i,
136
- w,
131
+ p,
132
+ a,
133
+ v,
134
+ I,
135
+ O,
136
+ N,
137
137
  b,
138
- y,
139
- F,
140
- C,
141
- V,
142
- R,
138
+ W,
139
+ U,
143
140
  g
144
141
  ]
145
142
  );
146
- ce.current = H.props.beforeUpload;
147
- const [ge, L] = h(0), [xe, G] = h(0), [D, he] = h();
148
- U(() => {
143
+ de.current = H.props.beforeUpload;
144
+ const [we, G] = w(0), [Ce, K] = w(0), [M, ve] = w();
145
+ R(() => {
149
146
  const e = setTimeout(() => {
150
- D && localStorage.setItem("cropper.box", JSON.stringify(D));
147
+ M && localStorage.setItem("cropper.box", JSON.stringify(M));
151
148
  }, 400);
152
149
  return () => clearTimeout(e);
153
- }, [D]), U(() => {
154
- x || (L(0), G(0));
155
- }, [x]);
156
- const K = q(async () => {
157
- var s;
158
- const e = (s = n == null ? void 0 : n.current) == null ? void 0 : s.cropper;
150
+ }, [M]), R(() => {
151
+ h || (G(0), K(0));
152
+ }, [h]);
153
+ const Q = ee(async () => {
154
+ var n;
155
+ const e = (n = i == null ? void 0 : i.current) == null ? void 0 : n.cropper;
159
156
  if (e) {
160
- const { width: a, height: d } = e.getCroppedCanvas();
161
- he(e.getCropBoxData()), L(a), G(d);
157
+ const { width: s, height: d } = e.getCroppedCanvas();
158
+ ve(e.getCropBoxData()), G(s), K(d);
162
159
  }
163
160
  }, []);
164
- return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
165
- /* @__PURE__ */ t.jsx(
166
- Se,
161
+ return /* @__PURE__ */ S(oe, { children: [
162
+ /* @__PURE__ */ t(
163
+ ke,
167
164
  {
168
165
  label: o,
169
- ...E,
170
- name: p,
166
+ ...L,
167
+ name: m,
171
168
  className: "mb-0",
172
- rules: [ue, ...E.rules ?? []],
169
+ rules: [he, ...L.rules ?? []],
173
170
  children: H
174
171
  }
175
172
  ),
176
- /* @__PURE__ */ t.jsxs(
177
- Z,
173
+ /* @__PURE__ */ S(
174
+ q,
178
175
  {
179
- open: !!x,
176
+ open: !!h,
180
177
  maskClosable: !1,
181
- onOk: pe,
178
+ onOk: ue,
182
179
  closable: !1,
183
- onCancel: fe,
180
+ onCancel: ge,
184
181
  children: [
185
- /* @__PURE__ */ t.jsx(
186
- Ie,
182
+ /* @__PURE__ */ t(
183
+ Fe,
187
184
  {
188
- ref: n,
189
- src: x,
190
- cropmove: K,
185
+ ref: i,
186
+ src: h,
187
+ cropmove: Q,
191
188
  viewMode: 1,
192
- aspectRatio: S,
193
- cropend: () => me()
189
+ aspectRatio: j,
190
+ cropend: () => fe()
194
191
  }
195
192
  ),
196
- /* @__PURE__ */ t.jsx("p", { className: "text-center", children: [ge, xe].join(" ⨉ ") }),
197
- /* @__PURE__ */ t.jsxs("div", { className: "mt-2 d-flex justify-content-center", children: [
198
- /* @__PURE__ */ t.jsx(
199
- z,
193
+ /* @__PURE__ */ t("p", { className: "text-center", children: [we, Ce].join(" ⨉ ") }),
194
+ /* @__PURE__ */ S("div", { className: "mt-2 d-flex justify-content-center", children: [
195
+ /* @__PURE__ */ t(
196
+ E,
200
197
  {
201
198
  size: "large",
202
- icon: /* @__PURE__ */ t.jsx(Fe, {}),
203
- onClick: () => J(!0)
199
+ icon: /* @__PURE__ */ t(ye, {}),
200
+ onClick: () => V(!0)
204
201
  }
205
202
  ),
206
- /* @__PURE__ */ t.jsx(
207
- z,
203
+ /* @__PURE__ */ t(
204
+ E,
208
205
  {
209
206
  size: "large",
210
- icon: /* @__PURE__ */ t.jsx(Ne, {}),
211
- onClick: () => J(!1)
207
+ icon: /* @__PURE__ */ t(Ie, {}),
208
+ onClick: () => V(!1)
212
209
  }
213
210
  )
214
211
  ] })
215
212
  ]
216
213
  }
217
214
  ),
218
- /* @__PURE__ */ t.jsx(
219
- Z,
215
+ /* @__PURE__ */ t(
216
+ q,
220
217
  {
221
- open: ae,
222
- title: oe,
218
+ open: le,
219
+ title: ie,
223
220
  footer: null,
224
- onCancel: le,
225
- children: /* @__PURE__ */ t.jsx("div", { className: "text-center", children: /* @__PURE__ */ t.jsx("img", { alt: "example", style: { maxWidth: "400px" }, src: ne }) })
221
+ onCancel: pe,
222
+ children: /* @__PURE__ */ t("div", { className: "text-center", children: /* @__PURE__ */ t("img", { alt: "example", style: { maxWidth: "400px" }, src: se }) })
226
223
  }
227
224
  )
228
225
  ] });
229
- }, Oe = ({
226
+ }, Ae = ({
230
227
  _buttonTitle: r,
231
228
  buttonSize: l,
232
- buttonType: m,
229
+ buttonType: p,
233
230
  fileList: o,
234
- hidePreview: p,
231
+ hidePreview: m,
235
232
  icon: f,
236
- loading: S,
237
- maxCount: j,
238
- onChangeFile: w,
233
+ loading: j,
234
+ maxCount: C,
235
+ onChangeFile: v,
239
236
  onRemove: u,
240
237
  showButtonText: g,
241
- handlePreview: B,
242
- setFileList: b,
243
- showLoadingIndicator: y,
244
- listType: C = "picture"
245
- }) => /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs(
246
- ve,
238
+ handlePreview: _,
239
+ setFileList: I,
240
+ showLoadingIndicator: O,
241
+ listType: b = "picture"
242
+ }) => /* @__PURE__ */ t(oe, { children: /* @__PURE__ */ S(
243
+ Ne,
247
244
  {
248
245
  accept: "image/x-png,image/gif,image/jpeg",
249
246
  fileList: o,
250
247
  defaultFileList: o,
251
248
  onChange: () => {
252
249
  },
253
- className: (o.length >= j ? " hide-upload " : "") + " mb-0",
250
+ className: (o.length >= C ? " hide-upload " : "") + " mb-0",
254
251
  multiple: !1,
255
- onPreview: p ? void 0 : B,
256
- onDrop: (c) => (w(c.dataTransfer.files.item(0)), !1),
257
- listType: C,
258
- showUploadList: !p,
252
+ onPreview: m ? void 0 : _,
253
+ onDrop: (c) => (v(c.dataTransfer.files.item(0)), !1),
254
+ listType: b,
255
+ showUploadList: !m,
259
256
  onRemove: (c) => {
260
- const R = o.filter((F) => c.uid !== F.uid);
261
- u == null || u(c), b(R);
257
+ const U = o.filter((N) => c.uid !== N.uid);
258
+ u == null || u(c), I(U);
262
259
  },
263
- beforeUpload: async (c) => (w(c), !1),
264
- maxCount: j,
260
+ beforeUpload: async (c) => (v(c), !1),
261
+ maxCount: C,
265
262
  children: [
266
- y && /* @__PURE__ */ t.jsx(Ue, {}),
267
- /* @__PURE__ */ t.jsx("div", { className: "d-flex flex-column", children: o.length < j && (C === "picture-circle" ? /* @__PURE__ */ t.jsx(re, {}) : /* @__PURE__ */ t.jsx(
268
- z,
263
+ O && /* @__PURE__ */ t(Oe, {}),
264
+ /* @__PURE__ */ t("div", { className: "d-flex flex-column", children: o.length < C && (b === "picture-circle" ? /* @__PURE__ */ t(ne, {}) : /* @__PURE__ */ t(
265
+ E,
269
266
  {
270
- loading: S,
267
+ loading: j,
271
268
  tooltip: g ? void 0 : r,
272
269
  size: l,
273
270
  icon: f,
274
- type: g ? m : "text",
271
+ type: g ? p : "text",
275
272
  children: g ? r : void 0
276
273
  }
277
274
  )) })
@@ -280,6 +277,6 @@ const He = ({
280
277
  o.length
281
278
  ) });
282
279
  export {
283
- Oe as UploadComponent,
284
- He as default
280
+ Ae as UploadComponent,
281
+ We as default
285
282
  };
@@ -1 +1 @@
1
- "use strict";const s=require("../../../_virtual/jsx-runtime.cjs"),n=require("antd"),i=require("react"),l=({button:m,disabled:c,...t})=>{const a=i.useMemo(()=>{const{enum:e,translations:o}=t;if(e){const r=[];for(const u of e)r.push({key:u,value:(o==null?void 0:o[u])??u.toUpperCase()});return r}else return t.values},[t]),x=m?n.Radio.Button:n.Radio;return s.jsxRuntimeExports.jsx(n.Form.Item,{...t,children:s.jsxRuntimeExports.jsx(n.Radio.Group,{disabled:c,children:a.map(({key:e,value:o})=>s.jsxRuntimeExports.jsx(x,{value:e,children:o},e))})})},R=i.memo(l);module.exports=R;
1
+ "use strict";const s=require("react/jsx-runtime"),t=require("antd"),c=require("react"),d=({button:a,disabled:i,...n})=>{const m=c.useMemo(()=>{const{enum:e,translations:o}=n;if(e){const r=[];for(const u of e)r.push({key:u,value:(o==null?void 0:o[u])??u.toUpperCase()});return r}else return n.values},[n]),l=a?t.Radio.Button:t.Radio;return s.jsx(t.Form.Item,{...n,children:s.jsx(t.Radio.Group,{disabled:i,children:m.map(({key:e,value:o})=>s.jsx(l,{value:e,children:o},e))})})},R=c.memo(d);module.exports=R;
@@ -1,7 +1,7 @@
1
- import { j as u } from "../../../_virtual/jsx-runtime.js";
1
+ import { jsx as u } from "react/jsx-runtime";
2
2
  import { Radio as m, Form as i } from "antd";
3
3
  import { memo as p, useMemo as d } from "react";
4
- const f = ({ button: s, disabled: a, ...n }) => {
4
+ const f = ({ button: a, disabled: s, ...n }) => {
5
5
  const l = d(() => {
6
6
  const { enum: e, translations: o } = n;
7
7
  if (e) {
@@ -11,9 +11,9 @@ const f = ({ button: s, disabled: a, ...n }) => {
11
11
  return r;
12
12
  } else
13
13
  return n.values;
14
- }, [n]), c = s ? m.Button : m;
15
- return /* @__PURE__ */ u.jsx(i.Item, { ...n, children: /* @__PURE__ */ u.jsx(m.Group, { disabled: a, children: l.map(({ key: e, value: o }) => /* @__PURE__ */ u.jsx(c, { value: e, children: o }, e)) }) });
16
- }, h = p(f);
14
+ }, [n]), c = a ? m.Button : m;
15
+ return /* @__PURE__ */ u(i.Item, { ...n, children: /* @__PURE__ */ u(m.Group, { disabled: s, children: l.map(({ key: e, value: o }) => /* @__PURE__ */ u(c, { value: e, children: o }, e)) }) });
16
+ }, G = p(f);
17
17
  export {
18
- h as default
18
+ G as default
19
19
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../../_virtual/jsx-runtime.cjs"),o=require("antd"),u=require("react"),j=require("../select/SelectComponent.cjs"),F=({className:a,onSelect:d,label:p,required:S,name:s,mode:l,items:t})=>{const r=o.Form.useFormInstance(),[n,x]=u.useState(!0);return u.useEffect(()=>{if(t&&n){const e=t.filter(i=>i.alreadySelected).map(i=>i.id);r==null||r.setFieldsValue({[s]:l==="multiple"?e:e==null?void 0:e[0]}),x(!1)}},[n,r,t,l,s]),c.jsxRuntimeExports.jsx(j,{required:S,label:p,mode:l,className:a,name:s,onSelect:d,items:t,itemBuilder:e=>c.jsxRuntimeExports.jsx(o.Select.Option,{value:e.id,disabled:e.lock,children:e.label},e.id)})};exports.SelectFieldInReport=F;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("antd"),u=require("react"),f=require("../select/SelectComponent.cjs"),b=({className:a,onSelect:d,label:S,required:p,name:l,mode:c,items:t})=>{const r=o.Form.useFormInstance(),[s,F]=u.useState(!0);return u.useEffect(()=>{if(t&&s){const e=t.filter(i=>i.alreadySelected).map(i=>i.id);r==null||r.setFieldsValue({[l]:c==="multiple"?e:e==null?void 0:e[0]}),F(!1)}},[s,r,t,c,l]),n.jsx(f,{required:p,label:S,mode:c,className:a,name:l,onSelect:d,items:t,itemBuilder:e=>n.jsx(o.Select.Option,{value:e.id,disabled:e.lock,children:e.label},e.id)})};exports.SelectFieldInReport=b;