@kingteza/crud-component 1.0.6 → 1.0.11
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/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/index.js +4 -4
- package/dist/_virtual/index10.cjs +1 -0
- package/dist/_virtual/index10.js +4 -0
- package/dist/_virtual/index2.cjs +1 -1
- package/dist/_virtual/index2.js +2 -5
- package/dist/_virtual/index3.js +2 -2
- package/dist/_virtual/index4.cjs +1 -1
- package/dist/_virtual/index4.js +2 -4
- package/dist/_virtual/index5.js +2 -2
- package/dist/_virtual/index6.cjs +1 -0
- package/dist/_virtual/index6.js +7 -0
- package/dist/_virtual/index7.cjs +1 -0
- package/dist/_virtual/index7.js +7 -0
- package/dist/_virtual/index8.cjs +1 -0
- package/dist/_virtual/index8.js +7 -0
- package/dist/_virtual/index9.cjs +1 -0
- package/dist/_virtual/index9.js +4 -0
- package/dist/_virtual/localeData.cjs +1 -1
- 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/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 +1 -1
- package/dist/src/components/common/DatePicker/TimePicker.cjs +1 -1
- package/dist/src/components/common/DatePicker/TimePicker.js +3 -3
- 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 +10 -10
- 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 +17 -17
- package/dist/src/components/common/button/ExportButton.cjs +1 -1
- package/dist/src/components/common/button/ExportButton.js +16 -16
- package/dist/src/components/common/button/HideButtonTable.cjs +1 -1
- package/dist/src/components/common/button/HideButtonTable.js +18 -18
- 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 +16 -16
- 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 +28 -28
- 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 +13 -13
- package/dist/src/components/common/check-box/CheckBox.cjs +1 -1
- package/dist/src/components/common/description/DescList.cjs +1 -1
- package/dist/src/components/common/layout/VerticalSpace.cjs +1 -1
- package/dist/src/components/common/loading/LoadingIndicator.cjs +1 -1
- package/dist/src/components/common/loading/LoadingIndicator.js +5 -5
- package/dist/src/components/common/picker/ImagePicker.cjs +1 -1
- package/dist/src/components/common/picker/ImagePicker.js +76 -73
- package/dist/src/components/common/radio/RadioGroupComponent.cjs +1 -1
- package/dist/src/components/common/report/SelectFieldInReport.cjs +1 -1
- package/dist/src/components/common/select/CustomSelectOption.cjs +1 -1
- package/dist/src/components/common/select/SelectComponent.cjs +1 -1
- package/dist/src/components/common/select/SelectComponent.js +5 -5
- 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 -11
- package/dist/src/components/common/table/table.cjs +1 -1
- package/dist/src/components/common/tag/StatusTag.cjs +1 -1
- package/dist/src/components/common/tag/StatusTag.js +1 -1
- package/dist/src/components/common/text-field/NumberField.cjs +1 -1
- package/dist/src/components/common/text-field/NumberField.js +7 -7
- 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 +3 -3
- package/dist/src/components/common/text-field/TextField.cjs +1 -1
- package/dist/src/components/common/text-field/TextField.js +34 -34
- package/dist/src/components/common/tooltip/TooltipComponent.cjs +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/crud/CrudComponent.cjs +1 -1
- package/dist/src/components/crud/CrudComponent.js +15 -15
- package/dist/src/components/crud/CrudField.cjs +1 -1
- package/dist/src/components/crud/CrudField.js +22 -22
- package/dist/src/components/crud/CrudForm.js +10 -10
- package/dist/src/components/crud/CrudFormWizard.cjs +1 -1
- package/dist/src/components/crud/CrudFormWizard.js +65 -63
- package/dist/src/components/crud/CrudReportComponent.cjs +3 -3
- package/dist/src/components/crud/CrudReportComponent.js +54 -54
- package/dist/src/components/crud/CrudSearchComponent.cjs +1 -1
- package/dist/src/components/crud/CrudSearchComponent.js +23 -23
- package/dist/src/components/crud/FileCrudField.cjs +1 -1
- package/dist/src/components/crud/FileCrudField.js +101 -94
- package/dist/src/components/crud/ImageCrudField.cjs +1 -1
- package/dist/src/components/crud/ImageCrudField.js +35 -35
- package/dist/src/components/crud/import/CrudImportButton.cjs +1 -1
- package/dist/src/components/crud/import/CrudImportButton.js +12 -12
- package/dist/src/components/crud/import/CrudImportComponent.cjs +2 -2
- package/dist/src/components/crud/import/CrudImportComponent.js +95 -94
- 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 +7 -7
- package/dist/src/components/crud/view/CrudViewerUtil.cjs +1 -1
- package/dist/src/components/crud/view/CrudViewerUtil.js +32 -31
- 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/ImageUtil.js +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 +1 -1
- package/dist/common/index.d.ts +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../../../../_virtual/jsx-runtime.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../../../../_virtual/jsx-runtime.cjs"),l=require("antd"),N=require("react"),O=require("../../../locale/hooks/translation-constants.cjs"),_=require("../tooltip/TooltipComponent.cjs"),w=require("../../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),L=require("../../../../node_modules/@ant-design/icons/es/icons/LoadingOutlined.cjs"),c=(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:u,onEnter:d,size:x,form:p,addonAfter:m,addonBefore:j,nextFocus:E,autoComplete:T="off",defaultValue:g,readOnly:q,value:I,loading:R,onBlur:f,inputRef:v,status:A,autoFocus:C,onChange:D,tooltip:P,...F})=>{const{t:a}=w.useTranslation(O.TRANSLATION_NAMESPACE),M=N.useMemo(()=>{const r=[...s,{required:n,message:`${e??u??""} ${a("err.validation.required")}`}];return t==="email"&&r.push({type:"email",message:a("err.validation.invalidEmail")}),r},[s,n,e,u,a,t]),S={disabled:i,value:I,readOnly:q,defaultValue:g,autoFocus:C,addonBefore:j,ref:v,onBlur:f,addonAfter:R?o.jsxRuntimeExports.jsx(L,{}):m,status:A,size:x,autoComplete:T,onPressEnter:r=>c(r,E,p,d),type:t,placeholder:u??e},h=t=="password"?l.Input.Password:l.Input;return o.jsxRuntimeExports.jsx(_,{title:P,children:o.jsxRuntimeExports.jsx(l.Form.Item,{...F,label:e,rules:M,children:o.jsxRuntimeExports.jsx(h,{...S})})})};exports.default=$;exports.onEnterInternalTextField=c;
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { useMemo as R } from "react";
|
|
5
|
-
import { useTranslation as S } from "react-i18next";
|
|
1
|
+
import { j as i } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { Input as p, Form as M } from "antd";
|
|
3
|
+
import { useMemo as S } from "react";
|
|
6
4
|
import { TRANSLATION_NAMESPACE as $ } from "../../../locale/hooks/translation-constants.js";
|
|
7
5
|
import D from "../tooltip/TooltipComponent.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
import { useTranslation as L } from "../../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
7
|
+
import O from "../../../../node_modules/@ant-design/icons/es/icons/LoadingOutlined.js";
|
|
8
|
+
const _ = (o, n, t, s) => {
|
|
9
|
+
var r;
|
|
10
|
+
n && t && (o.preventDefault(), (r = t == null ? void 0 : t.getFieldInstance(n)) == null || r.focus()), s && s(o);
|
|
11
11
|
}, Q = ({
|
|
12
12
|
type: o,
|
|
13
13
|
required: n,
|
|
14
14
|
label: t,
|
|
15
|
-
disabled:
|
|
16
|
-
rules:
|
|
15
|
+
disabled: s,
|
|
16
|
+
rules: r = [],
|
|
17
17
|
placeholder: m,
|
|
18
|
-
onEnter:
|
|
19
|
-
size:
|
|
20
|
-
form:
|
|
21
|
-
addonAfter:
|
|
22
|
-
addonBefore:
|
|
18
|
+
onEnter: f,
|
|
19
|
+
size: d,
|
|
20
|
+
form: c,
|
|
21
|
+
addonAfter: l,
|
|
22
|
+
addonBefore: u,
|
|
23
23
|
nextFocus: x,
|
|
24
24
|
autoComplete: j = "off",
|
|
25
|
-
defaultValue:
|
|
26
|
-
readOnly:
|
|
25
|
+
defaultValue: I,
|
|
26
|
+
readOnly: T,
|
|
27
27
|
value: A,
|
|
28
28
|
loading: E,
|
|
29
|
-
onBlur:
|
|
29
|
+
onBlur: g,
|
|
30
30
|
inputRef: v,
|
|
31
31
|
status: C,
|
|
32
32
|
autoFocus: P,
|
|
@@ -34,9 +34,9 @@ const _ = (o, n, t, r) => {
|
|
|
34
34
|
tooltip: h,
|
|
35
35
|
...F
|
|
36
36
|
}) => {
|
|
37
|
-
const { t: a } =
|
|
38
|
-
const
|
|
39
|
-
...
|
|
37
|
+
const { t: a } = L($), N = S(() => {
|
|
38
|
+
const e = [
|
|
39
|
+
...r,
|
|
40
40
|
{
|
|
41
41
|
required: n,
|
|
42
42
|
message: `${t ?? m ?? ""} ${a(
|
|
@@ -44,28 +44,28 @@ const _ = (o, n, t, r) => {
|
|
|
44
44
|
)}`
|
|
45
45
|
}
|
|
46
46
|
];
|
|
47
|
-
return o === "email" &&
|
|
47
|
+
return o === "email" && e.push({
|
|
48
48
|
type: "email",
|
|
49
49
|
message: a("err.validation.invalidEmail")
|
|
50
|
-
}),
|
|
51
|
-
}, [
|
|
52
|
-
disabled:
|
|
50
|
+
}), e;
|
|
51
|
+
}, [r, n, t, m, a, o]), R = {
|
|
52
|
+
disabled: s,
|
|
53
53
|
value: A,
|
|
54
|
-
readOnly:
|
|
55
|
-
defaultValue:
|
|
54
|
+
readOnly: T,
|
|
55
|
+
defaultValue: I,
|
|
56
56
|
autoFocus: P,
|
|
57
|
-
addonBefore:
|
|
57
|
+
addonBefore: u,
|
|
58
58
|
ref: v,
|
|
59
|
-
onBlur:
|
|
60
|
-
addonAfter: E ? /* @__PURE__ */
|
|
59
|
+
onBlur: g,
|
|
60
|
+
addonAfter: E ? /* @__PURE__ */ i.jsx(O, {}) : l,
|
|
61
61
|
status: C,
|
|
62
|
-
size:
|
|
62
|
+
size: d,
|
|
63
63
|
autoComplete: j,
|
|
64
|
-
onPressEnter: (
|
|
64
|
+
onPressEnter: (e) => _(e, x, c, f),
|
|
65
65
|
type: o,
|
|
66
66
|
placeholder: m ?? t
|
|
67
|
-
},
|
|
68
|
-
return /* @__PURE__ */
|
|
67
|
+
}, w = o == "password" ? p.Password : p;
|
|
68
|
+
return /* @__PURE__ */ i.jsx(D, { title: h, children: /* @__PURE__ */ i.jsx(M.Item, { ...F, label: t, rules: N, children: /* @__PURE__ */ i.jsx(w, { ...R }) }) });
|
|
69
69
|
};
|
|
70
70
|
export {
|
|
71
71
|
Q as default,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const r=require("../../../../_virtual/jsx-runtime.cjs"),s=require("antd"),e=({children:t,title:o})=>o?r.jsxRuntimeExports.jsx(s.Tooltip,{title:o,children:t}):t;module.exports=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const t=require("../../../../_virtual/jsx-runtime.cjs"),v=require("antd"),o=require("../../../../node_modules/i18next/dist/esm/i18next.cjs"),j=require("../button/Button.cjs"),E=require("../../../locale/hooks/translation-constants.cjs"),q=require("../../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),y=require("../../../../node_modules/@ant-design/icons/es/icons/LoadingOutlined.cjs"),T=require("../../../../node_modules/@ant-design/icons/es/icons/ArrowLeftOutlined.cjs"),A=({errorChildren:a,children:m,onRetry:x,onClickBack:r,success:e,loading:n,error:s,successTitle:p=o.t("str.success"),successMessage:c,errorMessage:u=o.t("err.save"),errorTitle:d=o.t("str.error"),loadingTitle:l=o.t("message.loading.saving"),loadingMessage:R})=>{const{t:i}=q.useTranslation(E.TRANSLATION_NAMESPACE);return t.jsxRuntimeExports.jsx(v.Result,{status:n?void 0:e?"success":s?["403","404","500"].includes(s==null?void 0:s.code)?s.code:s?"error":void 0:void 0,title:n?l:e?p:s?d:void 0,icon:n?t.jsxRuntimeExports.jsx(y,{}):void 0,subTitle:n?R:e?c:s?typeof u=="function"?u()??i("err.save"):u??i("err.save"):void 0,extra:[e?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:m}):s?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[!!r&&t.jsxRuntimeExports.jsx(j,{onClick:r,htmlType:"button",type:"primary",icon:t.jsxRuntimeExports.jsx(T,{}),children:i("str.previous")}),!!x&&t.jsxRuntimeExports.jsx(j,{type:"primary",onClick:()=>x(void 0,void 0,!0),children:i("str.retry")},"retry"),a]}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{})]})};module.exports=A;
|
|
@@ -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 { Result as j } from "antd";
|
|
3
|
+
import { t as e } from "../../../../node_modules/i18next/dist/esm/i18next.js";
|
|
4
|
+
import a from "../button/Button.js";
|
|
5
|
+
import { TRANSLATION_NAMESPACE as y } from "../../../locale/hooks/translation-constants.js";
|
|
6
|
+
import { useTranslation as R } from "../../../../node_modules/react-i18next/dist/es/useTranslation.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 } = R(y);
|
|
24
25
|
return /* @__PURE__ */ t.jsx(
|
|
25
|
-
|
|
26
|
+
j,
|
|
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";
|
|
1
|
+
"use strict";const i=require("../../../../_virtual/jsx-runtime.cjs"),E=require("antd"),o=require("react"),q=require("../appearance/Hider.cjs"),{Step:C}=E.Steps,F=o.forwardRef(({pages:p,onSubmit:l,initPosition:x=0,progressDot:S,type:w,labelPlacement:v,className:b,pageStyle:g},k)=>{const[e,c]=o.useState(0),[r,d]=o.useState([]);o.useEffect(()=>{c(x)},[x]),o.useImperativeHandle(k,()=>({gotTo:t=>c(t)}),[]);const f=o.useCallback((t,u=!1,a=!1)=>{const s=[...r];if(t!==void 0&&(s[e]=t,d(s)),a||c(e+1),u&&l){const n={};for(const h of s)for(const R in h)n[R]=h[R];l(s,n)}},[e,r,l]),m=o.useCallback(()=>{const t=[...r];t[e]=void 0,d(t),c(e-1)},[e,r]),j=o.useMemo(()=>{const t=[],u=[],a=p.filter(s=>!s.hidden);for(let s=0;s<a.length;s++){const n=a[s];u.push(i.jsxRuntimeExports.jsx(q,{hide:e!==s,children:n.component({forward:f,backward:m},r,e===s)},`${n.title}${s}`)),t.push(i.jsxRuntimeExports.jsx(C,{icon:n.icon,title:n.title},n.title))}return{_pages:u,steps:t}},[m,e,r,f,p]);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(E.Steps,{labelPlacement:v,progressDot:S,className:[b,"pb-3"].join(" "),current:e,type:w,children:j.steps}),i.jsxRuntimeExports.jsx("div",{style:g,children:j._pages})]})});module.exports=F;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const s=require("../../../_virtual/jsx-runtime.cjs"),f=require("antd"),ae=require("../../../_virtual/dayjs.min.cjs"),o=require("react"),ie=require("../../locale/hooks/translation-constants.cjs"),le=require("./CrudForm.cjs"),re=require("./CrudFormWizard.cjs"),ce=require("./import/CrudImportButton.cjs"),ue=require("./view/CrudViewer.cjs"),de=require("../common/button/NewButton.cjs"),pe=require("../common/button/PrintButton.cjs"),me=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),{useForm:xe}=f.Form;function fe({idField:j="id",onCreate:F,onDelete:_,onHide:I,onUpdate:p,fields:i,data:M,grid:w,isHiding:D,isCreating:S,isDeleting:U,isUpdating:b,paginateProps:W,onPrint:h,printing:L,viewable:H,loadingData:G,formBuilder:J,extraAction:K,minusHeight:Q,cloneable:X,fullWidthModal:Y=!0,wizard:l,extraView:Z,importable:q,onClickNew:N,...$}){const{t:g}=me.useTranslation(ie.TRANSLATION_NAMESPACE),[v,y]=o.useState(!1),[m,E]=o.useState(),[z,k]=o.useState(),[r]=xe(),P=o.useCallback(async n=>{const u=l?n:await r.validateFields(),c=i.filter(e=>e.type==="color"),a={};c.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(u,a),m&&p?(await p({...u,[j]:m[j]}),E(void 0)):!m&&F&&await F(u),k(void 0),r.resetFields(),y(!1)},[i,r,j,F,p,m,l]),[ee,V]=o.useState(!1),[te,B]=o.useState(!1);o.useEffect(()=>{v?(V(!1),B(!1)):C(void 0)},[v]);const A=o.useCallback(async n=>{V(n),B(!0)},[]),T=o.useCallback(async()=>{B(!0)},[]),[se,O]=o.useState(!1),R=o.useCallback(async(n,u=!0,c=!1)=>{try{O(!0),y(!0),u&&C("update");const a={};for(const e of i){const t=n[e.name];if(c&&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}r.setFieldsValue(a),k(a),u&&E(n)}finally{O(!1)}},[i,r]),[x,C]=o.useState(),ne=o.useCallback(async n=>{C("clone"),R(n,!1,!0)},[R]);return s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs(f.Space,{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(de.NewButton,{onClick:()=>{N?N():(y(n=>!n),C("new"))},className:"flex-1"})}),s.jsxRuntimeExports.jsxs(f.Space,{children:[!!h&&s.jsxRuntimeExports.jsx(pe.PrintButton,{className:"float-right",loading:L,onClick:h}),!!q&&s.jsxRuntimeExports.jsx(ce,{fields:i,importProps:q})]})]}),s.jsxRuntimeExports.jsx(ue,{...$,minusHeight:Q,data:M,fields:i,extraAction:K,idField:j,isDeleting:U,loadingData:G,onClickUpdate:p?R:void 0,onHide:I,isHiding:D,onDelete:_,onUpdate:p,onClickClone:X?ne:void 0,paginateProps:W,viewable:H,extraView:Z})]}),s.jsxRuntimeExports.jsx(f.Modal,{width:Y?"100%":void 0,title:g(x??"new"),open:v,confirmLoading:S||b,okText:g("str."+(x==="update"?"update":"save")),cancelText:g("str.cancel"),cancelButtonProps:{disabled:te,hidden:!!l},okButtonProps:{disabled:ee,hidden:!!l},onCancel:async()=>{try{if(x==="clone"){const n=l?m:r.getFieldsValue(),u=i.filter(c=>c.type==="image");for(const c of u)n[c.name]&&c.provider.delete(n[c.name])}}finally{}l||r.resetFields(),k(void 0),E(void 0),y(!1)},onOk:()=>P(),destroyOnClose:!0,children:s.jsxRuntimeExports.jsxs(f.Spin,{spinning:se,children:[!l&&s.jsxRuntimeExports.jsx(le.CrudForm,{purpose:x,fields:i,form:r,formBuilder:J,grid:w,onDeleteFile:T,onUploadFile:A}),l&&s.jsxRuntimeExports.jsx(re,{submitting:S||b,className:"mt-2",onSave:P,updatingValue:z,fields:i,onDeleteFile:T,onUploadFile:A,purpose:x,wizard:l})]})})]})}module.exports=fe;
|
|
@@ -2,14 +2,14 @@ import { j as o } from "../../../_virtual/jsx-runtime.js";
|
|
|
2
2
|
import { Space as _, Modal as ae, Spin as ie, Form as re } from "antd";
|
|
3
3
|
import ce from "../../../_virtual/dayjs.min.js";
|
|
4
4
|
import { useState as m, useCallback as y, useEffect as me } from "react";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import pe from "./
|
|
9
|
-
import ye from "./
|
|
10
|
-
import xe from "
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
5
|
+
import { TRANSLATION_NAMESPACE as fe } from "../../locale/hooks/translation-constants.js";
|
|
6
|
+
import { CrudForm as de } from "./CrudForm.js";
|
|
7
|
+
import ue from "./CrudFormWizard.js";
|
|
8
|
+
import pe from "./import/CrudImportButton.js";
|
|
9
|
+
import ye from "./view/CrudViewer.js";
|
|
10
|
+
import { NewButton as xe } from "../common/button/NewButton.js";
|
|
11
|
+
import { PrintButton as Fe } from "../common/button/PrintButton.js";
|
|
12
|
+
import { useTranslation as ge } from "../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
13
13
|
const { useForm: je } = re;
|
|
14
14
|
function Oe({
|
|
15
15
|
idField: x = "id",
|
|
@@ -40,7 +40,7 @@ function Oe({
|
|
|
40
40
|
onClickNew: A,
|
|
41
41
|
...z
|
|
42
42
|
}) {
|
|
43
|
-
const { t: v } = fe
|
|
43
|
+
const { t: v } = ge(fe), [C, F] = m(!1), [u, B] = m(), [ee, h] = m(), [i] = je(), E = y(
|
|
44
44
|
async (n) => {
|
|
45
45
|
const c = a ? n : await i.validateFields(), r = l.filter((e) => e.type === "color"), s = {};
|
|
46
46
|
r.forEach((e) => {
|
|
@@ -98,7 +98,7 @@ function Oe({
|
|
|
98
98
|
/* @__PURE__ */ o.jsxs(_, { direction: "vertical", className: "w-100", children: [
|
|
99
99
|
/* @__PURE__ */ o.jsxs("div", { className: "w-100 d-flex", children: [
|
|
100
100
|
/* @__PURE__ */ o.jsx("div", { style: { flex: 1 }, children: /* @__PURE__ */ o.jsx(
|
|
101
|
-
|
|
101
|
+
xe,
|
|
102
102
|
{
|
|
103
103
|
onClick: () => {
|
|
104
104
|
A ? A() : (F((n) => !n), g("new"));
|
|
@@ -108,18 +108,18 @@ function Oe({
|
|
|
108
108
|
) }),
|
|
109
109
|
/* @__PURE__ */ o.jsxs(_, { children: [
|
|
110
110
|
!!V && /* @__PURE__ */ o.jsx(
|
|
111
|
-
|
|
111
|
+
Fe,
|
|
112
112
|
{
|
|
113
113
|
className: "float-right",
|
|
114
114
|
loading: q,
|
|
115
115
|
onClick: V
|
|
116
116
|
}
|
|
117
117
|
),
|
|
118
|
-
!!P && /* @__PURE__ */ o.jsx(
|
|
118
|
+
!!P && /* @__PURE__ */ o.jsx(pe, { fields: l, importProps: P })
|
|
119
119
|
] })
|
|
120
120
|
] }),
|
|
121
121
|
/* @__PURE__ */ o.jsx(
|
|
122
|
-
|
|
122
|
+
ye,
|
|
123
123
|
{
|
|
124
124
|
...z,
|
|
125
125
|
minusHeight: X,
|
|
@@ -175,7 +175,7 @@ function Oe({
|
|
|
175
175
|
destroyOnClose: !0,
|
|
176
176
|
children: /* @__PURE__ */ o.jsxs(ie, { spinning: ne, children: [
|
|
177
177
|
!a && /* @__PURE__ */ o.jsx(
|
|
178
|
-
|
|
178
|
+
de,
|
|
179
179
|
{
|
|
180
180
|
purpose: p,
|
|
181
181
|
fields: l,
|
|
@@ -187,7 +187,7 @@ function Oe({
|
|
|
187
187
|
}
|
|
188
188
|
),
|
|
189
189
|
a && /* @__PURE__ */ o.jsx(
|
|
190
|
-
|
|
190
|
+
ue,
|
|
191
191
|
{
|
|
192
192
|
submitting: S || N,
|
|
193
193
|
className: "mt-2",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../../_virtual/jsx-runtime.cjs"),E=require("antd"),y=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../../_virtual/jsx-runtime.cjs"),E=require("antd"),y=require("react"),H=require("../../../_virtual/main.cjs"),W=require("../../locale/hooks/translation-constants.cjs"),G=require("./FileCrudField.cjs"),$=require("./ImageCrudField.cjs"),z=require("../common/DatePicker/DatePicker.cjs"),J=require("../common/DatePicker/TimePicker.cjs"),K=require("../common/check-box/CheckBox.cjs"),L=require("../common/select/SelectComponent.cjs"),Q=require("../common/text-field/NumberField.cjs"),X=require("../common/text-field/TextField.cjs"),Y=require("../common/text-field/TextArea.cjs"),Z=require("../common/tooltip/TooltipComponent.cjs"),V=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs");function ee(b){const{label:a,name:d,type:C,required:l,hidden:T,rules:x=[],updatable:m=!0,readonly:q=!1,fieldClassName:h,customFormFieldRender:N,fieldTooltip:f,...e}=b,p=E.Form.useFormInstance();y.useEffect(()=>{if(C==="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,C,e==null?void 0:e.updatingValue]);const{t:F}=V.useTranslation(W.TRANSLATION_NAMESPACE);if(q||T)return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{});if(N)return N(p,b);switch(C){case"text":case"email":case"password":{const{onChange:r,placeholder:i}=e;return t.jsxRuntimeExports.jsx(X.default,{placeholder:i,disabled:!m,rules:x,required:l,onChange:r?n=>r(n,p):void 0,type:C,name:d,tooltip:f,label:a,className:h,autoComplete:"new-password"})}case"number":{const{onChange:r,placeholder:i,allowMinus:n}=e;return t.jsxRuntimeExports.jsx(Q,{placeholder:i,disabled:!m,moneyField:!!e.formatted,type:C,onChange:r?j=>r(j,p):void 0,rules:x,autoComplete:"false",required:l,tooltip:f,className:h,min:n?null:void 0,name:d,label:a})}case"date":{const{range:r,disableToday:i,disabledFutureDays:n,disabledPastDays:j,onChange:g,placeholder:c,format:v}=e;return t.jsxRuntimeExports.jsx(z,{placeholder:c,required:l,disabled:!m,type:C,format:v,tooltip:f,range:r,name:d,label:a,onChange:g?o=>g(o,p):void 0,className:h,disableToday:i,disabledFutureDays:n,disabledPastDays:j})}case"time":{const{range:r=!1,disableCurrent:i,disabledFuture:n,disabledPast:j,onChange:g,use12Hours:c,format:v,placeholder:o}=e;return t.jsxRuntimeExports.jsx(J,{placeholder:o,required:l,format:v,disabled:!m,type:C,tooltip:f,range:r,use12Hours:c,name:d,label:a,onChange:g?R=>g(R,p):void 0,className:h,disableCurrent:i,disabledFuture:n,disabledPast:j})}case"textarea":{const{onChange:r,placeholder:i,rows:n,cols:j}=e;return t.jsxRuntimeExports.jsx(Y.default,{rules:x,placeholder:i,onChange:r?g=>{var c;return r((c=g==null?void 0:g.target)==null?void 0:c.value,p)}:void 0,tooltip:f,required:l,disabled:!m,name:d,label:a,className:h,rows:n,cols:j})}case"image":return t.jsxRuntimeExports.jsx($.default,{...e,required:l,name:d,label:a,rules:x,fieldClassName:h,onRemoved:e.onRemoved,onUploading:e.onUploading,provider:e.provider});case"file":return t.jsxRuntimeExports.jsx(G.default,{...e,required:l,name:d,label:a,rules:x,fieldClassName:h,onRemoved:e.onRemoved,onUploading:e.onUploading,provider:e.provider});case"select":return t.jsxRuntimeExports.jsx(B,{...e,required:l,name:d,label:a,rules:x,fieldClassName:h,form:p,updatable:m,readonly:q,fieldTooltip:f});case"enum":{const{enum:r,radio:i=!1,translation:n,onChange:j,onSearch:g,multiple:c}=e,v=Array.isArray(r)?r:Object.keys(r);return i?t.jsxRuntimeExports.jsx(E.Form.Item,{...e,name:d,required:l,tooltip:f,rules:x,label:a,className:["w-100",h].join(" "),children:t.jsxRuntimeExports.jsx(E.Radio.Group,{...e,onChange:j?o=>{var R;return j((R=o==null?void 0:o.target)==null?void 0:R.value,p)}:void 0,children:v.map(o=>t.jsxRuntimeExports.jsx(E.Radio,{disabled:!m,value:o,children:n?F(n[o]):o},o))})}):t.jsxRuntimeExports.jsx(L,{...e,onChange:j?o=>j(o,p):void 0,className:["w-100",h].join(" "),name:d,items:v,required:l,tooltip:f,rules:x,label:a,disabled:!m,onSearch:g?o=>g(o,p):void 0,allowClear:!0,mode:c?"multiple":void 0,itemBuilder:o=>t.jsxRuntimeExports.jsx(E.Select.Option,{value:o,children:n?F(n[o]):o},o)})}case"checkbox":{const{onChange:r}=e;return t.jsxRuntimeExports.jsx(K,{className:h,rules:x,onChange:r?i=>r(i,p):void 0,label:a,tooltip:f,disabled:!m,name:d})}case"color":return t.jsxRuntimeExports.jsx(M,{...e,type:"color",required:l,name:d,label:a,rules:x,fieldClassName:h,updatable:m,readonly:q,fieldTooltip:f});default:return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:`${C} Not Implemented`})}}function B(b){const{items:a=[],loading:d,searchOnType:C,onSearch:l,multiple:T,onChange:x,highlightSearch:m,required:q,fieldClassName:h,rules:N,fieldTooltip:f,updatable:e,label:p,name:F,tagRender:r,updatingValue:i,onSet:n,placeholder:j,allowClear:g=!0}=b,c=b.form,[v,o]=y.useState(""),R=E.Form.useWatch(F,c),[S,w]=y.useState(!0);y.useEffect(()=>{n&&S&&R&&(n==null||n(R,a,c),w(!1))},[S,c,a,F,n,R]),y.useEffect(()=>{R&&w(!0)},[R]);const U=y.useCallback(async s=>{o(s),C&&(l==null||l(s,c,i))},[c,l,C,i]);return t.jsxRuntimeExports.jsx(L,{...b,maxTagCount:"responsive",maxTagPlaceholder:s=>t.jsxRuntimeExports.jsxs(Z,{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:j,onSelect:s=>{n==null||n(s==null?void 0:s.key,a,c)},onChange:x?s=>{o(""),x(s,c)}:void 0,mode:T?"multiple":void 0,className:["w-100",h].join(" "),name:F,items:a,required:q,tooltip:f,tagRender:r,rules:N,disabled:!e,label:p,allowClear:g,onSearch:U,loading:d,filterOption:m?(s,u)=>{var k,O,P;try{const A=s.toLowerCase().split(/\s+/),_=((typeof(u==null?void 0:u.children)=="string"?u==null?void 0:u.children:(O=(k=u==null?void 0:u.children)==null?void 0:k.props)==null?void 0:O.textToHighlight)??"").toLowerCase(),D=(((P=u==null?void 0:u.value)==null?void 0:P.toString())??"").toLowerCase();return A.every(I=>_.indexOf(I)>=0||D.indexOf(I)>=0)}catch{return!0}}:void 0,itemBuilder:m?s=>{const u=s.value?String(s.value):void 0;return t.jsxRuntimeExports.jsx(E.Select.Option,{value:s.key,title:u,disabled:s.disabled,children:t.jsxRuntimeExports.jsx(H,{highlightClassName:"highlight-text",searchWords:(v??"").split(" "),autoEscape:!0,textToHighlight:u??""})},s.key)}:s=>t.jsxRuntimeExports.jsx(E.Select.Option,{value:s.key,title:s.value,disabled:s.disabled,children:s.value},s.key)})}function M(b){const{required:a,fieldClassName:d,rules:C,fieldTooltip:l,updatable:T,label:x,name:m}=b;return t.jsxRuntimeExports.jsx(E.Form.Item,{label:x,name:m,required:a,rules:C,tooltip:l,children:t.jsxRuntimeExports.jsx(E.ColorPicker,{disabledAlpha:!0,format:"hex",defaultFormat:"hex",showText:!0,trigger:"click",className:d,disabled:!T,...b.innerProps})})}exports.ColorCrudFieldComponent=M;exports.SelectCrudFieldComponent=B;exports.default=ee;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { j as t } from "../../../_virtual/jsx-runtime.js";
|
|
2
2
|
import { Form as k, Radio as H, Select as O, ColorPicker as _ } from "antd";
|
|
3
3
|
import { useEffect as R, useState as U, useCallback as G } from "react";
|
|
4
|
-
import $ from "
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import K from "./
|
|
8
|
-
import Q from "
|
|
9
|
-
import X from "../common/DatePicker/
|
|
10
|
-
import Y from "../common/
|
|
11
|
-
import Z from "../common/check-box/CheckBox.js";
|
|
4
|
+
import $ from "../../../_virtual/main.js";
|
|
5
|
+
import { TRANSLATION_NAMESPACE as z } from "../../locale/hooks/translation-constants.js";
|
|
6
|
+
import J from "./FileCrudField.js";
|
|
7
|
+
import K from "./ImageCrudField.js";
|
|
8
|
+
import Q from "../common/DatePicker/DatePicker.js";
|
|
9
|
+
import X from "../common/DatePicker/TimePicker.js";
|
|
10
|
+
import Y from "../common/check-box/CheckBox.js";
|
|
12
11
|
import q from "../common/select/SelectComponent.js";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
12
|
+
import Z from "../common/text-field/NumberField.js";
|
|
13
|
+
import V from "../common/text-field/TextField.js";
|
|
14
|
+
import ee from "../common/text-field/TextArea.js";
|
|
15
|
+
import te from "../common/tooltip/TooltipComponent.js";
|
|
16
|
+
import { useTranslation as re } from "../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
17
17
|
function ve(v) {
|
|
18
18
|
const {
|
|
19
19
|
label: i,
|
|
@@ -39,7 +39,7 @@ function ve(v) {
|
|
|
39
39
|
!(o != null && o.length) && !a && (n == null || n(void 0, p, e == null ? void 0 : e.updatingValue));
|
|
40
40
|
}
|
|
41
41
|
}, [p, e, x, e == null ? void 0 : e.updatingValue]);
|
|
42
|
-
const { t: F } = z
|
|
42
|
+
const { t: F } = re(z);
|
|
43
43
|
if (N || T) return /* @__PURE__ */ t.jsx(t.Fragment, {});
|
|
44
44
|
if (w)
|
|
45
45
|
return w(p, v);
|
|
@@ -49,7 +49,7 @@ function ve(v) {
|
|
|
49
49
|
case "password": {
|
|
50
50
|
const { onChange: o, placeholder: n } = e;
|
|
51
51
|
return /* @__PURE__ */ t.jsx(
|
|
52
|
-
|
|
52
|
+
V,
|
|
53
53
|
{
|
|
54
54
|
placeholder: n,
|
|
55
55
|
disabled: !h,
|
|
@@ -68,7 +68,7 @@ function ve(v) {
|
|
|
68
68
|
case "number": {
|
|
69
69
|
const { onChange: o, placeholder: n, allowMinus: a } = e;
|
|
70
70
|
return /* @__PURE__ */ t.jsx(
|
|
71
|
-
|
|
71
|
+
Z,
|
|
72
72
|
{
|
|
73
73
|
placeholder: n,
|
|
74
74
|
disabled: !h,
|
|
@@ -97,7 +97,7 @@ function ve(v) {
|
|
|
97
97
|
format: y
|
|
98
98
|
} = e;
|
|
99
99
|
return /* @__PURE__ */ t.jsx(
|
|
100
|
-
|
|
100
|
+
Q,
|
|
101
101
|
{
|
|
102
102
|
placeholder: c,
|
|
103
103
|
required: s,
|
|
@@ -128,7 +128,7 @@ function ve(v) {
|
|
|
128
128
|
placeholder: l
|
|
129
129
|
} = e;
|
|
130
130
|
return /* @__PURE__ */ t.jsx(
|
|
131
|
-
|
|
131
|
+
X,
|
|
132
132
|
{
|
|
133
133
|
placeholder: l,
|
|
134
134
|
required: s,
|
|
@@ -151,7 +151,7 @@ function ve(v) {
|
|
|
151
151
|
case "textarea": {
|
|
152
152
|
const { onChange: o, placeholder: n, rows: a, cols: f } = e;
|
|
153
153
|
return /* @__PURE__ */ t.jsx(
|
|
154
|
-
|
|
154
|
+
ee,
|
|
155
155
|
{
|
|
156
156
|
rules: u,
|
|
157
157
|
placeholder: n,
|
|
@@ -172,7 +172,7 @@ function ve(v) {
|
|
|
172
172
|
}
|
|
173
173
|
case "image":
|
|
174
174
|
return /* @__PURE__ */ t.jsx(
|
|
175
|
-
|
|
175
|
+
K,
|
|
176
176
|
{
|
|
177
177
|
...e,
|
|
178
178
|
required: s,
|
|
@@ -187,7 +187,7 @@ function ve(v) {
|
|
|
187
187
|
);
|
|
188
188
|
case "file":
|
|
189
189
|
return /* @__PURE__ */ t.jsx(
|
|
190
|
-
|
|
190
|
+
J,
|
|
191
191
|
{
|
|
192
192
|
...e,
|
|
193
193
|
required: s,
|
|
@@ -270,7 +270,7 @@ function ve(v) {
|
|
|
270
270
|
case "checkbox": {
|
|
271
271
|
const { onChange: o } = e;
|
|
272
272
|
return /* @__PURE__ */ t.jsx(
|
|
273
|
-
|
|
273
|
+
Y,
|
|
274
274
|
{
|
|
275
275
|
className: g,
|
|
276
276
|
rules: u,
|
|
@@ -341,7 +341,7 @@ function oe(v) {
|
|
|
341
341
|
...v,
|
|
342
342
|
maxTagCount: "responsive",
|
|
343
343
|
maxTagPlaceholder: (r) => /* @__PURE__ */ t.jsxs(
|
|
344
|
-
|
|
344
|
+
te,
|
|
345
345
|
{
|
|
346
346
|
title: /* @__PURE__ */ t.jsx(t.Fragment, { children: r.map((d) => /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
347
347
|
d.label,
|
|
@@ -2,18 +2,18 @@ import { j as t } from "../../../_virtual/jsx-runtime.js";
|
|
|
2
2
|
import x, { useMemo as h, createElement as o, useCallback as p } from "react";
|
|
3
3
|
import { Form as j, Col as b, Input as g, Row as A } from "antd";
|
|
4
4
|
import l from "./CrudField.js";
|
|
5
|
-
function
|
|
5
|
+
function _({
|
|
6
6
|
form: d,
|
|
7
|
-
purpose:
|
|
7
|
+
purpose: u = "new",
|
|
8
8
|
...i
|
|
9
9
|
}) {
|
|
10
|
-
return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsx(j, { form: d, layout: "vertical", children: /* @__PURE__ */ t.jsx(C, { ...i, purpose:
|
|
10
|
+
return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsx(j, { form: d, layout: "vertical", children: /* @__PURE__ */ t.jsx(C, { ...i, purpose: u }) }) });
|
|
11
11
|
}
|
|
12
12
|
function C({
|
|
13
13
|
fields: d,
|
|
14
|
-
formBuilder:
|
|
14
|
+
formBuilder: u,
|
|
15
15
|
grid: i,
|
|
16
|
-
onDeleteFile:
|
|
16
|
+
onDeleteFile: s,
|
|
17
17
|
onUploadFile: c,
|
|
18
18
|
purpose: m
|
|
19
19
|
}) {
|
|
@@ -26,7 +26,7 @@ function C({
|
|
|
26
26
|
},
|
|
27
27
|
onDelete: (a) => {
|
|
28
28
|
var n;
|
|
29
|
-
r.onUploading && ((n = r.onDelete) == null || n.call(r, a)),
|
|
29
|
+
r.onUploading && ((n = r.onDelete) == null || n.call(r, a)), s == null || s(a);
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
return /* @__PURE__ */ t.jsx(x.Fragment, { children: r.grid && i ? /* @__PURE__ */ t.jsx(b, { ...r.grid, children: /* @__PURE__ */ o(
|
|
@@ -47,7 +47,7 @@ function C({
|
|
|
47
47
|
}
|
|
48
48
|
) }, r.name);
|
|
49
49
|
}),
|
|
50
|
-
[d, i,
|
|
50
|
+
[d, i, s, c, m]
|
|
51
51
|
), y = p(
|
|
52
52
|
(r, e = {}) => {
|
|
53
53
|
const a = d.find((n) => n.name === r);
|
|
@@ -68,8 +68,8 @@ function C({
|
|
|
68
68
|
},
|
|
69
69
|
[d, m]
|
|
70
70
|
);
|
|
71
|
-
return /* @__PURE__ */ t.jsx(t.Fragment, { children:
|
|
72
|
-
|
|
71
|
+
return /* @__PURE__ */ t.jsx(t.Fragment, { children: u ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
72
|
+
u(y, {
|
|
73
73
|
isAnyFieldHidden(...r) {
|
|
74
74
|
const e = Array.isArray(r) ? r : [r];
|
|
75
75
|
return d.filter((n) => e.includes(n.name)).some((n) => n.hidden);
|
|
@@ -86,6 +86,6 @@ function C({
|
|
|
86
86
|
] }) : i ? /* @__PURE__ */ t.jsx(A, { gutter: [8, 8], children: f }) : f });
|
|
87
87
|
}
|
|
88
88
|
export {
|
|
89
|
-
|
|
89
|
+
_ as CrudForm,
|
|
90
90
|
C as CrudFormFields
|
|
91
91
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const e=require("../../../_virtual/jsx-runtime.cjs"),c=require("antd"),f=require("react"),F=require("../../locale/hooks/translation-constants.cjs"),q=require("./CrudForm.cjs"),g=require("../common/button/Button.cjs"),b=require("../common/wizard/WizardViewForm.cjs"),C=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),k=require("../../../node_modules/@ant-design/icons/es/icons/LeftOutlined.cjs"),S=require("../../../node_modules/@ant-design/icons/es/icons/SaveOutlined.cjs"),y=require("../../../node_modules/@ant-design/icons/es/icons/RightOutlined.cjs");function T({fields:x,className:d,onDeleteFile:a,onUploadFile:i,purpose:u,wizard:r=[],updatingValue:j,onSave:h,submitting:R}){const l=f.useMemo(()=>r.map(n=>{let t=!0;const s=x.filter(o=>n.fields.includes(o.name));return s.forEach(o=>t&&(t=o.hidden??!1)),{...n,hidden:t,fieldThatShouldShowing:s}}),[x,r]),m=f.useMemo(()=>l.filter(n=>!n.hidden),[l]);return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(b,{onSubmit:(n,t)=>{console.log(t),h(t)},className:d,pages:m.map(({title:n,icon:t,fieldThatShouldShowing:s,hidden:o},E)=>({title:n,icon:t,hidden:o,component:p=>e.jsxRuntimeExports.jsx(v,{fields:s,onDeleteFile:a,onUploadFile:i,purpose:u,i:E,updatingValue:j,backward:p.backward,forward:p.forward,wizard:m,submitting:R},E)}))})})}function v({fields:x,onDeleteFile:d,onUploadFile:a,purpose:i,wizard:u=[],i:r,forward:j,backward:h,submitting:R,updatingValue:l}){const m=u[r],{t:n}=C.useTranslation(F.TRANSLATION_NAMESPACE),[t]=c.Form.useForm();return f.useEffect(()=>{if(l&&(i==="update"||i==="clone")){const s={};for(const o of x)s[o.name]=l[o.name];t.setFieldsValue(s)}},[x,t,i,l]),e.jsxRuntimeExports.jsxs(c.Form,{name:String(r),form:t,layout:"vertical",children:[e.jsxRuntimeExports.jsx(q.CrudFormFields,{fields:x,formBuilder:m.formBuilder,grid:m.grid,onDeleteFile:d,onUploadFile:a,purpose:i}),e.jsxRuntimeExports.jsx(c.Divider,{}),e.jsxRuntimeExports.jsxs(c.Row,{gutter:[8,8],children:[r>0&&e.jsxRuntimeExports.jsx(c.Col,{md:12,children:e.jsxRuntimeExports.jsx(g,{block:!0,icon:e.jsxRuntimeExports.jsx(k,{}),htmlType:"button",type:"default",size:"large",onClick:()=>h(),children:n("str.back")})}),e.jsxRuntimeExports.jsx(c.Col,{md:r>0?12:24,children:e.jsxRuntimeExports.jsx(g,{block:!0,icon:u.length-1===r?e.jsxRuntimeExports.jsx(S,{}):e.jsxRuntimeExports.jsx(y,{}),htmlType:"submit",type:"primary",loading:R,size:"large",onClick:()=>{t.validateFields().then(s=>{j(s,u.length-1===r,u.length-1===r)})},children:u.length-1===r?n("str."+(i==="update"?"update":"save")):n("str.next")})})]})]})}module.exports=T;
|