@kingteza/crud-component 1.0.14 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/common/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/common/DatePicker/DatePicker.js +42 -42
- package/dist/components/common/DatePicker/TimePicker.cjs +1 -1
- package/dist/components/common/DatePicker/TimePicker.js +39 -39
- package/dist/components/common/appearance/Hider.cjs +1 -1
- package/dist/components/common/appearance/Hider.js +3 -3
- package/dist/components/common/button/Button.cjs +1 -1
- package/dist/components/common/button/Button.js +19 -19
- package/dist/components/common/button/CloneButtonTable.cjs +1 -1
- package/dist/components/common/button/CloneButtonTable.js +11 -11
- package/dist/components/common/button/DeleteButtonTable.cjs +1 -1
- package/dist/components/common/button/DeleteButtonTable.js +29 -29
- package/dist/components/common/button/ExportButton.cjs +1 -1
- package/dist/components/common/button/ExportButton.js +17 -17
- package/dist/components/common/button/HideButtonTable.cjs +1 -1
- package/dist/components/common/button/HideButtonTable.js +35 -35
- package/dist/components/common/button/ImportButton.cjs +1 -1
- package/dist/components/common/button/ImportButton.js +28 -28
- package/dist/components/common/button/NewButton.cjs +1 -1
- package/dist/components/common/button/NewButton.js +14 -14
- package/dist/components/common/button/PrintButton.cjs +1 -1
- package/dist/components/common/button/PrintButton.js +14 -14
- package/dist/components/common/button/RefreshButton.cjs +1 -1
- package/dist/components/common/button/RefreshButton.js +16 -16
- package/dist/components/common/button/UnHideButton.cjs +1 -1
- package/dist/components/common/button/UnHideButton.js +37 -37
- package/dist/components/common/button/UpdateButtonTable.cjs +1 -1
- package/dist/components/common/button/UpdateButtonTable.js +11 -11
- package/dist/components/common/button/ViewButtonTable.cjs +1 -1
- package/dist/components/common/button/ViewButtonTable.js +10 -10
- package/dist/components/common/check-box/CheckBox.cjs +1 -1
- package/dist/components/common/check-box/CheckBox.js +20 -20
- package/dist/components/common/description/DescList.cjs +1 -1
- package/dist/components/common/description/DescList.js +9 -9
- package/dist/components/common/layout/VerticalSpace.cjs +1 -1
- package/dist/components/common/layout/VerticalSpace.js +3 -3
- package/dist/components/common/loading/LoadingIndicator.cjs +1 -1
- package/dist/components/common/loading/LoadingIndicator.js +12 -12
- package/dist/components/common/picker/ImagePicker.cjs +1 -1
- package/dist/components/common/picker/ImagePicker.js +173 -176
- package/dist/components/common/radio/RadioGroupComponent.cjs +1 -1
- package/dist/components/common/radio/RadioGroupComponent.js +6 -6
- package/dist/components/common/report/SelectFieldInReport.cjs +1 -1
- package/dist/components/common/report/SelectFieldInReport.js +11 -11
- package/dist/components/common/select/CustomSelectOption.cjs +1 -1
- package/dist/components/common/select/CustomSelectOption.js +7 -7
- package/dist/components/common/select/SelectComponent.cjs +1 -1
- package/dist/components/common/select/SelectComponent.js +36 -36
- package/dist/components/common/show-more/index.cjs +1 -1
- package/dist/components/common/show-more/index.js +5 -5
- package/dist/components/common/tab/TabViewWithRoute.cjs +1 -1
- package/dist/components/common/tab/TabViewWithRoute.js +23 -22
- package/dist/components/common/table/table.cjs +1 -1
- package/dist/components/common/table/table.js +12 -12
- package/dist/components/common/tag/StatusTag.cjs +1 -1
- package/dist/components/common/tag/StatusTag.js +13 -13
- package/dist/components/common/text-field/NumberField.cjs +1 -1
- package/dist/components/common/text-field/NumberField.js +43 -43
- package/dist/components/common/text-field/PhoneNumberField.cjs +1 -1
- package/dist/components/common/text-field/PhoneNumberField.js +4 -4
- package/dist/components/common/text-field/TextArea.cjs +1 -1
- package/dist/components/common/text-field/TextArea.js +20 -20
- package/dist/components/common/text-field/TextField.cjs +1 -1
- package/dist/components/common/text-field/TextField.js +47 -47
- package/dist/components/common/tooltip/TooltipComponent.cjs +1 -1
- package/dist/components/common/tooltip/TooltipComponent.js +3 -3
- package/dist/components/common/wizard/WizardResult.cjs +1 -1
- package/dist/components/common/wizard/WizardResult.js +37 -38
- package/dist/components/common/wizard/WizardViewForm.cjs +1 -1
- package/dist/components/common/wizard/WizardViewForm.js +43 -43
- package/dist/components/crud/CrudComponent.cjs +1 -1
- package/dist/components/crud/CrudComponent.js +130 -130
- package/dist/components/crud/CrudField.cjs +1 -1
- package/dist/components/crud/CrudField.js +217 -217
- package/dist/components/crud/CrudForm.cjs +1 -1
- package/dist/components/crud/CrudForm.js +55 -55
- package/dist/components/crud/CrudFormWizard.cjs +1 -1
- package/dist/components/crud/CrudFormWizard.js +82 -84
- package/dist/components/crud/CrudReportComponent.cjs +3 -3
- package/dist/components/crud/CrudReportComponent.js +123 -123
- package/dist/components/crud/CrudSearchComponent.cjs +1 -1
- package/dist/components/crud/CrudSearchComponent.js +43 -43
- package/dist/components/crud/FileCrudField.cjs +1 -1
- package/dist/components/crud/FileCrudField.js +118 -125
- package/dist/components/crud/ImageCrudField.cjs +1 -1
- package/dist/components/crud/ImageCrudField.js +56 -56
- package/dist/components/crud/import/CrudImportButton.cjs +1 -1
- package/dist/components/crud/import/CrudImportButton.js +18 -18
- package/dist/components/crud/import/CrudImportComponent.cjs +2 -2
- package/dist/components/crud/import/CrudImportComponent.js +108 -109
- package/dist/components/crud/view/CrudDecListView.cjs +1 -1
- package/dist/components/crud/view/CrudDecListView.js +22 -22
- package/dist/components/crud/view/CrudViewer.cjs +1 -1
- package/dist/components/crud/view/CrudViewer.js +152 -152
- package/dist/components/crud/view/CrudViewerUtil.cjs +1 -1
- package/dist/components/crud/view/CrudViewerUtil.js +33 -34
- package/dist/locale/index.cjs +1 -1
- package/dist/locale/index.js +2 -2
- package/dist/util/DateUtil.cjs +1 -1
- package/dist/util/DateUtil.js +4 -4
- package/dist/util/ImageUtil.cjs +1 -1
- package/dist/util/ImageUtil.js +1 -1
- package/dist/util/ValidationUtil.cjs +1 -1
- package/dist/util/ValidationUtil.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),O=require("@ant-design/icons"),c=require("antd"),R=require("react"),_=require("react-i18next"),w=require("../../../locale/hooks/translation-constants.cjs"),L=require("../tooltip/TooltipComponent.cjs"),d=(t,n,e,i)=>{var s;n&&e&&(t.preventDefault(),(s=e==null?void 0:e.getFieldInstance(n))==null||s.focus()),i&&i(t)},$=({type:t,required:n,label:e,disabled:i,rules:s=[],placeholder:a,onEnter:l,size:p,form:x,addonAfter:I,addonBefore:T,nextFocus:g,autoComplete:m="off",defaultValue:q,readOnly:f,value:j,loading:v,onBlur:A,inputRef:C,status:E,autoFocus:P,onChange:D,tooltip:F,...M})=>{const{t:u}=_.useTranslation(w.TRANSLATION_NAMESPACE),S=R.useMemo(()=>{const r=[...s,{required:n,message:`${e??a??""} ${u("err.validation.required")}`}];return t==="email"&&r.push({type:"email",message:u("err.validation.invalidEmail")}),r},[s,n,e,a,u,t]),h={disabled:i,value:j,readOnly:f,defaultValue:q,autoFocus:P,addonBefore:T,ref:C,onBlur:A,addonAfter:v?o.jsx(O.LoadingOutlined,{}):I,status:E,size:p,autoComplete:m,onPressEnter:r=>d(r,g,x,l),type:t,placeholder:a??e},N=t=="password"?c.Input.Password:c.Input;return o.jsx(L,{title:F,children:o.jsx(c.Form.Item,{...M,label:e,rules:S,children:o.jsx(N,{...h})})})};exports.default=$;exports.onEnterInternalTextField=d;
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
const _ = (o, n, t,
|
|
9
|
-
var
|
|
10
|
-
n && t && (o.preventDefault(), (
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { LoadingOutlined as O } from "@ant-design/icons";
|
|
3
|
+
import { Input as d, Form as S } from "antd";
|
|
4
|
+
import { useMemo as $ } from "react";
|
|
5
|
+
import { useTranslation as j } from "react-i18next";
|
|
6
|
+
import { TRANSLATION_NAMESPACE as D } from "../../../locale/hooks/translation-constants.js";
|
|
7
|
+
import R from "../tooltip/TooltipComponent.js";
|
|
8
|
+
const _ = (o, n, t, r) => {
|
|
9
|
+
var i;
|
|
10
|
+
n && t && (o.preventDefault(), (i = t == null ? void 0 : t.getFieldInstance(n)) == null || i.focus()), r && r(o);
|
|
11
11
|
}, Q = ({
|
|
12
12
|
type: o,
|
|
13
13
|
required: n,
|
|
14
14
|
label: t,
|
|
15
|
-
disabled:
|
|
16
|
-
rules:
|
|
15
|
+
disabled: r,
|
|
16
|
+
rules: i = [],
|
|
17
17
|
placeholder: m,
|
|
18
|
-
onEnter:
|
|
19
|
-
size:
|
|
20
|
-
form:
|
|
21
|
-
addonAfter:
|
|
22
|
-
addonBefore:
|
|
23
|
-
nextFocus:
|
|
24
|
-
autoComplete:
|
|
25
|
-
defaultValue:
|
|
26
|
-
readOnly:
|
|
27
|
-
value:
|
|
28
|
-
loading:
|
|
29
|
-
onBlur:
|
|
30
|
-
inputRef:
|
|
31
|
-
status:
|
|
32
|
-
autoFocus:
|
|
18
|
+
onEnter: p,
|
|
19
|
+
size: f,
|
|
20
|
+
form: l,
|
|
21
|
+
addonAfter: u,
|
|
22
|
+
addonBefore: c,
|
|
23
|
+
nextFocus: T,
|
|
24
|
+
autoComplete: g = "off",
|
|
25
|
+
defaultValue: A,
|
|
26
|
+
readOnly: I,
|
|
27
|
+
value: v,
|
|
28
|
+
loading: C,
|
|
29
|
+
onBlur: E,
|
|
30
|
+
inputRef: P,
|
|
31
|
+
status: h,
|
|
32
|
+
autoFocus: x,
|
|
33
33
|
onChange: k,
|
|
34
|
-
tooltip:
|
|
35
|
-
...
|
|
34
|
+
tooltip: F,
|
|
35
|
+
...N
|
|
36
36
|
}) => {
|
|
37
|
-
const { t: a } =
|
|
37
|
+
const { t: a } = j(D), w = $(() => {
|
|
38
38
|
const e = [
|
|
39
|
-
...
|
|
39
|
+
...i,
|
|
40
40
|
{
|
|
41
41
|
required: n,
|
|
42
42
|
message: `${t ?? m ?? ""} ${a(
|
|
@@ -48,24 +48,24 @@ const _ = (o, n, t, s) => {
|
|
|
48
48
|
type: "email",
|
|
49
49
|
message: a("err.validation.invalidEmail")
|
|
50
50
|
}), e;
|
|
51
|
-
}, [
|
|
52
|
-
disabled:
|
|
53
|
-
value:
|
|
54
|
-
readOnly:
|
|
55
|
-
defaultValue:
|
|
56
|
-
autoFocus:
|
|
57
|
-
addonBefore:
|
|
58
|
-
ref:
|
|
59
|
-
onBlur:
|
|
60
|
-
addonAfter:
|
|
61
|
-
status:
|
|
62
|
-
size:
|
|
63
|
-
autoComplete:
|
|
64
|
-
onPressEnter: (e) => _(e,
|
|
51
|
+
}, [i, n, t, m, a, o]), L = {
|
|
52
|
+
disabled: r,
|
|
53
|
+
value: v,
|
|
54
|
+
readOnly: I,
|
|
55
|
+
defaultValue: A,
|
|
56
|
+
autoFocus: x,
|
|
57
|
+
addonBefore: c,
|
|
58
|
+
ref: P,
|
|
59
|
+
onBlur: E,
|
|
60
|
+
addonAfter: C ? /* @__PURE__ */ s(O, {}) : u,
|
|
61
|
+
status: h,
|
|
62
|
+
size: f,
|
|
63
|
+
autoComplete: g,
|
|
64
|
+
onPressEnter: (e) => _(e, T, l, p),
|
|
65
65
|
type: o,
|
|
66
66
|
placeholder: m ?? t
|
|
67
|
-
},
|
|
68
|
-
return /* @__PURE__ */
|
|
67
|
+
}, M = o == "password" ? d.Password : d;
|
|
68
|
+
return /* @__PURE__ */ s(R, { title: F, children: /* @__PURE__ */ s(S.Item, { ...N, label: t, rules: w, children: /* @__PURE__ */ s(M, { ...L }) }) });
|
|
69
69
|
};
|
|
70
70
|
export {
|
|
71
71
|
Q as default,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const r=require("
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),e=require("antd"),n=({children:t,title:o})=>o?r.jsx(e.Tooltip,{title:o,children:t}):t;module.exports=n;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { Tooltip as p } from "antd";
|
|
3
3
|
const n = ({
|
|
4
4
|
children: o,
|
|
5
|
-
title:
|
|
6
|
-
}) =>
|
|
5
|
+
title: r
|
|
6
|
+
}) => r ? /* @__PURE__ */ t(p, { title: r, children: o }) : o;
|
|
7
7
|
export {
|
|
8
8
|
n as default
|
|
9
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),a=require("@ant-design/icons"),y=require("antd"),o=require("i18next"),A=require("react-i18next"),d=require("../button/Button.cjs"),T=require("../../../locale/hooks/translation-constants.cjs"),h=({errorChildren:l,children:v,onRetry:r,onClickBack:c,success:n,loading:s,error:e,successTitle:x=o.t("str.success"),successMessage:j,errorMessage:u=o.t("err.save"),errorTitle:m=o.t("str.error"),loadingTitle:p=o.t("message.loading.saving"),loadingMessage:q})=>{const{t:i}=A.useTranslation(T.TRANSLATION_NAMESPACE);return t.jsx(y.Result,{status:s?void 0:n?"success":e?["403","404","500"].includes(e==null?void 0:e.code)?e.code:e?"error":void 0:void 0,title:s?p:n?x:e?m:void 0,icon:s?t.jsx(a.LoadingOutlined,{}):void 0,subTitle:s?q:n?j:e?typeof u=="function"?u()??i("err.save"):u??i("err.save"):void 0,extra:[n?t.jsx(t.Fragment,{children:v}):e?t.jsxs(t.Fragment,{children:[!!c&&t.jsx(d,{onClick:c,htmlType:"button",type:"primary",icon:t.jsx(a.ArrowLeftOutlined,{}),children:i("str.previous")}),!!r&&t.jsx(d,{type:"primary",onClick:()=>r(void 0,void 0,!0),children:i("str.retry")},"retry"),l]}):t.jsx(t.Fragment,{})]})};module.exports=h;
|
|
@@ -1,61 +1,60 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
children: f,
|
|
1
|
+
import { jsx as i, Fragment as d, jsxs as T } from "react/jsx-runtime";
|
|
2
|
+
import { LoadingOutlined as h, ArrowLeftOutlined as x } from "@ant-design/icons";
|
|
3
|
+
import { Result as C } from "antd";
|
|
4
|
+
import { t as m } from "i18next";
|
|
5
|
+
import { useTranslation as L } from "react-i18next";
|
|
6
|
+
import l from "../button/Button.js";
|
|
7
|
+
import { TRANSLATION_NAMESPACE as N } from "../../../locale/hooks/translation-constants.js";
|
|
8
|
+
const w = ({
|
|
9
|
+
errorChildren: u,
|
|
10
|
+
children: a,
|
|
12
11
|
onRetry: p,
|
|
13
12
|
onClickBack: r,
|
|
14
|
-
success:
|
|
15
|
-
loading:
|
|
16
|
-
error:
|
|
17
|
-
successTitle:
|
|
18
|
-
successMessage:
|
|
19
|
-
errorMessage:
|
|
20
|
-
errorTitle:
|
|
21
|
-
loadingTitle:
|
|
22
|
-
loadingMessage:
|
|
13
|
+
success: o,
|
|
14
|
+
loading: e,
|
|
15
|
+
error: t,
|
|
16
|
+
successTitle: v = m("str.success"),
|
|
17
|
+
successMessage: f,
|
|
18
|
+
errorMessage: s = m("err.save"),
|
|
19
|
+
errorTitle: c = m("str.error"),
|
|
20
|
+
loadingTitle: y = m("message.loading.saving"),
|
|
21
|
+
loadingMessage: A
|
|
23
22
|
}) => {
|
|
24
|
-
const { t:
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
|
|
23
|
+
const { t: n } = L(N);
|
|
24
|
+
return /* @__PURE__ */ i(
|
|
25
|
+
C,
|
|
27
26
|
{
|
|
28
|
-
status:
|
|
29
|
-
title:
|
|
30
|
-
icon:
|
|
31
|
-
subTitle:
|
|
27
|
+
status: e ? void 0 : o ? "success" : t ? ["403", "404", "500"].includes(t == null ? void 0 : t.code) ? t.code : t ? "error" : void 0 : void 0,
|
|
28
|
+
title: e ? y : o ? v : t ? c : void 0,
|
|
29
|
+
icon: e ? /* @__PURE__ */ i(h, {}) : void 0,
|
|
30
|
+
subTitle: e ? A : o ? f : t ? typeof s == "function" ? s() ?? n("err.save") : s ?? n("err.save") : void 0,
|
|
32
31
|
extra: [
|
|
33
|
-
|
|
34
|
-
!!r && /* @__PURE__ */
|
|
35
|
-
|
|
32
|
+
o ? /* @__PURE__ */ i(d, { children: a }) : t ? /* @__PURE__ */ T(d, { children: [
|
|
33
|
+
!!r && /* @__PURE__ */ i(
|
|
34
|
+
l,
|
|
36
35
|
{
|
|
37
36
|
onClick: r,
|
|
38
37
|
htmlType: "button",
|
|
39
38
|
type: "primary",
|
|
40
|
-
icon: /* @__PURE__ */
|
|
41
|
-
children:
|
|
39
|
+
icon: /* @__PURE__ */ i(x, {}),
|
|
40
|
+
children: n("str.previous")
|
|
42
41
|
}
|
|
43
42
|
),
|
|
44
|
-
!!p && /* @__PURE__ */
|
|
45
|
-
|
|
43
|
+
!!p && /* @__PURE__ */ i(
|
|
44
|
+
l,
|
|
46
45
|
{
|
|
47
46
|
type: "primary",
|
|
48
47
|
onClick: () => p(void 0, void 0, !0),
|
|
49
|
-
children:
|
|
48
|
+
children: n("str.retry")
|
|
50
49
|
},
|
|
51
50
|
"retry"
|
|
52
51
|
),
|
|
53
|
-
|
|
54
|
-
] }) : /* @__PURE__ */
|
|
52
|
+
u
|
|
53
|
+
] }) : /* @__PURE__ */ i(d, {})
|
|
55
54
|
]
|
|
56
55
|
}
|
|
57
56
|
);
|
|
58
57
|
};
|
|
59
58
|
export {
|
|
60
|
-
|
|
59
|
+
w as default
|
|
61
60
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const c=require("react/jsx-runtime"),w=require("antd"),o=require("react"),F=require("../appearance/Hider.cjs"),{Step:R}=w.Steps,y=o.forwardRef(({pages:d,onSubmit:u,initPosition:f=0,progressDot:v,type:b,labelPlacement:g,className:k,pageStyle:q},C)=>{const[s,i]=o.useState(0),[r,p]=o.useState([]);o.useEffect(()=>{i(f)},[f]),o.useImperativeHandle(C,()=>({gotTo:t=>i(t)}),[]);const m=o.useCallback((t,a=!1,l=!1)=>{const e=[...r];if(t!==void 0&&(e[s]=t,p(e)),l||i(s+1),a&&u){const n={};for(const x of e)for(const S in x)n[S]=x[S];u(e,n)}},[s,r,u]),h=o.useCallback(()=>{const t=[...r];t[s]=void 0,p(t),i(s-1)},[s,r]),j=o.useMemo(()=>{const t=[],a=[],l=d.filter(e=>!e.hidden);for(let e=0;e<l.length;e++){const n=l[e];a.push(c.jsx(F,{hide:s!==e,children:n.component({forward:m,backward:h},r,s===e)},`${n.title}${e}`)),t.push(c.jsx(R,{icon:n.icon,title:n.title},n.title))}return{_pages:a,steps:t}},[h,s,r,m,d]);return c.jsxs(c.Fragment,{children:[c.jsx(w.Steps,{labelPlacement:g,progressDot:v,className:[k,"pb-3"].join(" "),current:s,type:b,children:j.steps}),c.jsx("div",{style:q,children:j._pages})]})});module.exports=y;
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Steps as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import
|
|
5
|
-
const { Step:
|
|
1
|
+
import { jsx as f, jsxs as H, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
+
import { Steps as b } from "antd";
|
|
3
|
+
import { forwardRef as $, useState as S, useEffect as z, useImperativeHandle as E, useCallback as g, useMemo as I } from "react";
|
|
4
|
+
import M from "../appearance/Hider.js";
|
|
5
|
+
const { Step: N } = b, q = $(
|
|
6
6
|
({
|
|
7
7
|
pages: a,
|
|
8
8
|
onSubmit: l,
|
|
9
|
-
initPosition:
|
|
10
|
-
progressDot:
|
|
11
|
-
type:
|
|
12
|
-
labelPlacement:
|
|
9
|
+
initPosition: d = 0,
|
|
10
|
+
progressDot: j,
|
|
11
|
+
type: k,
|
|
12
|
+
labelPlacement: x,
|
|
13
13
|
className: F,
|
|
14
14
|
pageStyle: y
|
|
15
15
|
}, C) => {
|
|
16
|
-
const [
|
|
16
|
+
const [t, n] = S(0), [r, m] = S(
|
|
17
17
|
[]
|
|
18
18
|
);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}, [
|
|
19
|
+
z(() => {
|
|
20
|
+
n(d);
|
|
21
|
+
}, [d]), E(
|
|
22
22
|
C,
|
|
23
23
|
() => ({
|
|
24
|
-
gotTo: (
|
|
24
|
+
gotTo: (s) => n(s)
|
|
25
25
|
}),
|
|
26
26
|
[]
|
|
27
27
|
);
|
|
28
|
-
const
|
|
29
|
-
(
|
|
30
|
-
const
|
|
31
|
-
if (
|
|
28
|
+
const p = g(
|
|
29
|
+
(s, c = !1, i = !1) => {
|
|
30
|
+
const e = [...r];
|
|
31
|
+
if (s !== void 0 && (e[t] = s, m(e)), i || n(t + 1), c && l) {
|
|
32
32
|
const o = {};
|
|
33
|
-
for (const
|
|
34
|
-
for (const
|
|
35
|
-
o[
|
|
36
|
-
l(
|
|
33
|
+
for (const w of e)
|
|
34
|
+
for (const v in w)
|
|
35
|
+
o[v] = w[v];
|
|
36
|
+
l(e, o);
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
|
-
[
|
|
40
|
-
), u =
|
|
41
|
-
const
|
|
42
|
-
t
|
|
43
|
-
}, [
|
|
44
|
-
const
|
|
45
|
-
for (let
|
|
46
|
-
const o =
|
|
39
|
+
[t, r, l]
|
|
40
|
+
), u = g(() => {
|
|
41
|
+
const s = [...r];
|
|
42
|
+
s[t] = void 0, m(s), n(t - 1);
|
|
43
|
+
}, [t, r]), h = I(() => {
|
|
44
|
+
const s = [], c = [], i = a.filter((e) => !e.hidden);
|
|
45
|
+
for (let e = 0; e < i.length; e++) {
|
|
46
|
+
const o = i[e];
|
|
47
47
|
c.push(
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
),
|
|
48
|
+
/* @__PURE__ */ f(M, { hide: t !== e, children: o.component({ forward: p, backward: u }, r, t === e) }, `${o.title}${e}`)
|
|
49
|
+
), s.push(/* @__PURE__ */ f(N, { icon: o.icon, title: o.title }, o.title));
|
|
50
50
|
}
|
|
51
51
|
return {
|
|
52
52
|
_pages: c,
|
|
53
|
-
steps:
|
|
53
|
+
steps: s
|
|
54
54
|
};
|
|
55
|
-
}, [u,
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
|
|
55
|
+
}, [u, t, r, p, a]);
|
|
56
|
+
return /* @__PURE__ */ H(_, { children: [
|
|
57
|
+
/* @__PURE__ */ f(
|
|
58
|
+
b,
|
|
59
59
|
{
|
|
60
|
-
labelPlacement:
|
|
61
|
-
progressDot:
|
|
60
|
+
labelPlacement: x,
|
|
61
|
+
progressDot: j,
|
|
62
62
|
className: [F, "pb-3"].join(" "),
|
|
63
|
-
current:
|
|
64
|
-
type:
|
|
63
|
+
current: t,
|
|
64
|
+
type: k,
|
|
65
65
|
children: h.steps
|
|
66
66
|
}
|
|
67
67
|
),
|
|
68
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ f("div", { style: y, children: h._pages })
|
|
69
69
|
] });
|
|
70
70
|
}
|
|
71
71
|
);
|
|
72
72
|
export {
|
|
73
|
-
|
|
73
|
+
q as default
|
|
74
74
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),y=require("antd"),ae=require("dayjs"),o=require("react"),le=require("react-i18next"),ie=require("../../locale/hooks/translation-constants.cjs"),ce=require("./CrudForm.cjs"),re=require("./CrudFormWizard.cjs"),ue=require("./import/CrudImportButton.cjs"),de=require("./view/CrudViewer.cjs"),fe=require("../common/button/NewButton.cjs"),pe=require("../common/button/PrintButton.cjs"),{useForm:me}=y.Form;function ye({idField:C="id",onCreate:g,onDelete:M,onHide:_,onUpdate:f,fields:l,data:w,grid:D,isHiding:R,isCreating:h,isDeleting:U,isUpdating:q,paginateProps:W,onPrint:N,printing:L,viewable:H,loadingData:G,formBuilder:J,extraAction:K,minusHeight:Q,cloneable:X,fullWidthModal:Y=!0,wizard:i,extraView:Z,importable:P,onClickNew:V,...$}){const{t:v}=le.useTranslation(ie.TRANSLATION_NAMESPACE),[j,x]=o.useState(!1),[p,k]=o.useState(),[z,B]=o.useState(),[c]=me(),A=o.useCallback(async s=>{const u=i?s:await c.validateFields(),r=l.filter(e=>e.type==="color"),a={};r.forEach(e=>{var d;const t=c.getFieldValue(e.name);a[e.name]=typeof t=="string"?t:(d=t==null?void 0:t.toHexString())==null?void 0:d.toUpperCase()}),Object.assign(u,a),p&&f?(await f({...u,[C]:p[C]}),k(void 0)):!p&&g&&await g(u),B(void 0),c.resetFields(),x(!1)},[l,c,C,g,f,p,i]),[ee,I]=o.useState(!1),[te,S]=o.useState(!1);o.useEffect(()=>{j?(I(!1),S(!1)):F(void 0)},[j]);const O=o.useCallback(async s=>{I(s),S(!0)},[]),T=o.useCallback(async()=>{S(!0)},[]),[ne,E]=o.useState(!1),b=o.useCallback(async(s,u=!0,r=!1)=>{try{E(!0),x(!0),u&&F("update");const a={};for(const e of l){const t=s[e.name];if(r&&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(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}c.setFieldsValue(a),B(a),u&&k(s)}finally{E(!1)}},[l,c]),[m,F]=o.useState(),se=o.useCallback(async s=>{F("clone"),b(s,!1,!0)},[b]);return n.jsxs(n.Fragment,{children:[n.jsxs(y.Space,{direction:"vertical",className:"w-100",children:[n.jsxs("div",{className:"w-100 d-flex",children:[n.jsx("div",{style:{flex:1},children:n.jsx(fe.NewButton,{onClick:()=>{V?V():(x(s=>!s),F("new"))},className:"flex-1"})}),n.jsxs(y.Space,{children:[!!N&&n.jsx(pe.PrintButton,{className:"float-right",loading:L,onClick:N}),!!P&&n.jsx(ue,{fields:l,importProps:P})]})]}),n.jsx(de,{...$,minusHeight:Q,data:w,fields:l,extraAction:K,idField:C,isDeleting:U,loadingData:G,onClickUpdate:f?b:void 0,onHide:_,isHiding:R,onDelete:M,onUpdate:f,onClickClone:X?se:void 0,paginateProps:W,viewable:H,extraView:Z})]}),n.jsx(y.Modal,{width:Y?"100%":void 0,title:v(m??"new"),open:j,confirmLoading:h||q,okText:v("str."+(m==="update"?"update":"save")),cancelText:v("str.cancel"),cancelButtonProps:{disabled:te,hidden:!!i},okButtonProps:{disabled:ee,hidden:!!i},onCancel:async()=>{try{if(m==="clone"){const s=i?p:c.getFieldsValue(),u=l.filter(r=>r.type==="image");for(const r of u)s[r.name]&&r.provider.delete(s[r.name])}}finally{}i||c.resetFields(),B(void 0),k(void 0),x(!1)},onOk:()=>A(),destroyOnClose:!0,children:n.jsxs(y.Spin,{spinning:ne,children:[!i&&n.jsx(ce.CrudForm,{purpose:m,fields:l,form:c,formBuilder:J,grid:D,onDeleteFile:T,onUploadFile:O}),i&&n.jsx(re,{submitting:h||q,className:"mt-2",onSave:A,updatingValue:z,fields:l,onDeleteFile:T,onUploadFile:O,purpose:m,wizard:i})]})})]})}module.exports=ye;
|