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