@kingteza/crud-component 1.0.5 → 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/ShowMoreText.cjs +1 -1
- package/dist/_virtual/advancedFormat.cjs +1 -1
- package/dist/_virtual/customParseFormat.cjs +1 -1
- package/dist/_virtual/dayjs.min.cjs +1 -1
- package/dist/_virtual/index.cjs +1 -1
- package/dist/_virtual/index10.cjs +1 -1
- package/dist/_virtual/index10.js +5 -2
- 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 -2
- package/dist/_virtual/index3.cjs +1 -1
- package/dist/_virtual/index3.js +5 -2
- package/dist/_virtual/index4.js +2 -2
- package/dist/_virtual/index5.cjs +1 -1
- package/dist/_virtual/index5.js +2 -5
- package/dist/_virtual/index6.cjs +1 -1
- package/dist/_virtual/index6.js +4 -2
- package/dist/_virtual/index7.cjs +1 -1
- package/dist/_virtual/index7.js +2 -5
- package/dist/_virtual/index8.cjs +1 -1
- package/dist/_virtual/index8.js +2 -7
- package/dist/_virtual/index9.cjs +1 -1
- package/dist/_virtual/index9.js +5 -2
- package/dist/_virtual/localeData.cjs +1 -1
- package/dist/_virtual/main.cjs +1 -1
- package/dist/_virtual/papaparse.min.cjs +1 -1
- 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/_virtual/weekOfYear.cjs +1 -1
- package/dist/_virtual/weekYear.cjs +1 -1
- package/dist/_virtual/weekday.cjs +1 -1
- package/dist/common/index.cjs +1 -1
- package/dist/index.cjs +1 -1
- 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 +13 -12
- package/dist/src/components/common/appearance/Hider.cjs +1 -1
- package/dist/src/components/common/button/Button.cjs +1 -1
- package/dist/src/components/common/button/Button.js +28 -27
- package/dist/src/components/common/button/CloneButtonTable.cjs +1 -1
- package/dist/src/components/common/button/CloneButtonTable.js +3 -3
- package/dist/src/components/common/button/DeleteButtonTable.cjs +1 -1
- package/dist/src/components/common/button/DeleteButtonTable.js +7 -7
- package/dist/src/components/common/button/ExportButton.cjs +1 -1
- package/dist/src/components/common/button/ExportButton.js +5 -5
- package/dist/src/components/common/button/HideButtonTable.cjs +1 -1
- package/dist/src/components/common/button/HideButtonTable.js +7 -7
- package/dist/src/components/common/button/ImportButton.cjs +1 -1
- package/dist/src/components/common/button/ImportButton.js +5 -5
- package/dist/src/components/common/button/NewButton.cjs +1 -1
- package/dist/src/components/common/button/NewButton.js +5 -5
- package/dist/src/components/common/button/PrintButton.cjs +1 -1
- package/dist/src/components/common/button/PrintButton.js +5 -5
- package/dist/src/components/common/button/RefreshButton.cjs +1 -1
- package/dist/src/components/common/button/RefreshButton.js +5 -5
- package/dist/src/components/common/button/UnHideButton.cjs +1 -1
- package/dist/src/components/common/button/UnHideButton.js +7 -7
- package/dist/src/components/common/button/UpdateButtonTable.cjs +1 -1
- package/dist/src/components/common/button/UpdateButtonTable.js +5 -5
- package/dist/src/components/common/button/ViewButtonTable.cjs +1 -1
- package/dist/src/components/common/button/ViewButtonTable.js +5 -5
- 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 +9 -8
- package/dist/src/components/common/picker/ImagePicker.cjs +1 -1
- package/dist/src/components/common/picker/ImagePicker.js +42 -40
- 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/tab/TabViewWithRoute.cjs +1 -1
- package/dist/src/components/common/tab/TabViewWithRoute.js +15 -14
- 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/PhoneNumberField.cjs +1 -1
- 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 +22 -21
- 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 +5 -5
- 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 +96 -93
- package/dist/src/components/crud/CrudForm.cjs +1 -1
- package/dist/src/components/crud/CrudForm.js +30 -27
- package/dist/src/components/crud/CrudFormWizard.cjs +1 -1
- package/dist/src/components/crud/CrudFormWizard.js +57 -54
- package/dist/src/components/crud/CrudReportComponent.cjs +3 -3
- package/dist/src/components/crud/CrudReportComponent.js +51 -47
- package/dist/src/components/crud/CrudSearchComponent.cjs +1 -1
- package/dist/src/components/crud/CrudSearchComponent.js +23 -21
- package/dist/src/components/crud/FileCrudField.cjs +1 -1
- package/dist/src/components/crud/FileCrudField.js +31 -29
- package/dist/src/components/crud/ImageCrudField.cjs +1 -1
- package/dist/src/components/crud/ImageCrudField.js +46 -43
- package/dist/src/components/crud/import/CrudImportButton.cjs +1 -1
- package/dist/src/components/crud/import/CrudImportButton.js +7 -7
- package/dist/src/components/crud/import/CrudImportComponent.cjs +2 -2
- package/dist/src/components/crud/import/CrudImportComponent.js +64 -60
- package/dist/src/components/crud/view/CrudDecListView.cjs +1 -1
- package/dist/src/components/crud/view/CrudDecListView.js +5 -5
- package/dist/src/components/crud/view/CrudViewer.cjs +1 -1
- package/dist/src/components/crud/view/CrudViewer.js +25 -25
- package/dist/src/components/crud/view/CrudViewerUtil.cjs +1 -1
- package/dist/src/components/crud/view/CrudViewerUtil.js +18 -17
- package/dist/src/context/WindowDimension.cjs +1 -1
- package/dist/src/locale/index.cjs +1 -1
- package/dist/src/locale/index.js +2 -2
- package/dist/src/locale/translations/en.cjs +1 -1
- package/dist/src/util/DateUtil.cjs +1 -1
- package/dist/src/util/DateUtil.js +4 -4
- package/dist/src/util/ImageUtil.cjs +1 -1
- package/dist/src/util/ValidationUtil.cjs +1 -1
- package/dist/src/util/ValidationUtil.js +1 -1
- package/dist/util/index.cjs +1 -1
- package/package.json +7 -9
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as t } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import {
|
|
3
|
-
import { useMemo as C, useState as T, useEffect as g, useCallback as A } from "react";
|
|
2
|
+
import { useMemo as j, useState as C, useEffect as T, useCallback as g } from "react";
|
|
4
3
|
import c from "./Button.js";
|
|
4
|
+
import { useTranslation as A } from "react-i18next";
|
|
5
5
|
import { TRANSLATION_NAMESPACE as E } from "../../../locale/hooks/translation-constants.js";
|
|
6
|
-
import { useTranslation as _ } from "../../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
7
6
|
import x from "../../../../node_modules/@ant-design/icons/es/icons/DeleteOutlined.js";
|
|
7
|
+
import _ from "../../../../node_modules/antd/es/popconfirm/index.js";
|
|
8
8
|
function I({
|
|
9
9
|
shouldConfirm: d = !0,
|
|
10
10
|
block: n,
|
|
@@ -15,11 +15,11 @@ function I({
|
|
|
15
15
|
disabled: f,
|
|
16
16
|
type: m = "link"
|
|
17
17
|
}) {
|
|
18
|
-
const { t: o } =
|
|
19
|
-
|
|
18
|
+
const { t: o } = A(E), e = j(() => l ?? o("str.delete"), [l, o]), [u, r] = C(!1);
|
|
19
|
+
T(() => {
|
|
20
20
|
r(i ?? !1);
|
|
21
21
|
}, [i]);
|
|
22
|
-
const p =
|
|
22
|
+
const p = g(
|
|
23
23
|
async () => {
|
|
24
24
|
try {
|
|
25
25
|
r(!0), await a(s);
|
|
@@ -30,7 +30,7 @@ function I({
|
|
|
30
30
|
[a, s]
|
|
31
31
|
);
|
|
32
32
|
return d ? /* @__PURE__ */ t.jsx(
|
|
33
|
-
|
|
33
|
+
_,
|
|
34
34
|
{
|
|
35
35
|
title: o("qus.doYouWantToDelete"),
|
|
36
36
|
okText: e.toUpperCase(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../../../_virtual/jsx-runtime.cjs"),s=require("react"),a=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../../../_virtual/jsx-runtime.cjs"),s=require("react"),a=require("react-i18next"),c=require("./Button.cjs"),l=require("../../../locale/hooks/translation-constants.cjs"),x=require("../../../../node_modules/@ant-design/icons/es/icons/ExportOutlined.cjs");function p({value:t,onClick:e}){const[r,n]=s.useState(!1),{t:i}=a.useTranslation(l.TRANSLATION_NAMESPACE),u=s.useCallback(async()=>{n(!0),e(t).finally(()=>n(!1))},[e,t]);return o.jsxRuntimeExports.jsx(c.default,{loading:r,type:"link",onClick:u,icon:o.jsxRuntimeExports.jsx(x.default,{}),tooltip:i("str.export")})}exports.ExportButton=p;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { j as n } from "../../../../_virtual/jsx-runtime.js";
|
|
2
2
|
import { useState as m, useCallback as p } from "react";
|
|
3
|
-
import a from "
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
3
|
+
import { useTranslation as a } from "react-i18next";
|
|
4
|
+
import f from "./Button.js";
|
|
5
|
+
import { TRANSLATION_NAMESPACE as c } from "../../../locale/hooks/translation-constants.js";
|
|
6
6
|
import l from "../../../../node_modules/@ant-design/icons/es/icons/ExportOutlined.js";
|
|
7
7
|
function y({
|
|
8
8
|
value: o,
|
|
9
9
|
onClick: t
|
|
10
10
|
}) {
|
|
11
|
-
const [s, r] = m(!1), { t: i } = c
|
|
11
|
+
const [s, r] = m(!1), { t: i } = a(c), e = p(async () => {
|
|
12
12
|
r(!0), t(o).finally(() => r(!1));
|
|
13
13
|
}, [t, o]);
|
|
14
14
|
return /* @__PURE__ */ n.jsx(
|
|
15
|
-
|
|
15
|
+
f,
|
|
16
16
|
{
|
|
17
17
|
loading: s,
|
|
18
18
|
type: "link",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";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"),n=require("react"),q=require("react-i18next"),C=require("../../../locale/hooks/translation-constants.cjs"),j=require("./Button.cjs"),p=require("../../../../node_modules/@ant-design/icons/es/icons/DownCircleOutlined.cjs"),E=require("../../../../node_modules/antd/es/popconfirm/index.cjs");function R({shouldConfirm:m=!0,block:r,value:u,loading:i,onClick:a,text:l,disabled:c,type:x="link"}){const{t:e}=q.useTranslation(C.TRANSLATION_NAMESPACE),s=n.useMemo(()=>l??e("str.hide"),[l,e]),[d,o]=n.useState(!1);n.useEffect(()=>{o(i??!1)},[i]);const f=n.useCallback(async()=>{try{o(!0),await a(u)}finally{o(!1)}},[a,u]);return m?t.jsxRuntimeExports.jsx(E.default,{title:e("qus.doYouWantToHide"),okText:s.toUpperCase(),cancelText:e("str.no").toUpperCase(),onConfirm:f,children:t.jsxRuntimeExports.jsx(j.default,{tooltip:s,icon:t.jsxRuntimeExports.jsx(p.default,{}),disabled:c,loading:d,type:x,danger:!0,block:r})}):t.jsxRuntimeExports.jsx(j.default,{tooltip:s,icon:t.jsxRuntimeExports.jsx(p.default,{}),disabled:c,loading:d,type:x,danger:!0,block:r,onClick:f})}exports.default=R;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as o } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useMemo as j, useState as C, useEffect as T, useCallback as g } from "react";
|
|
3
|
+
import { useTranslation as A } from "react-i18next";
|
|
4
4
|
import { TRANSLATION_NAMESPACE as E } from "../../../locale/hooks/translation-constants.js";
|
|
5
5
|
import c from "./Button.js";
|
|
6
|
-
import { useTranslation as _ } from "../../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
7
6
|
import x from "../../../../node_modules/@ant-design/icons/es/icons/DownCircleOutlined.js";
|
|
7
|
+
import _ from "../../../../node_modules/antd/es/popconfirm/index.js";
|
|
8
8
|
function H({
|
|
9
9
|
shouldConfirm: d = !0,
|
|
10
10
|
block: n,
|
|
@@ -15,11 +15,11 @@ function H({
|
|
|
15
15
|
disabled: m,
|
|
16
16
|
type: l = "link"
|
|
17
17
|
}) {
|
|
18
|
-
const { t } =
|
|
19
|
-
|
|
18
|
+
const { t } = A(E), r = j(() => f ?? t("str.hide"), [f, t]), [u, e] = C(!1);
|
|
19
|
+
T(() => {
|
|
20
20
|
e(s ?? !1);
|
|
21
21
|
}, [s]);
|
|
22
|
-
const p =
|
|
22
|
+
const p = g(
|
|
23
23
|
async () => {
|
|
24
24
|
try {
|
|
25
25
|
e(!0), await a(i);
|
|
@@ -30,7 +30,7 @@ function H({
|
|
|
30
30
|
[a, i]
|
|
31
31
|
);
|
|
32
32
|
return d ? /* @__PURE__ */ o.jsx(
|
|
33
|
-
|
|
33
|
+
_,
|
|
34
34
|
{
|
|
35
35
|
title: t("qus.doYouWantToHide"),
|
|
36
36
|
okText: r.toUpperCase(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../../../_virtual/jsx-runtime.cjs"),n=require("react"),g=require("react-i18next"),R=require("../../../locale/hooks/translation-constants.cjs"),k=require("./Button.cjs"),q=require("../../../../node_modules/@ant-design/icons/es/icons/ImportOutlined.cjs");function C({onClick:o,children:u,accept:c,className:a,disabled:l,type:x="link"}){const[p,r]=n.useState(!1),{t:f}=g.useTranslation(R.TRANSLATION_NAMESPACE),e=n.useRef(null),m=n.useCallback(()=>{j(t=>t+1),e.current&&setTimeout(()=>{var t;(t=e==null?void 0:e.current)==null||t.click()},10)},[]),[d,j]=n.useState(0),y=n.useCallback(async t=>{r(!0);const i=t.target.files[0];i&&await o(i),r(!1)},[o]);return s.jsxRuntimeExports.jsxs("div",{className:a,children:[s.jsxRuntimeExports.jsx("input",{type:"file",style:{display:"none"},ref:e,onChange:y,accept:c},d),s.jsxRuntimeExports.jsx(k.default,{loading:p,type:x,disabled:l,onClick:m,icon:s.jsxRuntimeExports.jsx(q.default,{}),tooltip:f("str.import"),children:u})]})}exports.ImportButton=C;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as n } from "../../../../_virtual/jsx-runtime.js";
|
|
2
2
|
import { useState as r, useRef as k, useCallback as c } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import A from "
|
|
5
|
-
import
|
|
3
|
+
import { useTranslation as C } from "react-i18next";
|
|
4
|
+
import { TRANSLATION_NAMESPACE as A } from "../../../locale/hooks/translation-constants.js";
|
|
5
|
+
import T from "./Button.js";
|
|
6
6
|
import h from "../../../../node_modules/@ant-design/icons/es/icons/ImportOutlined.js";
|
|
7
7
|
function L({
|
|
8
8
|
onClick: e,
|
|
@@ -12,7 +12,7 @@ function L({
|
|
|
12
12
|
disabled: f,
|
|
13
13
|
type: p = "link"
|
|
14
14
|
}) {
|
|
15
|
-
const [u, s] = r(!1), { t: x } =
|
|
15
|
+
const [u, s] = r(!1), { t: x } = C(A), o = k(null), j = c(() => {
|
|
16
16
|
d((t) => t + 1), o.current && setTimeout(() => {
|
|
17
17
|
var t;
|
|
18
18
|
(t = o == null ? void 0 : o.current) == null || t.click();
|
|
@@ -38,7 +38,7 @@ function L({
|
|
|
38
38
|
y
|
|
39
39
|
),
|
|
40
40
|
/* @__PURE__ */ n.jsx(
|
|
41
|
-
|
|
41
|
+
T,
|
|
42
42
|
{
|
|
43
43
|
loading: u,
|
|
44
44
|
type: p,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/jsx-runtime.cjs"),a=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/jsx-runtime.cjs"),a=require("react-i18next"),l=require("./Button.cjs"),x=require("../../../locale/hooks/translation-constants.cjs"),d=require("../../../../node_modules/@ant-design/icons/es/icons/PlusOutlined.cjs"),j=({size:n,block:r,className:s,type:u="primary",onClick:t,title:o,to:i})=>{const{t:c}=a.useTranslation(x.TRANSLATION_NAMESPACE);return e.jsxRuntimeExports.jsx(l.default,{type:u,className:s,to:i,block:r,size:n,onClick:t&&(()=>t(!0)),icon:e.jsxRuntimeExports.jsx(d.default,{}),children:o??c("str.new")})};exports.NewButton=j;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { j as r } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import f from "
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import { useTranslation as f } from "react-i18next";
|
|
3
|
+
import u from "./Button.js";
|
|
4
|
+
import { TRANSLATION_NAMESPACE as c } from "../../../locale/hooks/translation-constants.js";
|
|
5
5
|
import x from "../../../../node_modules/@ant-design/icons/es/icons/PlusOutlined.js";
|
|
6
6
|
const R = ({ size: t, block: n, className: m, type: e = "primary", onClick: o, title: i, to: s }) => {
|
|
7
|
-
const { t: p } = c
|
|
7
|
+
const { t: p } = f(c);
|
|
8
8
|
return /* @__PURE__ */ r.jsx(
|
|
9
|
-
|
|
9
|
+
u,
|
|
10
10
|
{
|
|
11
11
|
type: e,
|
|
12
12
|
className: m,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../../../_virtual/jsx-runtime.cjs"),x=require("react-i18next"),p=require("./Button.cjs"),d=require("../../../locale/hooks/translation-constants.cjs"),j=require("../../../../node_modules/@ant-design/icons/es/icons/PrinterOutlined.cjs"),m=({disabled:e,loading:s,block:i,className:o,type:u="primary",onClick:c,title:a,to:l})=>{const{t:r}=x.useTranslation(d.TRANSLATION_NAMESPACE),t=a??r("str.print");return n.jsxRuntimeExports.jsx(p.default,{type:u,className:o,to:l,loading:s,disabled:e,block:i,onClick:c,tooltip:t!=null&&t.trim()?"":r("str.print"),icon:n.jsxRuntimeExports.jsx(j.default,{}),children:t})};exports.PrintButton=m;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { j as r } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import u from "
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import { useTranslation as u } from "react-i18next";
|
|
3
|
+
import x from "./Button.js";
|
|
4
|
+
import { TRANSLATION_NAMESPACE as a } from "../../../locale/hooks/translation-constants.js";
|
|
5
5
|
import j from "../../../../node_modules/@ant-design/icons/es/icons/PrinterOutlined.js";
|
|
6
6
|
const l = ({ disabled: n, loading: i, block: m, className: p, type: s = "primary", onClick: c, title: e, to: f }) => {
|
|
7
|
-
const { t: o } = a
|
|
7
|
+
const { t: o } = u(a), t = e ?? o("str.print");
|
|
8
8
|
return /* @__PURE__ */ r.jsx(
|
|
9
|
-
|
|
9
|
+
x,
|
|
10
10
|
{
|
|
11
11
|
type: s,
|
|
12
12
|
className: p,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/jsx-runtime.cjs"),c=require("../../../locale/hooks/translation-constants.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/jsx-runtime.cjs"),c=require("react-i18next"),l=require("../../../locale/hooks/translation-constants.cjs"),x=require("./Button.cjs"),d=require("../../../../node_modules/@ant-design/icons/es/icons/ReloadOutlined.cjs"),R=({disabled:r,block:n,className:s,type:o="primary",onClick:t,title:u,to:i})=>{const{t:a}=c.useTranslation(l.TRANSLATION_NAMESPACE);return e.jsxRuntimeExports.jsx(x.default,{type:o,disabled:r,className:s,to:i,block:n,onClick:t&&(()=>t(!0)),icon:e.jsxRuntimeExports.jsx(d.default,{}),children:u??a("str.refresh")})};exports.RefreshButton=R;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { j as o } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import {
|
|
3
|
-
import u from "
|
|
4
|
-
import
|
|
2
|
+
import { useTranslation as f } from "react-i18next";
|
|
3
|
+
import { TRANSLATION_NAMESPACE as u } from "../../../locale/hooks/translation-constants.js";
|
|
4
|
+
import c from "./Button.js";
|
|
5
5
|
import x from "../../../../node_modules/@ant-design/icons/es/icons/ReloadOutlined.js";
|
|
6
6
|
const E = ({ disabled: t, block: m, className: n, type: e = "primary", onClick: r, title: s, to: i }) => {
|
|
7
|
-
const { t: p } =
|
|
7
|
+
const { t: p } = f(u);
|
|
8
8
|
return /* @__PURE__ */ o.jsx(
|
|
9
|
-
|
|
9
|
+
c,
|
|
10
10
|
{
|
|
11
11
|
type: e,
|
|
12
12
|
disabled: t,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";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"),n=require("react"),C=require("react-i18next"),j=require("./Button.cjs"),E=require("../../../locale/hooks/translation-constants.cjs"),p=require("../../../../node_modules/@ant-design/icons/es/icons/UpCircleOutlined.cjs"),R=require("../../../../node_modules/antd/es/popconfirm/index.cjs");function g({shouldConfirm:m=!0,block:r,value:u,loading:i,onClick:a,text:l,disabled:c,type:x="link",hidden:q}){const{t:e}=C.useTranslation(E.TRANSLATION_NAMESPACE),s=n.useMemo(()=>l??e("str.unhide"),[l,e]),[d,o]=n.useState(!1);n.useEffect(()=>{o(i??!1)},[i]);const f=n.useCallback(async()=>{try{o(!0),await a(u)}finally{o(!1)}},[a,u]);return m?t.jsxRuntimeExports.jsx(R.default,{title:e("qus.doYouWantToHide"),okText:s.toUpperCase(),cancelText:e("str.no").toUpperCase(),onConfirm:f,children:t.jsxRuntimeExports.jsx(j.default,{tooltip:s,icon:t.jsxRuntimeExports.jsx(p.default,{}),disabled:c,loading:d,type:x,danger:!0,hidden:q,block:r})}):t.jsxRuntimeExports.jsx(j.default,{tooltip:s,icon:t.jsxRuntimeExports.jsx(p.default,{}),disabled:c,loading:d,type:x,danger:!0,block:r,onClick:f})}exports.default=g;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as o } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useMemo as C, useState as T, useEffect as g, useCallback as A } from "react";
|
|
3
|
+
import { useTranslation as E } from "react-i18next";
|
|
4
4
|
import c from "./Button.js";
|
|
5
5
|
import { TRANSLATION_NAMESPACE as _ } from "../../../locale/hooks/translation-constants.js";
|
|
6
|
-
import { useTranslation as k } from "../../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
7
6
|
import x from "../../../../node_modules/@ant-design/icons/es/icons/UpCircleOutlined.js";
|
|
7
|
+
import k from "../../../../node_modules/antd/es/popconfirm/index.js";
|
|
8
8
|
function H({
|
|
9
9
|
shouldConfirm: d = !0,
|
|
10
10
|
block: e,
|
|
@@ -16,11 +16,11 @@ function H({
|
|
|
16
16
|
type: u = "link",
|
|
17
17
|
hidden: j
|
|
18
18
|
}) {
|
|
19
|
-
const { t } =
|
|
20
|
-
|
|
19
|
+
const { t } = E(_), n = C(() => f ?? t("str.unhide"), [f, t]), [l, r] = T(!1);
|
|
20
|
+
g(() => {
|
|
21
21
|
r(s ?? !1);
|
|
22
22
|
}, [s]);
|
|
23
|
-
const p =
|
|
23
|
+
const p = A(
|
|
24
24
|
async () => {
|
|
25
25
|
try {
|
|
26
26
|
r(!0), await a(i);
|
|
@@ -31,7 +31,7 @@ function H({
|
|
|
31
31
|
[a, i]
|
|
32
32
|
);
|
|
33
33
|
return d ? /* @__PURE__ */ o.jsx(
|
|
34
|
-
|
|
34
|
+
k,
|
|
35
35
|
{
|
|
36
36
|
title: t("qus.doYouWantToHide"),
|
|
37
37
|
okText: n.toUpperCase(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("../../../../_virtual/jsx-runtime.cjs"),o=require("./Button.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"),r=require("./Button.cjs"),s=require("../../../locale/hooks/translation-constants.cjs"),i=require("../../../../node_modules/@ant-design/icons/es/icons/EditOutlined.cjs");function a({value:e,onClick:n}){const{t:u}=o.useTranslation(s.TRANSLATION_NAMESPACE);return t.jsxRuntimeExports.jsx(r.default,{tooltip:u("str.update"),type:"link",onClick:()=>n(e),icon:t.jsxRuntimeExports.jsx(i.default,{})})}exports.default=a;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { j as t } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import i from "
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import { useTranslation as i } from "react-i18next";
|
|
3
|
+
import m from "./Button.js";
|
|
4
|
+
import { TRANSLATION_NAMESPACE as p } from "../../../locale/hooks/translation-constants.js";
|
|
5
5
|
import e from "../../../../node_modules/@ant-design/icons/es/icons/EditOutlined.js";
|
|
6
6
|
function c({ value: o, onClick: r }) {
|
|
7
|
-
const { t: n } = p
|
|
7
|
+
const { t: n } = i(p);
|
|
8
8
|
return /* @__PURE__ */ t.jsx(
|
|
9
|
-
|
|
9
|
+
m,
|
|
10
10
|
{
|
|
11
11
|
tooltip: n("str.update"),
|
|
12
12
|
type: "link",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";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"),r=require("react-i18next"),s=require("./Button.cjs"),u=require("../../../locale/hooks/translation-constants.cjs"),i=require("../../../../node_modules/@ant-design/icons/es/icons/EyeOutlined.cjs");function l({value:e,onClick:n}){const{t:o}=r.useTranslation(u.TRANSLATION_NAMESPACE);return t.jsxRuntimeExports.jsx(s.default,{type:"link",onClick:()=>n(e),icon:t.jsxRuntimeExports.jsx(i.default,{}),tooltip:o("str.view")})}exports.default=l;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { j as o } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import i from "
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import { useTranslation as i } from "react-i18next";
|
|
3
|
+
import m from "./Button.js";
|
|
4
|
+
import { TRANSLATION_NAMESPACE as e } from "../../../locale/hooks/translation-constants.js";
|
|
5
5
|
import p from "../../../../node_modules/@ant-design/icons/es/icons/EyeOutlined.js";
|
|
6
6
|
function c({ value: t, onClick: r }) {
|
|
7
|
-
const { t: n } = e
|
|
7
|
+
const { t: n } = i(e);
|
|
8
8
|
return /* @__PURE__ */ o.jsx(
|
|
9
|
-
|
|
9
|
+
m,
|
|
10
10
|
{
|
|
11
11
|
type: "link",
|
|
12
12
|
onClick: () => r(t),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
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";const
|
|
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";const r=require("../../../../_virtual/jsx-runtime.cjs"),
|
|
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";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,14 +1,15 @@
|
|
|
1
1
|
import { j as t } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import {
|
|
2
|
+
import { useTranslation as a } from "react-i18next";
|
|
3
3
|
import m from "../button/Button.js";
|
|
4
|
-
import { TRANSLATION_NAMESPACE as
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
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,
|
|
@@ -20,5 +21,5 @@ const f = ({ loading: o, children: s, error: e }) => {
|
|
|
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;
|