@kingteza/crud-component 1.0.5 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/ShowMoreText.cjs +1 -1
- package/dist/_virtual/advancedFormat.cjs +1 -1
- package/dist/_virtual/customParseFormat.cjs +1 -1
- package/dist/_virtual/dayjs.min.cjs +1 -1
- package/dist/_virtual/index.cjs +1 -1
- package/dist/_virtual/index10.cjs +1 -1
- package/dist/_virtual/index10.js +5 -2
- package/dist/_virtual/index11.cjs +1 -0
- package/dist/_virtual/index11.js +7 -0
- package/dist/_virtual/index12.cjs +1 -0
- package/dist/_virtual/index12.js +4 -0
- package/dist/_virtual/index13.cjs +1 -0
- package/dist/_virtual/index13.js +4 -0
- package/dist/_virtual/index2.cjs +1 -1
- package/dist/_virtual/index2.js +3 -2
- package/dist/_virtual/index3.cjs +1 -1
- package/dist/_virtual/index3.js +5 -2
- package/dist/_virtual/index4.js +2 -2
- package/dist/_virtual/index5.cjs +1 -1
- package/dist/_virtual/index5.js +2 -5
- package/dist/_virtual/index6.cjs +1 -1
- package/dist/_virtual/index6.js +4 -2
- package/dist/_virtual/index7.cjs +1 -1
- package/dist/_virtual/index7.js +2 -5
- package/dist/_virtual/index8.cjs +1 -1
- package/dist/_virtual/index8.js +2 -7
- package/dist/_virtual/index9.cjs +1 -1
- package/dist/_virtual/index9.js +5 -2
- package/dist/_virtual/localeData.cjs +1 -1
- package/dist/_virtual/main.cjs +1 -1
- package/dist/_virtual/papaparse.min.cjs +1 -1
- package/dist/_virtual/react-is.development2.cjs +1 -0
- package/dist/_virtual/react-is.development2.js +4 -0
- package/dist/_virtual/react-is.production.min2.cjs +1 -0
- package/dist/_virtual/react-is.production.min2.js +4 -0
- package/dist/_virtual/weekOfYear.cjs +1 -1
- package/dist/_virtual/weekYear.cjs +1 -1
- package/dist/_virtual/weekday.cjs +1 -1
- package/dist/common/index.cjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/src/components/common/DatePicker/DatePicker.cjs +1 -1
- package/dist/src/components/common/DatePicker/DatePicker.js +23 -22
- package/dist/src/components/common/DatePicker/TimePicker.cjs +1 -1
- package/dist/src/components/common/DatePicker/TimePicker.js +13 -12
- package/dist/src/components/common/appearance/Hider.cjs +1 -1
- package/dist/src/components/common/button/Button.cjs +1 -1
- package/dist/src/components/common/button/Button.js +28 -27
- package/dist/src/components/common/button/CloneButtonTable.cjs +1 -1
- package/dist/src/components/common/button/CloneButtonTable.js +3 -3
- package/dist/src/components/common/button/DeleteButtonTable.cjs +1 -1
- package/dist/src/components/common/button/DeleteButtonTable.js +7 -7
- package/dist/src/components/common/button/ExportButton.cjs +1 -1
- package/dist/src/components/common/button/ExportButton.js +5 -5
- package/dist/src/components/common/button/HideButtonTable.cjs +1 -1
- package/dist/src/components/common/button/HideButtonTable.js +7 -7
- package/dist/src/components/common/button/ImportButton.cjs +1 -1
- package/dist/src/components/common/button/ImportButton.js +5 -5
- package/dist/src/components/common/button/NewButton.cjs +1 -1
- package/dist/src/components/common/button/NewButton.js +5 -5
- package/dist/src/components/common/button/PrintButton.cjs +1 -1
- package/dist/src/components/common/button/PrintButton.js +5 -5
- package/dist/src/components/common/button/RefreshButton.cjs +1 -1
- package/dist/src/components/common/button/RefreshButton.js +5 -5
- package/dist/src/components/common/button/UnHideButton.cjs +1 -1
- package/dist/src/components/common/button/UnHideButton.js +7 -7
- package/dist/src/components/common/button/UpdateButtonTable.cjs +1 -1
- package/dist/src/components/common/button/UpdateButtonTable.js +5 -5
- package/dist/src/components/common/button/ViewButtonTable.cjs +1 -1
- package/dist/src/components/common/button/ViewButtonTable.js +5 -5
- package/dist/src/components/common/check-box/CheckBox.cjs +1 -1
- package/dist/src/components/common/check-box/CheckBox.js +17 -15
- package/dist/src/components/common/description/DescList.cjs +1 -1
- package/dist/src/components/common/description/DescList.js +1 -1
- package/dist/src/components/common/layout/VerticalSpace.cjs +1 -1
- package/dist/src/components/common/layout/VerticalSpace.js +1 -1
- package/dist/src/components/common/loading/LoadingIndicator.cjs +1 -1
- package/dist/src/components/common/loading/LoadingIndicator.js +9 -8
- package/dist/src/components/common/picker/ImagePicker.cjs +1 -1
- package/dist/src/components/common/picker/ImagePicker.js +42 -40
- package/dist/src/components/common/radio/RadioGroupComponent.cjs +1 -1
- package/dist/src/components/common/radio/RadioGroupComponent.js +17 -16
- package/dist/src/components/common/report/SelectFieldInReport.cjs +1 -1
- package/dist/src/components/common/report/SelectFieldInReport.js +17 -16
- package/dist/src/components/common/select/CustomSelectOption.cjs +1 -1
- package/dist/src/components/common/select/CustomSelectOption.js +1 -1
- package/dist/src/components/common/select/SelectComponent.cjs +1 -1
- package/dist/src/components/common/select/SelectComponent.js +36 -33
- package/dist/src/components/common/show-more/index.cjs +1 -1
- package/dist/src/components/common/tab/TabViewWithRoute.cjs +1 -1
- package/dist/src/components/common/tab/TabViewWithRoute.js +15 -14
- package/dist/src/components/common/table/table.cjs +1 -1
- package/dist/src/components/common/table/table.js +16 -16
- package/dist/src/components/common/tag/StatusTag.cjs +1 -1
- package/dist/src/components/common/tag/StatusTag.js +4 -4
- package/dist/src/components/common/text/index.cjs +1 -1
- package/dist/src/components/common/text/index.js +1 -1
- package/dist/src/components/common/text/title/index.cjs +1 -1
- package/dist/src/components/common/text/title/index.js +1 -1
- package/dist/src/components/common/text-field/NumberField.cjs +1 -1
- package/dist/src/components/common/text-field/NumberField.js +20 -19
- package/dist/src/components/common/text-field/PhoneNumberField.cjs +1 -1
- package/dist/src/components/common/text-field/TextArea.cjs +1 -1
- package/dist/src/components/common/text-field/TextArea.js +19 -18
- package/dist/src/components/common/text-field/TextField.cjs +1 -1
- package/dist/src/components/common/text-field/TextField.js +22 -21
- package/dist/src/components/common/tooltip/TooltipComponent.cjs +1 -1
- package/dist/src/components/common/tooltip/TooltipComponent.js +1 -1
- package/dist/src/components/common/wizard/WizardResult.cjs +1 -1
- package/dist/src/components/common/wizard/WizardResult.js +5 -5
- package/dist/src/components/common/wizard/WizardViewForm.cjs +1 -1
- package/dist/src/components/common/wizard/WizardViewForm.js +1 -1
- package/dist/src/components/crud/CrudComponent.cjs +1 -1
- package/dist/src/components/crud/CrudComponent.js +74 -71
- package/dist/src/components/crud/CrudField.cjs +1 -1
- package/dist/src/components/crud/CrudField.js +96 -93
- package/dist/src/components/crud/CrudForm.cjs +1 -1
- package/dist/src/components/crud/CrudForm.js +30 -27
- package/dist/src/components/crud/CrudFormWizard.cjs +1 -1
- package/dist/src/components/crud/CrudFormWizard.js +57 -54
- package/dist/src/components/crud/CrudReportComponent.cjs +3 -3
- package/dist/src/components/crud/CrudReportComponent.js +51 -47
- package/dist/src/components/crud/CrudSearchComponent.cjs +1 -1
- package/dist/src/components/crud/CrudSearchComponent.js +23 -21
- package/dist/src/components/crud/FileCrudField.cjs +1 -1
- package/dist/src/components/crud/FileCrudField.js +31 -29
- package/dist/src/components/crud/ImageCrudField.cjs +1 -1
- package/dist/src/components/crud/ImageCrudField.js +46 -43
- package/dist/src/components/crud/import/CrudImportButton.cjs +1 -1
- package/dist/src/components/crud/import/CrudImportButton.js +7 -7
- package/dist/src/components/crud/import/CrudImportComponent.cjs +2 -2
- package/dist/src/components/crud/import/CrudImportComponent.js +64 -60
- package/dist/src/components/crud/view/CrudDecListView.cjs +1 -1
- package/dist/src/components/crud/view/CrudDecListView.js +5 -5
- package/dist/src/components/crud/view/CrudViewer.cjs +1 -1
- package/dist/src/components/crud/view/CrudViewer.js +25 -25
- package/dist/src/components/crud/view/CrudViewerUtil.cjs +1 -1
- package/dist/src/components/crud/view/CrudViewerUtil.js +18 -17
- package/dist/src/context/WindowDimension.cjs +1 -1
- package/dist/src/locale/index.cjs +1 -1
- package/dist/src/locale/index.js +2 -2
- package/dist/src/locale/translations/en.cjs +1 -1
- package/dist/src/util/DateUtil.cjs +1 -1
- package/dist/src/util/DateUtil.js +4 -4
- package/dist/src/util/ImageUtil.cjs +1 -1
- package/dist/src/util/ValidationUtil.cjs +1 -1
- package/dist/src/util/ValidationUtil.js +1 -1
- package/dist/util/index.cjs +1 -1
- package/package.json +7 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as f } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
2
|
+
import { TRANSLATION_NAMESPACE as x } from "../../../locale/hooks/translation-constants.js";
|
|
3
|
+
import { useTranslation as T } from "react-i18next";
|
|
4
|
+
import A from "../../../../node_modules/antd/es/tag/index.js";
|
|
5
5
|
const C = ({
|
|
6
6
|
onClick: e,
|
|
7
7
|
clickable: m,
|
|
@@ -10,7 +10,7 @@ const C = ({
|
|
|
10
10
|
value: r
|
|
11
11
|
}) => {
|
|
12
12
|
var s;
|
|
13
|
-
const t = o == null ? void 0 : o(r), { t: i } =
|
|
13
|
+
const t = o == null ? void 0 : o(r), { t: i } = T(x), n = A;
|
|
14
14
|
return /* @__PURE__ */ f.jsx(
|
|
15
15
|
n,
|
|
16
16
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("antd"),{Text:t}=e.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../node_modules/antd/es/typography/index.cjs"),{Text:t}=e.default;exports.Text=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("antd"),{Title:t}=e.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../../node_modules/antd/es/typography/index.cjs"),{Title:t}=e.default;exports.Title=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../../../../_virtual/jsx-runtime.cjs"),x=require("react"),_=require("react-i18next"),h=require("../../../locale/hooks/translation-constants.cjs"),v=require("../tooltip/TooltipComponent.cjs"),w=require("./TextField.cjs"),B=require("../../../../node_modules/antd/es/form/index.cjs"),O=require("../../../../node_modules/antd/es/input-number/index.cjs"),b=x.forwardRef(function({type:F,required:o,label:t,rules:u=[],placeholder:r,onEnter:p,form:l,nextFocus:m,min:d,moneyField:n,addonAfter:f,minLength:j,defaultValue:q,pattern:T,disabled:E,readOnly:R,onChange:g,value:$,max:N,addonBefore:A,size:I,isInt:c=!1,tooltip:M,...S},C){const{t:a}=_.useTranslation(h.TRANSLATION_NAMESPACE),P=x.useMemo(()=>[...u,{required:o,message:`${t??r??""} ${a("err.validation.required")}`}],[u,t,r,a,o]);return i.jsxRuntimeExports.jsx(v.default,{title:M,children:i.jsxRuntimeExports.jsx(B.default.Item,{...S,label:t,rules:P,children:i.jsxRuntimeExports.jsx(O.default,{ref:C,disabled:E,defaultValue:q,value:$,readOnly:R,addonBefore:A,minLength:j,addonAfter:f,step:c?1:void 0,pattern:c?"d*":T,onChange:g,onPressEnter:e=>w.onEnterInternalTextField(e,m,l,p),className:"max-width",min:d===null?void 0:d??0,max:N,type:n?void 0:"number",size:I,formatter:n?e=>{if(e.includes(".")){const s=`${e}`.split(".");return s[0]=s[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),s.join(".")}else return`${e}`.replace(/\B(?=(\d{3})+(?!\d))/g,",")}:void 0,parser:n?e=>e==null?void 0:e.replace(/\$\s?|(,*)/g,""):void 0,placeholder:r??t})})})});exports.default=b;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { j as s } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { TRANSLATION_NAMESPACE as
|
|
5
|
-
import
|
|
6
|
-
import { onEnterInternalTextField as
|
|
7
|
-
import
|
|
8
|
-
|
|
2
|
+
import { forwardRef as M, useMemo as P } from "react";
|
|
3
|
+
import { useTranslation as S } from "react-i18next";
|
|
4
|
+
import { TRANSLATION_NAMESPACE as y } from "../../../locale/hooks/translation-constants.js";
|
|
5
|
+
import F from "../tooltip/TooltipComponent.js";
|
|
6
|
+
import { onEnterInternalTextField as L } from "./TextField.js";
|
|
7
|
+
import O from "../../../../node_modules/antd/es/form/index.js";
|
|
8
|
+
import _ from "../../../../node_modules/antd/es/input-number/index.js";
|
|
9
|
+
const Q = M(
|
|
9
10
|
function({
|
|
10
11
|
// eslint-disable-next-line no-unused-vars
|
|
11
|
-
type:
|
|
12
|
+
type: k,
|
|
12
13
|
required: i,
|
|
13
14
|
label: t,
|
|
14
15
|
rules: m = [],
|
|
@@ -19,9 +20,9 @@ const K = S(
|
|
|
19
20
|
min: p,
|
|
20
21
|
moneyField: e,
|
|
21
22
|
addonAfter: x,
|
|
22
|
-
minLength:
|
|
23
|
-
defaultValue:
|
|
24
|
-
pattern:
|
|
23
|
+
minLength: T,
|
|
24
|
+
defaultValue: j,
|
|
25
|
+
pattern: N,
|
|
25
26
|
disabled: E,
|
|
26
27
|
readOnly: $,
|
|
27
28
|
onChange: g,
|
|
@@ -33,7 +34,7 @@ const K = S(
|
|
|
33
34
|
tooltip: h,
|
|
34
35
|
...w
|
|
35
36
|
}, B) {
|
|
36
|
-
const { t: f } =
|
|
37
|
+
const { t: f } = S(y), C = P(
|
|
37
38
|
() => [
|
|
38
39
|
...m,
|
|
39
40
|
{
|
|
@@ -45,21 +46,21 @@ const K = S(
|
|
|
45
46
|
],
|
|
46
47
|
[m, t, o, f, i]
|
|
47
48
|
);
|
|
48
|
-
return /* @__PURE__ */ s.jsx(
|
|
49
|
-
|
|
49
|
+
return /* @__PURE__ */ s.jsx(F, { title: h, children: /* @__PURE__ */ s.jsx(O.Item, { ...w, label: t, rules: C, children: /* @__PURE__ */ s.jsx(
|
|
50
|
+
_,
|
|
50
51
|
{
|
|
51
52
|
ref: B,
|
|
52
53
|
disabled: E,
|
|
53
|
-
defaultValue:
|
|
54
|
+
defaultValue: j,
|
|
54
55
|
value: l,
|
|
55
56
|
readOnly: $,
|
|
56
57
|
addonBefore: I,
|
|
57
|
-
minLength:
|
|
58
|
+
minLength: T,
|
|
58
59
|
addonAfter: x,
|
|
59
60
|
step: d ? 1 : void 0,
|
|
60
|
-
pattern: d ? "d*" :
|
|
61
|
+
pattern: d ? "d*" : N,
|
|
61
62
|
onChange: g,
|
|
62
|
-
onPressEnter: (r) =>
|
|
63
|
+
onPressEnter: (r) => L(r, u, c, a),
|
|
63
64
|
className: "max-width",
|
|
64
65
|
min: p === null ? void 0 : p ?? 0,
|
|
65
66
|
max: A,
|
|
@@ -79,5 +80,5 @@ const K = S(
|
|
|
79
80
|
}
|
|
80
81
|
);
|
|
81
82
|
export {
|
|
82
|
-
|
|
83
|
+
Q as default
|
|
83
84
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("../../../../_virtual/jsx-runtime.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../../../_virtual/jsx-runtime.cjs"),l=require("../../../util/ValidationUtil.cjs"),u=require("./TextField.cjs"),i=e=>t.jsxRuntimeExports.jsx(u.default,{...e,rules:[...e.rules??[],...l.default.phoneValidation(e.label??e.placeholder??"")]});exports.default=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../../../../_virtual/jsx-runtime.cjs"),I=require("react-i18next"),j=require("../../../locale/hooks/translation-constants.cjs"),a=require("../../../../node_modules/antd/es/form/index.cjs"),q=require("../../../../node_modules/antd/es/input/index.cjs"),l=(n,e,t,r)=>{var s;e&&t&&(n.preventDefault(),(s=t==null?void 0:t.getFieldInstance(e))==null||s.focus()),r&&r(n)},A=({required:n,label:e,rules:t=[],placeholder:r,onEnter:s,nextFocus:d,className:i,...u})=>{const{t:c}=I.useTranslation(j.TRANSLATION_NAMESPACE),x=a.default.useFormInstance();return o.jsxRuntimeExports.jsx(a.default.Item,{...u,className:i,label:e,rules:[...t,{required:n,message:`${e} ${c("err.validation.required")}`}],children:o.jsxRuntimeExports.jsx(q.default.TextArea,{...u,className:i,onPressEnter:T=>l(T,d,x,s),placeholder:r??e})})};exports.default=A;exports.onEnterInternalTextField=l;
|
|
@@ -1,47 +1,48 @@
|
|
|
1
1
|
import { j as a } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import {
|
|
3
|
-
import { TRANSLATION_NAMESPACE as
|
|
4
|
-
import
|
|
5
|
-
|
|
2
|
+
import { useTranslation as x } from "react-i18next";
|
|
3
|
+
import { TRANSLATION_NAMESPACE as f } from "../../../locale/hooks/translation-constants.js";
|
|
4
|
+
import m from "../../../../node_modules/antd/es/form/index.js";
|
|
5
|
+
import l from "../../../../node_modules/antd/es/input/index.js";
|
|
6
|
+
const A = (r, t, e, n) => {
|
|
6
7
|
var o;
|
|
7
|
-
|
|
8
|
-
},
|
|
8
|
+
t && e && (r.preventDefault(), (o = e == null ? void 0 : e.getFieldInstance(t)) == null || o.focus()), n && n(r);
|
|
9
|
+
}, g = ({
|
|
9
10
|
required: r,
|
|
10
|
-
label:
|
|
11
|
-
rules:
|
|
11
|
+
label: t,
|
|
12
|
+
rules: e = [],
|
|
12
13
|
placeholder: n,
|
|
13
14
|
onEnter: o,
|
|
14
|
-
nextFocus:
|
|
15
|
+
nextFocus: p,
|
|
15
16
|
className: s,
|
|
16
17
|
...i
|
|
17
18
|
}) => {
|
|
18
|
-
const { t:
|
|
19
|
+
const { t: u } = x(f), c = m.useFormInstance();
|
|
19
20
|
return /* @__PURE__ */ a.jsx(
|
|
20
21
|
m.Item,
|
|
21
22
|
{
|
|
22
23
|
...i,
|
|
23
24
|
className: s,
|
|
24
|
-
label:
|
|
25
|
+
label: t,
|
|
25
26
|
rules: [
|
|
26
|
-
...
|
|
27
|
+
...e,
|
|
27
28
|
{
|
|
28
29
|
required: r,
|
|
29
|
-
message: `${
|
|
30
|
+
message: `${t} ${u("err.validation.required")}`
|
|
30
31
|
}
|
|
31
32
|
],
|
|
32
33
|
children: /* @__PURE__ */ a.jsx(
|
|
33
|
-
|
|
34
|
+
l.TextArea,
|
|
34
35
|
{
|
|
35
36
|
...i,
|
|
36
37
|
className: s,
|
|
37
|
-
onPressEnter: (d) =>
|
|
38
|
-
placeholder: n ??
|
|
38
|
+
onPressEnter: (d) => A(d, p, c, o),
|
|
39
|
+
placeholder: n ?? t
|
|
39
40
|
}
|
|
40
41
|
)
|
|
41
42
|
}
|
|
42
43
|
);
|
|
43
44
|
};
|
|
44
45
|
export {
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
g as default,
|
|
47
|
+
A as onEnterInternalTextField
|
|
47
48
|
};
|
|
@@ -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"),N=require("react"),O=require("react-i18next"),_=require("../../../locale/hooks/translation-constants.cjs"),$=require("../tooltip/TooltipComponent.cjs"),d=require("../../../../node_modules/antd/es/input/index.cjs"),w=require("../../../../node_modules/antd/es/form/index.cjs"),L=require("../../../../node_modules/@ant-design/icons/es/icons/LoadingOutlined.cjs"),l=(t,n,e,i)=>{var s;n&&e&&(t.preventDefault(),(s=e==null?void 0:e.getFieldInstance(n))==null||s.focus()),i&&i(t)},D=({type:t,required:n,label:e,disabled:i,rules:s=[],placeholder:u,onEnter:c,size:x,form:f,addonAfter:j,addonBefore:m,nextFocus:p,autoComplete:E="off",defaultValue:q,readOnly:T,value:g,loading:R,onBlur:v,inputRef:I,status:A,autoFocus:C,onChange:k,tooltip:P,...M})=>{const{t:a}=O.useTranslation(_.TRANSLATION_NAMESPACE),S=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]),h={disabled:i,value:g,readOnly:T,defaultValue:q,autoFocus:C,addonBefore:m,ref:I,onBlur:v,addonAfter:R?o.jsxRuntimeExports.jsx(L.default,{}):j,status:A,size:x,autoComplete:E,onPressEnter:r=>l(r,p,f,c),type:t,placeholder:u??e},F=t=="password"?d.default.Password:d.default;return o.jsxRuntimeExports.jsx($.default,{title:P,children:o.jsxRuntimeExports.jsx(w.default.Item,{...M,label:e,rules:S,children:o.jsxRuntimeExports.jsx(F,{...h})})})};exports.default=D;exports.onEnterInternalTextField=l;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { j as e } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { useMemo as M } from "react";
|
|
3
|
+
import { useTranslation as S } from "react-i18next";
|
|
4
4
|
import { TRANSLATION_NAMESPACE as $ } from "../../../locale/hooks/translation-constants.js";
|
|
5
5
|
import D from "../tooltip/TooltipComponent.js";
|
|
6
|
-
import
|
|
6
|
+
import p from "../../../../node_modules/antd/es/input/index.js";
|
|
7
|
+
import L from "../../../../node_modules/antd/es/form/index.js";
|
|
7
8
|
import O from "../../../../node_modules/@ant-design/icons/es/icons/LoadingOutlined.js";
|
|
8
|
-
const _ = (o,
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
},
|
|
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
16
|
disabled: s,
|
|
16
|
-
rules:
|
|
17
|
+
rules: n = [],
|
|
17
18
|
placeholder: m,
|
|
18
19
|
onEnter: f,
|
|
19
20
|
size: d,
|
|
@@ -34,21 +35,21 @@ const _ = (o, n, t, s) => {
|
|
|
34
35
|
tooltip: h,
|
|
35
36
|
...F
|
|
36
37
|
}) => {
|
|
37
|
-
const { t: a } =
|
|
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
|
-
}, [
|
|
51
|
+
}), i;
|
|
52
|
+
}, [n, r, t, m, a, o]), R = {
|
|
52
53
|
disabled: s,
|
|
53
54
|
value: A,
|
|
54
55
|
readOnly: T,
|
|
@@ -57,17 +58,17 @@ const _ = (o, n, t, s) => {
|
|
|
57
58
|
addonBefore: u,
|
|
58
59
|
ref: v,
|
|
59
60
|
onBlur: g,
|
|
60
|
-
addonAfter: E ? /* @__PURE__ */
|
|
61
|
+
addonAfter: E ? /* @__PURE__ */ e.jsx(O, {}) : l,
|
|
61
62
|
status: C,
|
|
62
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
|
}, w = o == "password" ? p.Password : p;
|
|
68
|
-
return /* @__PURE__ */
|
|
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";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";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,9 +1,9 @@
|
|
|
1
1
|
import { j as t } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { t as e } from "i18next";
|
|
3
|
+
import { useTranslation as j } from "react-i18next";
|
|
4
4
|
import a from "../button/Button.js";
|
|
5
5
|
import { TRANSLATION_NAMESPACE as y } from "../../../locale/hooks/translation-constants.js";
|
|
6
|
-
import
|
|
6
|
+
import R from "../../../../node_modules/antd/es/result/index.js";
|
|
7
7
|
import T from "../../../../node_modules/@ant-design/icons/es/icons/LoadingOutlined.js";
|
|
8
8
|
import h from "../../../../node_modules/@ant-design/icons/es/icons/ArrowLeftOutlined.js";
|
|
9
9
|
const S = ({
|
|
@@ -21,9 +21,9 @@ const S = ({
|
|
|
21
21
|
loadingTitle: x = e("message.loading.saving"),
|
|
22
22
|
loadingMessage: c
|
|
23
23
|
}) => {
|
|
24
|
-
const { t: m } =
|
|
24
|
+
const { t: m } = j(y);
|
|
25
25
|
return /* @__PURE__ */ t.jsx(
|
|
26
|
-
|
|
26
|
+
R,
|
|
27
27
|
{
|
|
28
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
29
|
title: s ? x : i ? u : o ? l : void 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";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";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;
|