@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,32 +1,33 @@
|
|
|
1
1
|
import { j as e } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import {
|
|
3
|
-
import { Input as p, Form as O } from "antd";
|
|
4
|
-
import { useMemo as R } from "react";
|
|
2
|
+
import { useMemo as M } from "react";
|
|
5
3
|
import { useTranslation as S } from "react-i18next";
|
|
6
4
|
import { TRANSLATION_NAMESPACE as $ } from "../../../locale/hooks/translation-constants.js";
|
|
7
5
|
import D from "../tooltip/TooltipComponent.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
import p from "../../../../node_modules/antd/es/input/index.js";
|
|
7
|
+
import L from "../../../../node_modules/antd/es/form/index.js";
|
|
8
|
+
import O from "../../../../node_modules/@ant-design/icons/es/icons/LoadingOutlined.js";
|
|
9
|
+
const _ = (o, r, t, s) => {
|
|
10
|
+
var n;
|
|
11
|
+
r && t && (o.preventDefault(), (n = t == null ? void 0 : t.getFieldInstance(r)) == null || n.focus()), s && s(o);
|
|
12
|
+
}, U = ({
|
|
12
13
|
type: o,
|
|
13
|
-
required:
|
|
14
|
+
required: r,
|
|
14
15
|
label: t,
|
|
15
|
-
disabled:
|
|
16
|
-
rules:
|
|
16
|
+
disabled: s,
|
|
17
|
+
rules: n = [],
|
|
17
18
|
placeholder: m,
|
|
18
|
-
onEnter:
|
|
19
|
-
size:
|
|
20
|
-
form:
|
|
21
|
-
addonAfter:
|
|
22
|
-
addonBefore:
|
|
19
|
+
onEnter: f,
|
|
20
|
+
size: d,
|
|
21
|
+
form: c,
|
|
22
|
+
addonAfter: l,
|
|
23
|
+
addonBefore: u,
|
|
23
24
|
nextFocus: x,
|
|
24
25
|
autoComplete: j = "off",
|
|
25
|
-
defaultValue:
|
|
26
|
-
readOnly:
|
|
26
|
+
defaultValue: I,
|
|
27
|
+
readOnly: T,
|
|
27
28
|
value: A,
|
|
28
29
|
loading: E,
|
|
29
|
-
onBlur:
|
|
30
|
+
onBlur: g,
|
|
30
31
|
inputRef: v,
|
|
31
32
|
status: C,
|
|
32
33
|
autoFocus: P,
|
|
@@ -34,40 +35,40 @@ const _ = (o, n, t, r) => {
|
|
|
34
35
|
tooltip: h,
|
|
35
36
|
...F
|
|
36
37
|
}) => {
|
|
37
|
-
const { t: a } = S($), N =
|
|
38
|
-
const
|
|
39
|
-
...
|
|
38
|
+
const { t: a } = S($), N = M(() => {
|
|
39
|
+
const i = [
|
|
40
|
+
...n,
|
|
40
41
|
{
|
|
41
|
-
required:
|
|
42
|
+
required: r,
|
|
42
43
|
message: `${t ?? m ?? ""} ${a(
|
|
43
44
|
"err.validation.required"
|
|
44
45
|
)}`
|
|
45
46
|
}
|
|
46
47
|
];
|
|
47
|
-
return o === "email" &&
|
|
48
|
+
return o === "email" && i.push({
|
|
48
49
|
type: "email",
|
|
49
50
|
message: a("err.validation.invalidEmail")
|
|
50
|
-
}),
|
|
51
|
-
}, [
|
|
52
|
-
disabled:
|
|
51
|
+
}), i;
|
|
52
|
+
}, [n, r, t, m, a, o]), R = {
|
|
53
|
+
disabled: s,
|
|
53
54
|
value: A,
|
|
54
|
-
readOnly:
|
|
55
|
-
defaultValue:
|
|
55
|
+
readOnly: T,
|
|
56
|
+
defaultValue: I,
|
|
56
57
|
autoFocus: P,
|
|
57
|
-
addonBefore:
|
|
58
|
+
addonBefore: u,
|
|
58
59
|
ref: v,
|
|
59
|
-
onBlur:
|
|
60
|
-
addonAfter: E ? /* @__PURE__ */ e.jsx(
|
|
60
|
+
onBlur: g,
|
|
61
|
+
addonAfter: E ? /* @__PURE__ */ e.jsx(O, {}) : l,
|
|
61
62
|
status: C,
|
|
62
|
-
size:
|
|
63
|
+
size: d,
|
|
63
64
|
autoComplete: j,
|
|
64
|
-
onPressEnter: (
|
|
65
|
+
onPressEnter: (i) => _(i, x, c, f),
|
|
65
66
|
type: o,
|
|
66
67
|
placeholder: m ?? t
|
|
67
|
-
},
|
|
68
|
-
return /* @__PURE__ */ e.jsx(D, { title: h, children: /* @__PURE__ */ e.jsx(
|
|
68
|
+
}, w = o == "password" ? p.Password : p;
|
|
69
|
+
return /* @__PURE__ */ e.jsx(D, { title: h, children: /* @__PURE__ */ e.jsx(L.Item, { ...F, label: t, rules: N, children: /* @__PURE__ */ e.jsx(w, { ...R }) }) });
|
|
69
70
|
};
|
|
70
71
|
export {
|
|
71
|
-
|
|
72
|
+
U as default,
|
|
72
73
|
_ as onEnterInternalTextField
|
|
73
74
|
};
|
|
@@ -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 u=require("../../../../_virtual/jsx-runtime.cjs"),o=require("../../../../node_modules/antd/es/tooltip/index.cjs"),r=({children:e,title:t})=>t?u.jsxRuntimeExports.jsx(o.default,{title:t,children:e}):e;exports.default=r;
|
|
@@ -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"),u=require("i18next"),E=require("react-i18next"),a=require("../button/Button.cjs"),R=require("../../../locale/hooks/translation-constants.cjs"),f=require("../../../../node_modules/antd/es/result/index.cjs"),q=require("../../../../node_modules/@ant-design/icons/es/icons/LoadingOutlined.cjs"),y=require("../../../../node_modules/@ant-design/icons/es/icons/ArrowLeftOutlined.cjs"),T=({errorChildren:d,children:l,onRetry:r,onClickBack:x,success:s,loading:i,error:e,successTitle:j=u.t("str.success"),successMessage:c,errorMessage:o=u.t("err.save"),errorTitle:m=u.t("str.error"),loadingTitle:p=u.t("message.loading.saving"),loadingMessage:v})=>{const{t:n}=E.useTranslation(R.TRANSLATION_NAMESPACE);return t.jsxRuntimeExports.jsx(f.default,{status:i?void 0:s?"success":e?["403","404","500"].includes(e==null?void 0:e.code)?e.code:e?"error":void 0:void 0,title:i?p:s?j:e?m:void 0,icon:i?t.jsxRuntimeExports.jsx(q.default,{}):void 0,subTitle:i?v:s?c:e?typeof o=="function"?o()??n("err.save"):o??n("err.save"):void 0,extra:[s?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:l}):e?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[!!x&&t.jsxRuntimeExports.jsx(a.default,{onClick:x,htmlType:"button",type:"primary",icon:t.jsxRuntimeExports.jsx(y.default,{}),children:n("str.previous")}),!!r&&t.jsxRuntimeExports.jsx(a.default,{type:"primary",onClick:()=>r(void 0,void 0,!0),children:n("str.retry")},"retry"),d]}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{})]})};exports.default=T;
|
|
@@ -1,60 +1,61 @@
|
|
|
1
1
|
import { j as t } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
import { t as e } from "i18next";
|
|
3
|
+
import { useTranslation as j } from "react-i18next";
|
|
4
|
+
import a from "../button/Button.js";
|
|
5
|
+
import { TRANSLATION_NAMESPACE as y } from "../../../locale/hooks/translation-constants.js";
|
|
6
|
+
import R from "../../../../node_modules/antd/es/result/index.js";
|
|
7
|
+
import T from "../../../../node_modules/@ant-design/icons/es/icons/LoadingOutlined.js";
|
|
8
|
+
import h from "../../../../node_modules/@ant-design/icons/es/icons/ArrowLeftOutlined.js";
|
|
9
|
+
const S = ({
|
|
10
|
+
errorChildren: d,
|
|
11
|
+
children: f,
|
|
12
|
+
onRetry: p,
|
|
13
|
+
onClickBack: r,
|
|
14
|
+
success: i,
|
|
14
15
|
loading: s,
|
|
15
|
-
error:
|
|
16
|
-
successTitle:
|
|
16
|
+
error: o,
|
|
17
|
+
successTitle: u = e("str.success"),
|
|
17
18
|
successMessage: v,
|
|
18
|
-
errorMessage:
|
|
19
|
-
errorTitle:
|
|
20
|
-
loadingTitle:
|
|
21
|
-
loadingMessage:
|
|
19
|
+
errorMessage: n = e("err.save"),
|
|
20
|
+
errorTitle: l = e("str.error"),
|
|
21
|
+
loadingTitle: x = e("message.loading.saving"),
|
|
22
|
+
loadingMessage: c
|
|
22
23
|
}) => {
|
|
23
|
-
const { t:
|
|
24
|
+
const { t: m } = j(y);
|
|
24
25
|
return /* @__PURE__ */ t.jsx(
|
|
25
|
-
|
|
26
|
+
R,
|
|
26
27
|
{
|
|
27
|
-
status: s ? void 0 :
|
|
28
|
-
title: s ?
|
|
29
|
-
icon: s ? /* @__PURE__ */ t.jsx(
|
|
30
|
-
subTitle: s ?
|
|
28
|
+
status: s ? void 0 : i ? "success" : o ? ["403", "404", "500"].includes(o == null ? void 0 : o.code) ? o.code : o ? "error" : void 0 : void 0,
|
|
29
|
+
title: s ? x : i ? u : o ? l : void 0,
|
|
30
|
+
icon: s ? /* @__PURE__ */ t.jsx(T, {}) : void 0,
|
|
31
|
+
subTitle: s ? c : i ? v : o ? typeof n == "function" ? n() ?? m("err.save") : n ?? m("err.save") : void 0,
|
|
31
32
|
extra: [
|
|
32
|
-
|
|
33
|
-
!!
|
|
34
|
-
|
|
33
|
+
i ? /* @__PURE__ */ t.jsx(t.Fragment, { children: f }) : o ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
34
|
+
!!r && /* @__PURE__ */ t.jsx(
|
|
35
|
+
a,
|
|
35
36
|
{
|
|
36
|
-
onClick:
|
|
37
|
+
onClick: r,
|
|
37
38
|
htmlType: "button",
|
|
38
39
|
type: "primary",
|
|
39
|
-
icon: /* @__PURE__ */ t.jsx(
|
|
40
|
-
children:
|
|
40
|
+
icon: /* @__PURE__ */ t.jsx(h, {}),
|
|
41
|
+
children: m("str.previous")
|
|
41
42
|
}
|
|
42
43
|
),
|
|
43
|
-
!!
|
|
44
|
-
|
|
44
|
+
!!p && /* @__PURE__ */ t.jsx(
|
|
45
|
+
a,
|
|
45
46
|
{
|
|
46
47
|
type: "primary",
|
|
47
|
-
onClick: () =>
|
|
48
|
-
children:
|
|
48
|
+
onClick: () => p(void 0, void 0, !0),
|
|
49
|
+
children: m("str.retry")
|
|
49
50
|
},
|
|
50
51
|
"retry"
|
|
51
52
|
),
|
|
52
|
-
|
|
53
|
+
d
|
|
53
54
|
] }) : /* @__PURE__ */ t.jsx(t.Fragment, {})
|
|
54
55
|
]
|
|
55
56
|
}
|
|
56
57
|
);
|
|
57
58
|
};
|
|
58
59
|
export {
|
|
59
|
-
|
|
60
|
+
S as default
|
|
60
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../../../../_virtual/jsx-runtime.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../../../../_virtual/jsx-runtime.cjs"),o=require("react"),q=require("../appearance/Hider.cjs"),v=require("../../../../node_modules/antd/es/steps/index.cjs"),{Step:_}=v.default,y=o.forwardRef(({pages:d,onSubmit:a,initPosition:f=0,progressDot:E,type:S,labelPlacement:b,className:g,pageStyle:w},k)=>{const[t,c]=o.useState(0),[r,x]=o.useState([]);o.useEffect(()=>{c(f)},[f]),o.useImperativeHandle(k,()=>({gotTo:s=>c(s)}),[]);const p=o.useCallback((s,u=!1,l=!1)=>{const e=[...r];if(s!==void 0&&(e[t]=s,x(e)),l||c(t+1),u&&a){const n={};for(const h of e)for(const R in h)n[R]=h[R];a(e,n)}},[t,r,a]),m=o.useCallback(()=>{const s=[...r];s[t]=void 0,x(s),c(t-1)},[t,r]),j=o.useMemo(()=>{const s=[],u=[],l=d.filter(e=>!e.hidden);for(let e=0;e<l.length;e++){const n=l[e];u.push(i.jsxRuntimeExports.jsx(q.default,{hide:t!==e,children:n.component({forward:p,backward:m},r,t===e)},`${n.title}${e}`)),s.push(i.jsxRuntimeExports.jsx(_,{icon:n.icon,title:n.title},n.title))}return{_pages:u,steps:s}},[m,t,r,p,d]);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(v.default,{labelPlacement:b,progressDot:E,className:[g,"pb-3"].join(" "),current:t,type:S,children:j.steps}),i.jsxRuntimeExports.jsx("div",{style:w,children:j._pages})]})});exports.default=y;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as n } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { Steps as S } from "antd";
|
|
3
2
|
import { forwardRef as E, useState as w, useEffect as H, useImperativeHandle as R, useCallback as v, useMemo as _ } from "react";
|
|
4
3
|
import $ from "../appearance/Hider.js";
|
|
4
|
+
import S from "../../../../node_modules/antd/es/steps/index.js";
|
|
5
5
|
const { Step: z } = S, V = E(
|
|
6
6
|
({
|
|
7
7
|
pages: a,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("../../../_virtual/jsx-runtime.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("../../../_virtual/jsx-runtime.cjs"),ae=require("../../../_virtual/dayjs.min.cjs"),o=require("react"),ie=require("react-i18next"),le=require("../../locale/hooks/translation-constants.cjs"),re=require("./CrudForm.cjs"),ue=require("./CrudFormWizard.cjs"),ce=require("./import/CrudImportButton.cjs"),de=require("./view/CrudViewer.cjs"),fe=require("../common/button/NewButton.cjs"),xe=require("../common/button/PrintButton.cjs"),O=require("../../../node_modules/antd/es/space/index.cjs"),me=require("../../../node_modules/antd/es/modal/index.cjs"),pe=require("../../../node_modules/antd/es/spin/index.cjs"),je=require("../../../node_modules/antd/es/form/index.cjs"),{useForm:ye}=je.default;function Ce({idField:p="id",onCreate:C,onDelete:T,onHide:I,onUpdate:f,fields:i,data:M,grid:w,isHiding:D,isCreating:R,isDeleting:U,isUpdating:b,paginateProps:W,onPrint:q,printing:$,viewable:L,loadingData:H,formBuilder:G,extraAction:J,minusHeight:K,cloneable:Q,fullWidthModal:X=!0,wizard:l,extraView:Y,importable:S,onClickNew:h,...Z}){const{t:g}=ie.useTranslation(le.TRANSLATION_NAMESPACE),[F,j]=o.useState(!1),[x,v]=o.useState(),[z,E]=o.useState(),[r]=ye(),N=o.useCallback(async n=>{const c=l?n:await r.validateFields(),u=i.filter(e=>e.type==="color"),a={};u.forEach(e=>{var d;const t=r.getFieldValue(e.name);a[e.name]=typeof t=="string"?t:(d=t==null?void 0:t.toHexString())==null?void 0:d.toUpperCase()}),Object.assign(c,a),x&&f?(await f({...c,[p]:x[p]}),v(void 0)):!x&&C&&await C(c),E(void 0),r.resetFields(),j(!1)},[i,r,p,C,f,x,l]),[ee,P]=o.useState(!1),[te,k]=o.useState(!1);o.useEffect(()=>{F?(P(!1),k(!1)):y(void 0)},[F]);const V=o.useCallback(async n=>{P(n),k(!0)},[]),_=o.useCallback(async()=>{k(!0)},[]),[se,A]=o.useState(!1),B=o.useCallback(async(n,c=!0,u=!1)=>{try{A(!0),j(!0),c&&y("update");const a={};for(const e of i){const t=n[e.name];if(u&&e.type==="image"){const d=t;try{const oe=await e.provider.clone(d);a[e.name]=oe;continue}catch{continue}}e.type==="date"?t&&(a[e.name]=ae.default(t)):e.type==="select"?e.multiple&&Array.isArray(t)?a[e.name]=t.map(d=>d[e.innerFieldId??"id"]):t&&typeof t=="object"?a[e.name]=t[e.innerFieldId??"id"]:(t&&typeof t=="string"||typeof t=="number")&&(a[e.name]=t):a[e.name]=t}r.setFieldsValue(a),E(a),c&&v(n)}finally{A(!1)}},[i,r]),[m,y]=o.useState(),ne=o.useCallback(async n=>{y("clone"),B(n,!1,!0)},[B]);return s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs(O.default,{direction:"vertical",className:"w-100",children:[s.jsxRuntimeExports.jsxs("div",{className:"w-100 d-flex",children:[s.jsxRuntimeExports.jsx("div",{style:{flex:1},children:s.jsxRuntimeExports.jsx(fe.NewButton,{onClick:()=>{h?h():(j(n=>!n),y("new"))},className:"flex-1"})}),s.jsxRuntimeExports.jsxs(O.default,{children:[!!q&&s.jsxRuntimeExports.jsx(xe.PrintButton,{className:"float-right",loading:$,onClick:q}),!!S&&s.jsxRuntimeExports.jsx(ce.default,{fields:i,importProps:S})]})]}),s.jsxRuntimeExports.jsx(de.default,{...Z,minusHeight:K,data:M,fields:i,extraAction:J,idField:p,isDeleting:U,loadingData:H,onClickUpdate:f?B:void 0,onHide:I,isHiding:D,onDelete:T,onUpdate:f,onClickClone:Q?ne:void 0,paginateProps:W,viewable:L,extraView:Y})]}),s.jsxRuntimeExports.jsx(me.default,{width:X?"100%":void 0,title:g(m??"new"),open:F,confirmLoading:R||b,okText:g("str."+(m==="update"?"update":"save")),cancelText:g("str.cancel"),cancelButtonProps:{disabled:te,hidden:!!l},okButtonProps:{disabled:ee,hidden:!!l},onCancel:async()=>{try{if(m==="clone"){const n=l?x:r.getFieldsValue(),c=i.filter(u=>u.type==="image");for(const u of c)n[u.name]&&u.provider.delete(n[u.name])}}finally{}l||r.resetFields(),E(void 0),v(void 0),j(!1)},onOk:()=>N(),destroyOnClose:!0,children:s.jsxRuntimeExports.jsxs(pe.default,{spinning:se,children:[!l&&s.jsxRuntimeExports.jsx(re.CrudForm,{purpose:m,fields:i,form:r,formBuilder:G,grid:w,onDeleteFile:_,onUploadFile:V}),l&&s.jsxRuntimeExports.jsx(ue.default,{submitting:R||b,className:"mt-2",onSave:N,updatingValue:z,fields:i,onDeleteFile:_,onUploadFile:V,purpose:m,wizard:l})]})})]})}exports.default=Ce;
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { j as t } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import le from "../../../_virtual/dayjs.min.js";
|
|
3
|
+
import { useState as m, useCallback as y, useEffect as ae } from "react";
|
|
4
|
+
import { useTranslation as re } from "react-i18next";
|
|
5
|
+
import { TRANSLATION_NAMESPACE as ce } from "../../locale/hooks/translation-constants.js";
|
|
6
|
+
import { CrudForm as me } from "./CrudForm.js";
|
|
7
|
+
import fe from "./CrudFormWizard.js";
|
|
8
|
+
import de from "./import/CrudImportButton.js";
|
|
9
|
+
import pe from "./view/CrudViewer.js";
|
|
10
|
+
import { NewButton as ue } from "../common/button/NewButton.js";
|
|
11
|
+
import { PrintButton as ye } from "../common/button/PrintButton.js";
|
|
12
|
+
import _ from "../../../node_modules/antd/es/space/index.js";
|
|
13
|
+
import xe from "../../../node_modules/antd/es/modal/index.js";
|
|
14
|
+
import Fe from "../../../node_modules/antd/es/spin/index.js";
|
|
15
|
+
import ge from "../../../node_modules/antd/es/form/index.js";
|
|
16
|
+
const { useForm: je } = ge;
|
|
17
|
+
function Me({
|
|
15
18
|
idField: x = "id",
|
|
16
19
|
onCreate: j,
|
|
17
20
|
onDelete: D,
|
|
18
21
|
onHide: U,
|
|
19
22
|
onUpdate: d,
|
|
20
|
-
fields:
|
|
23
|
+
fields: i,
|
|
21
24
|
data: W,
|
|
22
25
|
grid: w,
|
|
23
26
|
isHiding: L,
|
|
@@ -34,27 +37,27 @@ function Oe({
|
|
|
34
37
|
minusHeight: X,
|
|
35
38
|
cloneable: Y,
|
|
36
39
|
fullWidthModal: Z = !0,
|
|
37
|
-
wizard:
|
|
40
|
+
wizard: l,
|
|
38
41
|
extraView: $,
|
|
39
42
|
importable: P,
|
|
40
43
|
onClickNew: A,
|
|
41
44
|
...z
|
|
42
45
|
}) {
|
|
43
|
-
const { t: v } =
|
|
46
|
+
const { t: v } = re(ce), [C, F] = m(!1), [p, B] = m(), [ee, h] = m(), [a] = je(), E = y(
|
|
44
47
|
async (n) => {
|
|
45
|
-
const c =
|
|
48
|
+
const c = l ? n : await a.validateFields(), r = i.filter((e) => e.type === "color"), s = {};
|
|
46
49
|
r.forEach((e) => {
|
|
47
50
|
var f;
|
|
48
|
-
const
|
|
49
|
-
s[e.name] = typeof
|
|
50
|
-
}), Object.assign(c, s),
|
|
51
|
+
const o = a.getFieldValue(e.name);
|
|
52
|
+
s[e.name] = typeof o == "string" ? o : (f = o == null ? void 0 : o.toHexString()) == null ? void 0 : f.toUpperCase();
|
|
53
|
+
}), Object.assign(c, s), p && d ? (await d({
|
|
51
54
|
...c,
|
|
52
|
-
[x]:
|
|
53
|
-
}), B(void 0)) : !
|
|
55
|
+
[x]: p[x]
|
|
56
|
+
}), B(void 0)) : !p && j && await j(c), h(void 0), a.resetFields(), F(!1);
|
|
54
57
|
},
|
|
55
|
-
[
|
|
56
|
-
), [
|
|
57
|
-
|
|
58
|
+
[i, a, x, j, d, p, l]
|
|
59
|
+
), [oe, O] = m(!1), [te, k] = m(!1);
|
|
60
|
+
ae(() => {
|
|
58
61
|
C ? (O(!1), k(!1)) : g(void 0);
|
|
59
62
|
}, [C]);
|
|
60
63
|
const T = y(async (n) => {
|
|
@@ -66,39 +69,39 @@ function Oe({
|
|
|
66
69
|
try {
|
|
67
70
|
M(!0), F(!0), c && g("update");
|
|
68
71
|
const s = {};
|
|
69
|
-
for (const e of
|
|
70
|
-
const
|
|
72
|
+
for (const e of i) {
|
|
73
|
+
const o = n[e.name];
|
|
71
74
|
if (r && e.type === "image") {
|
|
72
|
-
const f =
|
|
75
|
+
const f = o;
|
|
73
76
|
try {
|
|
74
|
-
const
|
|
75
|
-
s[e.name] =
|
|
77
|
+
const ie = await e.provider.clone(f);
|
|
78
|
+
s[e.name] = ie;
|
|
76
79
|
continue;
|
|
77
80
|
} catch {
|
|
78
81
|
continue;
|
|
79
82
|
}
|
|
80
83
|
}
|
|
81
|
-
e.type === "date" ?
|
|
84
|
+
e.type === "date" ? o && (s[e.name] = le(o)) : e.type === "select" ? e.multiple && Array.isArray(o) ? s[e.name] = o.map(
|
|
82
85
|
(f) => f[e.innerFieldId ?? "id"]
|
|
83
|
-
) :
|
|
86
|
+
) : o && typeof o == "object" ? s[e.name] = o[e.innerFieldId ?? "id"] : (o && typeof o == "string" || typeof o == "number") && (s[e.name] = o) : s[e.name] = o;
|
|
84
87
|
}
|
|
85
|
-
|
|
88
|
+
a.setFieldsValue(s), h(s), c && B(n);
|
|
86
89
|
} finally {
|
|
87
90
|
M(!1);
|
|
88
91
|
}
|
|
89
92
|
},
|
|
90
|
-
[
|
|
91
|
-
), [
|
|
93
|
+
[i, a]
|
|
94
|
+
), [u, g] = m(), se = y(
|
|
92
95
|
async (n) => {
|
|
93
96
|
g("clone"), b(n, !1, !0);
|
|
94
97
|
},
|
|
95
98
|
[b]
|
|
96
99
|
);
|
|
97
|
-
return /* @__PURE__ */
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
|
|
100
|
+
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
101
|
+
/* @__PURE__ */ t.jsxs(_, { direction: "vertical", className: "w-100", children: [
|
|
102
|
+
/* @__PURE__ */ t.jsxs("div", { className: "w-100 d-flex", children: [
|
|
103
|
+
/* @__PURE__ */ t.jsx("div", { style: { flex: 1 }, children: /* @__PURE__ */ t.jsx(
|
|
104
|
+
ue,
|
|
102
105
|
{
|
|
103
106
|
onClick: () => {
|
|
104
107
|
A ? A() : (F((n) => !n), g("new"));
|
|
@@ -106,25 +109,25 @@ function Oe({
|
|
|
106
109
|
className: "flex-1"
|
|
107
110
|
}
|
|
108
111
|
) }),
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
!!V && /* @__PURE__ */
|
|
111
|
-
|
|
112
|
+
/* @__PURE__ */ t.jsxs(_, { children: [
|
|
113
|
+
!!V && /* @__PURE__ */ t.jsx(
|
|
114
|
+
ye,
|
|
112
115
|
{
|
|
113
116
|
className: "float-right",
|
|
114
117
|
loading: q,
|
|
115
118
|
onClick: V
|
|
116
119
|
}
|
|
117
120
|
),
|
|
118
|
-
!!P && /* @__PURE__ */
|
|
121
|
+
!!P && /* @__PURE__ */ t.jsx(de, { fields: i, importProps: P })
|
|
119
122
|
] })
|
|
120
123
|
] }),
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
-
|
|
124
|
+
/* @__PURE__ */ t.jsx(
|
|
125
|
+
pe,
|
|
123
126
|
{
|
|
124
127
|
...z,
|
|
125
128
|
minusHeight: X,
|
|
126
129
|
data: W,
|
|
127
|
-
fields:
|
|
130
|
+
fields: i,
|
|
128
131
|
extraAction: Q,
|
|
129
132
|
idField: x,
|
|
130
133
|
isDeleting: R,
|
|
@@ -141,27 +144,27 @@ function Oe({
|
|
|
141
144
|
}
|
|
142
145
|
)
|
|
143
146
|
] }),
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
|
|
147
|
+
/* @__PURE__ */ t.jsx(
|
|
148
|
+
xe,
|
|
146
149
|
{
|
|
147
150
|
width: Z ? "100%" : void 0,
|
|
148
|
-
title: v(
|
|
151
|
+
title: v(u ?? "new"),
|
|
149
152
|
open: C,
|
|
150
153
|
confirmLoading: S || N,
|
|
151
|
-
okText: v("str." + (
|
|
154
|
+
okText: v("str." + (u === "update" ? "update" : "save")),
|
|
152
155
|
cancelText: v("str.cancel"),
|
|
153
156
|
cancelButtonProps: {
|
|
154
|
-
disabled:
|
|
155
|
-
hidden: !!
|
|
157
|
+
disabled: te,
|
|
158
|
+
hidden: !!l
|
|
156
159
|
},
|
|
157
160
|
okButtonProps: {
|
|
158
|
-
disabled:
|
|
159
|
-
hidden: !!
|
|
161
|
+
disabled: oe,
|
|
162
|
+
hidden: !!l
|
|
160
163
|
},
|
|
161
164
|
onCancel: async () => {
|
|
162
165
|
try {
|
|
163
|
-
if (
|
|
164
|
-
const n =
|
|
166
|
+
if (u === "clone") {
|
|
167
|
+
const n = l ? p : a.getFieldsValue(), c = i.filter((r) => r.type === "image");
|
|
165
168
|
for (const r of c)
|
|
166
169
|
n[r.name] && r.provider.delete(
|
|
167
170
|
n[r.name]
|
|
@@ -169,35 +172,35 @@ function Oe({
|
|
|
169
172
|
}
|
|
170
173
|
} finally {
|
|
171
174
|
}
|
|
172
|
-
|
|
175
|
+
l || a.resetFields(), h(void 0), B(void 0), F(!1);
|
|
173
176
|
},
|
|
174
177
|
onOk: () => E(),
|
|
175
178
|
destroyOnClose: !0,
|
|
176
|
-
children: /* @__PURE__ */
|
|
177
|
-
!
|
|
178
|
-
|
|
179
|
+
children: /* @__PURE__ */ t.jsxs(Fe, { spinning: ne, children: [
|
|
180
|
+
!l && /* @__PURE__ */ t.jsx(
|
|
181
|
+
me,
|
|
179
182
|
{
|
|
180
|
-
purpose:
|
|
181
|
-
fields:
|
|
182
|
-
form:
|
|
183
|
+
purpose: u,
|
|
184
|
+
fields: i,
|
|
185
|
+
form: a,
|
|
183
186
|
formBuilder: K,
|
|
184
187
|
grid: w,
|
|
185
188
|
onDeleteFile: I,
|
|
186
189
|
onUploadFile: T
|
|
187
190
|
}
|
|
188
191
|
),
|
|
189
|
-
|
|
190
|
-
|
|
192
|
+
l && /* @__PURE__ */ t.jsx(
|
|
193
|
+
fe,
|
|
191
194
|
{
|
|
192
195
|
submitting: S || N,
|
|
193
196
|
className: "mt-2",
|
|
194
197
|
onSave: E,
|
|
195
198
|
updatingValue: ee,
|
|
196
|
-
fields:
|
|
199
|
+
fields: i,
|
|
197
200
|
onDeleteFile: I,
|
|
198
201
|
onUploadFile: T,
|
|
199
|
-
purpose:
|
|
200
|
-
wizard:
|
|
202
|
+
purpose: u,
|
|
203
|
+
wizard: l
|
|
201
204
|
}
|
|
202
205
|
)
|
|
203
206
|
] })
|
|
@@ -206,5 +209,5 @@ function Oe({
|
|
|
206
209
|
] });
|
|
207
210
|
}
|
|
208
211
|
export {
|
|
209
|
-
|
|
212
|
+
Me as default
|
|
210
213
|
};
|
|
@@ -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"),y=require("react"),W=require("../../../_virtual/main.cjs"),G=require("react-i18next"),z=require("../../locale/hooks/translation-constants.cjs"),J=require("./FileCrudField.cjs"),K=require("./ImageCrudField.cjs"),Q=require("../common/DatePicker/DatePicker.cjs"),X=require("../common/DatePicker/TimePicker.cjs"),Y=require("../common/check-box/CheckBox.cjs"),M=require("../common/select/SelectComponent.cjs"),Z=require("../common/text-field/NumberField.cjs"),V=require("../common/text-field/TextField.cjs"),ee=require("../common/text-field/TextArea.cjs"),te=require("../common/tooltip/TooltipComponent.cjs"),N=require("../../../node_modules/antd/es/form/index.cjs"),B=require("../../../node_modules/antd/es/radio/index.cjs"),w=require("../../../node_modules/antd/es/select/index.cjs"),se=require("../../../node_modules/antd/es/color-picker/ColorPicker.cjs");function re(E){const{label:l,name:d,type:g,required:o,hidden:q,rules:x=[],updatable:m=!0,readonly:F=!1,fieldClassName:h,customFormFieldRender:T,fieldTooltip:C,...e}=E,p=N.default.useFormInstance();y.useEffect(()=>{if(g==="select"){const{items:r=[],onSearch:i,searchOnType:n}=e;!(r!=null&&r.length)&&!n&&(i==null||i(void 0,p,e==null?void 0:e.updatingValue))}},[p,e,g,e==null?void 0:e.updatingValue]);const{t:v}=G.useTranslation(z.TRANSLATION_NAMESPACE);if(F||q)return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{});if(T)return T(p,E);switch(g){case"text":case"email":case"password":{const{onChange:r,placeholder:i}=e;return t.jsxRuntimeExports.jsx(V.default,{placeholder:i,disabled:!m,rules:x,required:o,onChange:r?n=>r(n,p):void 0,type:g,name:d,tooltip:C,label:l,className:h,autoComplete:"new-password"})}case"number":{const{onChange:r,placeholder:i,allowMinus:n}=e;return t.jsxRuntimeExports.jsx(Z.default,{placeholder:i,disabled:!m,moneyField:!!e.formatted,type:g,onChange:r?f=>r(f,p):void 0,rules:x,autoComplete:"false",required:o,tooltip:C,className:h,min:n?null:void 0,name:d,label:l})}case"date":{const{range:r,disableToday:i,disabledFutureDays:n,disabledPastDays:f,onChange:j,placeholder:c,format:b}=e;return t.jsxRuntimeExports.jsx(Q.default,{placeholder:c,required:o,disabled:!m,type:g,format:b,tooltip:C,range:r,name:d,label:l,onChange:j?a=>j(a,p):void 0,className:h,disableToday:i,disabledFutureDays:n,disabledPastDays:f})}case"time":{const{range:r=!1,disableCurrent:i,disabledFuture:n,disabledPast:f,onChange:j,use12Hours:c,format:b,placeholder:a}=e;return t.jsxRuntimeExports.jsx(X.default,{placeholder:a,required:o,format:b,disabled:!m,type:g,tooltip:C,range:r,use12Hours:c,name:d,label:l,onChange:j?R=>j(R,p):void 0,className:h,disableCurrent:i,disabledFuture:n,disabledPast:f})}case"textarea":{const{onChange:r,placeholder:i,rows:n,cols:f}=e;return t.jsxRuntimeExports.jsx(ee.default,{rules:x,placeholder:i,onChange:r?j=>{var c;return r((c=j==null?void 0:j.target)==null?void 0:c.value,p)}:void 0,tooltip:C,required:o,disabled:!m,name:d,label:l,className:h,rows:n,cols:f})}case"image":return t.jsxRuntimeExports.jsx(K.default,{...e,required:o,name:d,label:l,rules:x,fieldClassName:h,onRemoved:e.onRemoved,onUploading:e.onUploading,provider:e.provider});case"file":return t.jsxRuntimeExports.jsx(J.default,{...e,required:o,name:d,label:l,rules:x,fieldClassName:h,onRemoved:e.onRemoved,onUploading:e.onUploading,provider:e.provider});case"select":return t.jsxRuntimeExports.jsx(U,{...e,required:o,name:d,label:l,rules:x,fieldClassName:h,form:p,updatable:m,readonly:F,fieldTooltip:C});case"enum":{const{enum:r,radio:i=!1,translation:n,onChange:f,onSearch:j,multiple:c}=e,b=Array.isArray(r)?r:Object.keys(r);return i?t.jsxRuntimeExports.jsx(N.default.Item,{...e,name:d,required:o,tooltip:C,rules:x,label:l,className:["w-100",h].join(" "),children:t.jsxRuntimeExports.jsx(B.default.Group,{...e,onChange:f?a=>{var R;return f((R=a==null?void 0:a.target)==null?void 0:R.value,p)}:void 0,children:b.map(a=>t.jsxRuntimeExports.jsx(B.default,{disabled:!m,value:a,children:n?v(n[a]):a},a))})}):t.jsxRuntimeExports.jsx(M.default,{...e,onChange:f?a=>f(a,p):void 0,className:["w-100",h].join(" "),name:d,items:b,required:o,tooltip:C,rules:x,label:l,disabled:!m,onSearch:j?a=>j(a,p):void 0,allowClear:!0,mode:c?"multiple":void 0,itemBuilder:a=>t.jsxRuntimeExports.jsx(w.default.Option,{value:a,children:n?v(n[a]):a},a)})}case"checkbox":{const{onChange:r}=e;return t.jsxRuntimeExports.jsx(Y.default,{className:h,rules:x,onChange:r?i=>r(i,p):void 0,label:l,tooltip:C,disabled:!m,name:d})}case"color":return t.jsxRuntimeExports.jsx(_,{...e,type:"color",required:o,name:d,label:l,rules:x,fieldClassName:h,updatable:m,readonly:F,fieldTooltip:C});default:return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:`${g} Not Implemented`})}}function U(E){const{items:l=[],loading:d,searchOnType:g,onSearch:o,multiple:q,onChange:x,highlightSearch:m,required:F,fieldClassName:h,rules:T,fieldTooltip:C,updatable:e,label:p,name:v,tagRender:r,updatingValue:i,onSet:n,placeholder:f,allowClear:j=!0}=E,c=E.form,[b,a]=y.useState(""),R=N.default.useWatch(v,c),[k,S]=y.useState(!0);y.useEffect(()=>{n&&k&&R&&(n==null||n(R,l,c),S(!1))},[k,c,l,v,n,R]),y.useEffect(()=>{R&&S(!0)},[R]);const D=y.useCallback(async s=>{a(s),g&&(o==null||o(s,c,i))},[c,o,g,i]);return t.jsxRuntimeExports.jsx(M.default,{...E,maxTagCount:"responsive",maxTagPlaceholder:s=>t.jsxRuntimeExports.jsxs(te.default,{title:t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:s.map(u=>t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[u.label," ",t.jsxRuntimeExports.jsx("br",{})]}))}),children:["+",s==null?void 0:s.length]}),placeholder:f,onSelect:s=>{n==null||n(s==null?void 0:s.key,l,c)},onChange:x?s=>{a(""),x(s,c)}:void 0,mode:q?"multiple":void 0,className:["w-100",h].join(" "),name:v,items:l,required:F,tooltip:C,tagRender:r,rules:T,disabled:!e,label:p,allowClear:j,onSearch:D,loading:d,filterOption:m?(s,u)=>{var O,P,A;try{const I=s.toLowerCase().split(/\s+/),H=((typeof(u==null?void 0:u.children)=="string"?u==null?void 0:u.children:(P=(O=u==null?void 0:u.children)==null?void 0:O.props)==null?void 0:P.textToHighlight)??"").toLowerCase(),$=(((A=u==null?void 0:u.value)==null?void 0:A.toString())??"").toLowerCase();return I.every(L=>H.indexOf(L)>=0||$.indexOf(L)>=0)}catch{return!0}}:void 0,itemBuilder:m?s=>{const u=s.value?String(s.value):void 0;return t.jsxRuntimeExports.jsx(w.default.Option,{value:s.key,title:u,disabled:s.disabled,children:t.jsxRuntimeExports.jsx(W.default,{highlightClassName:"highlight-text",searchWords:(b??"").split(" "),autoEscape:!0,textToHighlight:u??""})},s.key)}:s=>t.jsxRuntimeExports.jsx(w.default.Option,{value:s.key,title:s.value,disabled:s.disabled,children:s.value},s.key)})}function _(E){const{required:l,fieldClassName:d,rules:g,fieldTooltip:o,updatable:q,label:x,name:m}=E;return t.jsxRuntimeExports.jsx(N.default.Item,{label:x,name:m,required:l,rules:g,tooltip:o,children:t.jsxRuntimeExports.jsx(se.default,{disabledAlpha:!0,format:"hex",defaultFormat:"hex",showText:!0,trigger:"click",className:d,disabled:!q,...E.innerProps})})}exports.ColorCrudFieldComponent=_;exports.SelectCrudFieldComponent=U;exports.default=re;
|