@kingteza/crud-component 1.0.22 → 1.0.24
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/package.json +19 -19
- package/dist/App.d.ts +0 -2
- package/dist/components/common/DatePicker/DatePicker.cjs +0 -1
- package/dist/components/common/DatePicker/DatePicker.d.ts +0 -37
- package/dist/components/common/DatePicker/DatePicker.js +0 -88
- package/dist/components/common/DatePicker/TimePicker.cjs +0 -1
- package/dist/components/common/DatePicker/TimePicker.d.ts +0 -34
- package/dist/components/common/DatePicker/TimePicker.js +0 -78
- package/dist/components/common/DatePicker/index.d.ts +0 -3
- package/dist/components/common/appearance/Hider.cjs +0 -1
- package/dist/components/common/appearance/Hider.d.ts +0 -6
- package/dist/components/common/appearance/Hider.js +0 -5
- package/dist/components/common/appearance/index.d.ts +0 -0
- package/dist/components/common/button/Button.cjs +0 -1
- package/dist/components/common/button/Button.d.ts +0 -12
- package/dist/components/common/button/Button.js +0 -79
- package/dist/components/common/button/CloneButtonTable.cjs +0 -1
- package/dist/components/common/button/CloneButtonTable.d.ts +0 -6
- package/dist/components/common/button/CloneButtonTable.js +0 -20
- package/dist/components/common/button/DeleteButtonTable.cjs +0 -1
- package/dist/components/common/button/DeleteButtonTable.d.ts +0 -13
- package/dist/components/common/button/DeleteButtonTable.js +0 -68
- package/dist/components/common/button/ExportButton.cjs +0 -1
- package/dist/components/common/button/ExportButton.d.ts +0 -4
- package/dist/components/common/button/ExportButton.js +0 -27
- package/dist/components/common/button/HideButtonTable.cjs +0 -1
- package/dist/components/common/button/HideButtonTable.d.ts +0 -13
- package/dist/components/common/button/HideButtonTable.js +0 -68
- package/dist/components/common/button/ImportButton.cjs +0 -1
- package/dist/components/common/button/ImportButton.d.ts +0 -9
- package/dist/components/common/button/ImportButton.js +0 -56
- package/dist/components/common/button/NewButton.cjs +0 -1
- package/dist/components/common/button/NewButton.d.ts +0 -12
- package/dist/components/common/button/NewButton.js +0 -24
- package/dist/components/common/button/PrintButton.cjs +0 -1
- package/dist/components/common/button/PrintButton.d.ts +0 -12
- package/dist/components/common/button/PrintButton.js +0 -26
- package/dist/components/common/button/RefreshButton.cjs +0 -1
- package/dist/components/common/button/RefreshButton.d.ts +0 -11
- package/dist/components/common/button/RefreshButton.js +0 -24
- package/dist/components/common/button/UnHideButton.cjs +0 -1
- package/dist/components/common/button/UnHideButton.d.ts +0 -14
- package/dist/components/common/button/UnHideButton.js +0 -70
- package/dist/components/common/button/UpdateButtonTable.cjs +0 -1
- package/dist/components/common/button/UpdateButtonTable.d.ts +0 -6
- package/dist/components/common/button/UpdateButtonTable.js +0 -20
- package/dist/components/common/button/ViewButtonTable.cjs +0 -1
- package/dist/components/common/button/ViewButtonTable.d.ts +0 -6
- package/dist/components/common/button/ViewButtonTable.js +0 -20
- package/dist/components/common/button/index.d.ts +0 -14
- package/dist/components/common/check-box/CheckBox.cjs +0 -1
- package/dist/components/common/check-box/CheckBox.d.ts +0 -9
- package/dist/components/common/check-box/CheckBox.js +0 -40
- package/dist/components/common/check-box/index.d.ts +0 -2
- package/dist/components/common/description/DescList.cjs +0 -1
- package/dist/components/common/description/DescList.d.ts +0 -18
- package/dist/components/common/description/DescList.js +0 -16
- package/dist/components/common/description/DescriptionComponent.d.ts +0 -7
- package/dist/components/common/description/index.d.ts +0 -3
- package/dist/components/common/index.d.ts +0 -22
- package/dist/components/common/layout/VerticalSpace.cjs +0 -1
- package/dist/components/common/layout/VerticalSpace.d.ts +0 -5
- package/dist/components/common/layout/VerticalSpace.js +0 -6
- package/dist/components/common/layout/index.d.ts +0 -2
- package/dist/components/common/loading/LoadingIndicator.cjs +0 -1
- package/dist/components/common/loading/LoadingIndicator.d.ts +0 -6
- package/dist/components/common/loading/LoadingIndicator.js +0 -24
- package/dist/components/common/loading/index.d.ts +0 -2
- package/dist/components/common/picker/ImagePicker.cjs +0 -1
- package/dist/components/common/picker/ImagePicker.d.ts +0 -56
- package/dist/components/common/picker/ImagePicker.js +0 -282
- package/dist/components/common/picker/index.d.ts +0 -2
- package/dist/components/common/radio/RadioGroupComponent.cjs +0 -1
- package/dist/components/common/radio/RadioGroupComponent.d.ts +0 -18
- package/dist/components/common/radio/RadioGroupComponent.js +0 -19
- package/dist/components/common/radio/index.d.ts +0 -2
- package/dist/components/common/report/SelectFieldInReport.cjs +0 -1
- package/dist/components/common/report/SelectFieldInReport.d.ts +0 -16
- package/dist/components/common/report/SelectFieldInReport.js +0 -30
- package/dist/components/common/report/index.d.ts +0 -3
- package/dist/components/common/select/CustomSelectOption.cjs +0 -1
- package/dist/components/common/select/CustomSelectOption.d.ts +0 -7
- package/dist/components/common/select/CustomSelectOption.js +0 -13
- package/dist/components/common/select/SelectComponent.cjs +0 -1
- package/dist/components/common/select/SelectComponent.d.ts +0 -21
- package/dist/components/common/select/SelectComponent.js +0 -89
- package/dist/components/common/select/index.d.ts +0 -3
- package/dist/components/common/show-more/index.cjs +0 -1
- package/dist/components/common/show-more/index.d.ts +0 -4
- package/dist/components/common/show-more/index.js +0 -8
- package/dist/components/common/tab/TabViewWithRoute.cjs +0 -1
- package/dist/components/common/tab/TabViewWithRoute.d.ts +0 -13
- package/dist/components/common/tab/TabViewWithRoute.js +0 -38
- package/dist/components/common/tab/index.d.ts +0 -2
- package/dist/components/common/table/index.d.ts +0 -3
- package/dist/components/common/table/table.cjs +0 -1
- package/dist/components/common/table/table.d.ts +0 -19
- package/dist/components/common/table/table.js +0 -40
- package/dist/components/common/tag/StatusTag.cjs +0 -1
- package/dist/components/common/tag/StatusTag.d.ts +0 -14
- package/dist/components/common/tag/StatusTag.js +0 -30
- package/dist/components/common/tag/index.d.ts +0 -2
- package/dist/components/common/text/index.cjs +0 -1
- package/dist/components/common/text/index.d.ts +0 -3
- package/dist/components/common/text/index.js +0 -5
- package/dist/components/common/text/title/TitleWithHeadTitle.d.ts +0 -7
- package/dist/components/common/text/title/index.cjs +0 -1
- package/dist/components/common/text/title/index.d.ts +0 -1
- package/dist/components/common/text/title/index.js +0 -5
- package/dist/components/common/text-field/NumberField.cjs +0 -1
- package/dist/components/common/text-field/NumberField.d.ts +0 -13
- package/dist/components/common/text-field/NumberField.js +0 -83
- package/dist/components/common/text-field/PhoneNumberField.cjs +0 -1
- package/dist/components/common/text-field/PhoneNumberField.d.ts +0 -4
- package/dist/components/common/text-field/PhoneNumberField.js +0 -18
- package/dist/components/common/text-field/TextArea.cjs +0 -1
- package/dist/components/common/text-field/TextArea.d.ts +0 -17
- package/dist/components/common/text-field/TextArea.js +0 -47
- package/dist/components/common/text-field/TextField.cjs +0 -1
- package/dist/components/common/text-field/TextField.d.ts +0 -27
- package/dist/components/common/text-field/TextField.js +0 -73
- package/dist/components/common/text-field/index.d.ts +0 -5
- package/dist/components/common/tooltip/TooltipComponent.cjs +0 -1
- package/dist/components/common/tooltip/TooltipComponent.d.ts +0 -5
- package/dist/components/common/tooltip/TooltipComponent.js +0 -9
- package/dist/components/common/tooltip/index.d.ts +0 -2
- package/dist/components/common/wizard/WizardResult.cjs +0 -1
- package/dist/components/common/wizard/WizardResult.d.ts +0 -16
- package/dist/components/common/wizard/WizardResult.js +0 -60
- package/dist/components/common/wizard/WizardViewForm.cjs +0 -1
- package/dist/components/common/wizard/WizardViewForm.d.ts +0 -24
- package/dist/components/common/wizard/WizardViewForm.js +0 -74
- package/dist/components/common/wizard/index.d.ts +0 -3
- package/dist/components/crud/CrudComponent.cjs +0 -1
- package/dist/components/crud/CrudComponent.d.ts +0 -237
- package/dist/components/crud/CrudComponent.js +0 -210
- package/dist/components/crud/CrudField.cjs +0 -1
- package/dist/components/crud/CrudField.d.ts +0 -4
- package/dist/components/crud/CrudField.js +0 -459
- package/dist/components/crud/CrudForm.cjs +0 -1
- package/dist/components/crud/CrudForm.d.ts +0 -14
- package/dist/components/crud/CrudForm.js +0 -91
- package/dist/components/crud/CrudFormWizard.cjs +0 -1
- package/dist/components/crud/CrudFormWizard.d.ts +0 -14
- package/dist/components/crud/CrudFormWizard.js +0 -140
- package/dist/components/crud/CrudReportComponent.cjs +0 -4
- package/dist/components/crud/CrudReportComponent.d.ts +0 -44
- package/dist/components/crud/CrudReportComponent.js +0 -255
- package/dist/components/crud/CrudSearchComponent.cjs +0 -1
- package/dist/components/crud/CrudSearchComponent.d.ts +0 -21
- package/dist/components/crud/CrudSearchComponent.js +0 -95
- package/dist/components/crud/FileCrudField.cjs +0 -1
- package/dist/components/crud/FileCrudField.d.ts +0 -25
- package/dist/components/crud/FileCrudField.js +0 -220
- package/dist/components/crud/ImageCrudField.cjs +0 -1
- package/dist/components/crud/ImageCrudField.d.ts +0 -38
- package/dist/components/crud/ImageCrudField.js +0 -113
- package/dist/components/crud/import/CrudImportButton.cjs +0 -1
- package/dist/components/crud/import/CrudImportButton.d.ts +0 -3
- package/dist/components/crud/import/CrudImportButton.js +0 -31
- package/dist/components/crud/import/CrudImportComponent.cjs +0 -2
- package/dist/components/crud/import/CrudImportComponent.d.ts +0 -14
- package/dist/components/crud/import/CrudImportComponent.js +0 -223
- package/dist/components/crud/index.d.ts +0 -15
- package/dist/components/crud/view/CrudDecListView.cjs +0 -1
- package/dist/components/crud/view/CrudDecListView.d.ts +0 -14
- package/dist/components/crud/view/CrudDecListView.js +0 -42
- package/dist/components/crud/view/CrudViewer.cjs +0 -1
- package/dist/components/crud/view/CrudViewer.d.ts +0 -43
- package/dist/components/crud/view/CrudViewer.js +0 -217
- package/dist/components/crud/view/CrudViewerUtil.cjs +0 -1
- package/dist/components/crud/view/CrudViewerUtil.d.ts +0 -2
- package/dist/components/crud/view/CrudViewerUtil.js +0 -57
- package/dist/components/crud/view/index.d.ts +0 -5
- package/dist/index.cjs +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.js +0 -32
- package/dist/locale/hooks/translation-constants.cjs +0 -1
- package/dist/locale/hooks/translation-constants.d.ts +0 -1
- package/dist/locale/hooks/translation-constants.js +0 -4
- package/dist/locale/index.cjs +0 -1
- package/dist/locale/index.d.ts +0 -74
- package/dist/locale/index.js +0 -37
- package/dist/locale/translations/en.cjs +0 -1
- package/dist/locale/translations/en.d.ts +0 -58
- package/dist/locale/translations/en.js +0 -60
- package/dist/main.d.ts +0 -0
- package/dist/util/DateUtil.cjs +0 -1
- package/dist/util/DateUtil.d.ts +0 -7
- package/dist/util/DateUtil.js +0 -6
- package/dist/util/ImageUtil.cjs +0 -1
- package/dist/util/ImageUtil.d.ts +0 -14
- package/dist/util/ImageUtil.js +0 -63
- package/dist/util/NumberUtil.cjs +0 -1
- package/dist/util/NumberUtil.d.ts +0 -17
- package/dist/util/NumberUtil.js +0 -60
- package/dist/util/ValidationUtil.cjs +0 -1
- package/dist/util/ValidationUtil.d.ts +0 -14
- package/dist/util/ValidationUtil.js +0 -60
- package/dist/util/index.cjs +0 -1
- package/dist/util/index.d.ts +0 -4
- package/dist/util/index.js +0 -10
- package/dist/vite-env.d.ts +0 -1
|
@@ -1,459 +0,0 @@
|
|
|
1
|
-
import { jsx as a, Fragment as O, jsxs as U } from "react/jsx-runtime";
|
|
2
|
-
import { Form as S, Radio as q, Select as A, ColorPicker as $ } from "antd";
|
|
3
|
-
import { useEffect as P, useState as D, useCallback as z } from "react";
|
|
4
|
-
import J from "react-highlight-words";
|
|
5
|
-
import { useTranslation as K } from "react-i18next";
|
|
6
|
-
import { TRANSLATION_NAMESPACE as Q } from "../../locale/hooks/translation-constants.js";
|
|
7
|
-
import X from "./FileCrudField.js";
|
|
8
|
-
import Y from "./ImageCrudField.js";
|
|
9
|
-
import Z from "../common/DatePicker/DatePicker.js";
|
|
10
|
-
import V from "../common/DatePicker/TimePicker.js";
|
|
11
|
-
import ee from "../common/check-box/CheckBox.js";
|
|
12
|
-
import M from "../common/select/SelectComponent.js";
|
|
13
|
-
import re from "../common/text-field/NumberField.js";
|
|
14
|
-
import te from "../common/text-field/TextField.js";
|
|
15
|
-
import oe from "../common/text-field/TextArea.js";
|
|
16
|
-
import ae from "../common/tooltip/TooltipComponent.js";
|
|
17
|
-
function Ne(x) {
|
|
18
|
-
const {
|
|
19
|
-
label: i,
|
|
20
|
-
name: c,
|
|
21
|
-
type: b,
|
|
22
|
-
required: s,
|
|
23
|
-
hidden: F,
|
|
24
|
-
rules: u = [],
|
|
25
|
-
updatable: h = !0,
|
|
26
|
-
readonly: w = !1,
|
|
27
|
-
fieldClassName: f,
|
|
28
|
-
customFormFieldRender: k,
|
|
29
|
-
fieldTooltip: v,
|
|
30
|
-
...e
|
|
31
|
-
} = x, p = S.useFormInstance();
|
|
32
|
-
P(() => {
|
|
33
|
-
if (b === "select") {
|
|
34
|
-
const {
|
|
35
|
-
items: t = [],
|
|
36
|
-
onSearch: n,
|
|
37
|
-
searchOnType: o
|
|
38
|
-
} = e;
|
|
39
|
-
!(t != null && t.length) && !o && (n == null || n(void 0, p, e == null ? void 0 : e.updatingValue));
|
|
40
|
-
}
|
|
41
|
-
}, [p, e, b, e == null ? void 0 : e.updatingValue]);
|
|
42
|
-
const { t: N } = K(Q);
|
|
43
|
-
if (w || F) return /* @__PURE__ */ a(O, {});
|
|
44
|
-
if (k)
|
|
45
|
-
return k(p, x);
|
|
46
|
-
switch (b) {
|
|
47
|
-
case "text":
|
|
48
|
-
case "email":
|
|
49
|
-
case "password": {
|
|
50
|
-
const { onChange: t, placeholder: n } = e;
|
|
51
|
-
return /* @__PURE__ */ a(
|
|
52
|
-
te,
|
|
53
|
-
{
|
|
54
|
-
placeholder: n,
|
|
55
|
-
disabled: !h,
|
|
56
|
-
rules: u,
|
|
57
|
-
required: s,
|
|
58
|
-
onChange: t ? (o) => t(o, p) : void 0,
|
|
59
|
-
type: b,
|
|
60
|
-
name: c,
|
|
61
|
-
tooltip: v,
|
|
62
|
-
label: i,
|
|
63
|
-
className: f,
|
|
64
|
-
autoComplete: "new-password"
|
|
65
|
-
}
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
case "number": {
|
|
69
|
-
const { onChange: t, placeholder: n, allowMinus: o } = e;
|
|
70
|
-
return /* @__PURE__ */ a(
|
|
71
|
-
re,
|
|
72
|
-
{
|
|
73
|
-
placeholder: n,
|
|
74
|
-
disabled: !h,
|
|
75
|
-
moneyField: !!e.formatted,
|
|
76
|
-
type: b,
|
|
77
|
-
onChange: t ? (g) => t(g, p) : void 0,
|
|
78
|
-
rules: u,
|
|
79
|
-
autoComplete: "false",
|
|
80
|
-
required: s,
|
|
81
|
-
tooltip: v,
|
|
82
|
-
className: f,
|
|
83
|
-
min: o ? null : void 0,
|
|
84
|
-
name: c,
|
|
85
|
-
label: i
|
|
86
|
-
}
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
case "date": {
|
|
90
|
-
const {
|
|
91
|
-
range: t,
|
|
92
|
-
disableToday: n,
|
|
93
|
-
disabledFutureDays: o,
|
|
94
|
-
disabledPastDays: g,
|
|
95
|
-
onChange: C,
|
|
96
|
-
placeholder: m,
|
|
97
|
-
format: T
|
|
98
|
-
} = e;
|
|
99
|
-
return /* @__PURE__ */ a(
|
|
100
|
-
Z,
|
|
101
|
-
{
|
|
102
|
-
placeholder: m,
|
|
103
|
-
required: s,
|
|
104
|
-
disabled: !h,
|
|
105
|
-
type: b,
|
|
106
|
-
format: T,
|
|
107
|
-
tooltip: v,
|
|
108
|
-
range: t,
|
|
109
|
-
name: c,
|
|
110
|
-
label: i,
|
|
111
|
-
onChange: C ? (l) => C(l, p) : void 0,
|
|
112
|
-
className: f,
|
|
113
|
-
disableToday: n,
|
|
114
|
-
disabledFutureDays: o,
|
|
115
|
-
disabledPastDays: g
|
|
116
|
-
}
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
case "time": {
|
|
120
|
-
const {
|
|
121
|
-
range: t = !1,
|
|
122
|
-
disableCurrent: n,
|
|
123
|
-
disabledFuture: o,
|
|
124
|
-
disabledPast: g,
|
|
125
|
-
onChange: C,
|
|
126
|
-
use12Hours: m,
|
|
127
|
-
format: T,
|
|
128
|
-
placeholder: l
|
|
129
|
-
} = e;
|
|
130
|
-
return /* @__PURE__ */ a(
|
|
131
|
-
V,
|
|
132
|
-
{
|
|
133
|
-
placeholder: l,
|
|
134
|
-
required: s,
|
|
135
|
-
format: T,
|
|
136
|
-
disabled: !h,
|
|
137
|
-
type: b,
|
|
138
|
-
tooltip: v,
|
|
139
|
-
range: t,
|
|
140
|
-
use12Hours: m,
|
|
141
|
-
name: c,
|
|
142
|
-
label: i,
|
|
143
|
-
onChange: C ? (y) => C(y, p) : void 0,
|
|
144
|
-
className: f,
|
|
145
|
-
disableCurrent: n,
|
|
146
|
-
disabledFuture: o,
|
|
147
|
-
disabledPast: g
|
|
148
|
-
}
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
case "textarea": {
|
|
152
|
-
const { onChange: t, placeholder: n, rows: o, cols: g } = e;
|
|
153
|
-
return /* @__PURE__ */ a(
|
|
154
|
-
oe,
|
|
155
|
-
{
|
|
156
|
-
rules: u,
|
|
157
|
-
placeholder: n,
|
|
158
|
-
onChange: t ? (C) => {
|
|
159
|
-
var m;
|
|
160
|
-
return t((m = C == null ? void 0 : C.target) == null ? void 0 : m.value, p);
|
|
161
|
-
} : void 0,
|
|
162
|
-
tooltip: v,
|
|
163
|
-
required: s,
|
|
164
|
-
disabled: !h,
|
|
165
|
-
name: c,
|
|
166
|
-
label: i,
|
|
167
|
-
className: f,
|
|
168
|
-
rows: o,
|
|
169
|
-
cols: g
|
|
170
|
-
}
|
|
171
|
-
);
|
|
172
|
-
}
|
|
173
|
-
case "image":
|
|
174
|
-
return /* @__PURE__ */ a(
|
|
175
|
-
Y,
|
|
176
|
-
{
|
|
177
|
-
...e,
|
|
178
|
-
required: s,
|
|
179
|
-
name: c,
|
|
180
|
-
label: i,
|
|
181
|
-
rules: u,
|
|
182
|
-
fieldClassName: f,
|
|
183
|
-
onRemoved: e.onRemoved,
|
|
184
|
-
onUploading: e.onUploading,
|
|
185
|
-
provider: e.provider
|
|
186
|
-
}
|
|
187
|
-
);
|
|
188
|
-
case "file":
|
|
189
|
-
return /* @__PURE__ */ a(
|
|
190
|
-
X,
|
|
191
|
-
{
|
|
192
|
-
...e,
|
|
193
|
-
required: s,
|
|
194
|
-
name: c,
|
|
195
|
-
label: i,
|
|
196
|
-
rules: u,
|
|
197
|
-
fieldClassName: f,
|
|
198
|
-
onRemoved: e.onRemoved,
|
|
199
|
-
onUploading: e.onUploading,
|
|
200
|
-
provider: e.provider
|
|
201
|
-
}
|
|
202
|
-
);
|
|
203
|
-
case "select":
|
|
204
|
-
return /* @__PURE__ */ a(
|
|
205
|
-
le,
|
|
206
|
-
{
|
|
207
|
-
...e,
|
|
208
|
-
required: s,
|
|
209
|
-
name: c,
|
|
210
|
-
label: i,
|
|
211
|
-
rules: u,
|
|
212
|
-
fieldClassName: f,
|
|
213
|
-
form: p,
|
|
214
|
-
updatable: h,
|
|
215
|
-
readonly: w,
|
|
216
|
-
fieldTooltip: v
|
|
217
|
-
}
|
|
218
|
-
);
|
|
219
|
-
case "enum": {
|
|
220
|
-
const {
|
|
221
|
-
enum: t,
|
|
222
|
-
radio: n = !1,
|
|
223
|
-
translation: o,
|
|
224
|
-
onChange: g,
|
|
225
|
-
onSearch: C,
|
|
226
|
-
multiple: m
|
|
227
|
-
} = e, T = Array.isArray(t) ? t : Object.keys(t);
|
|
228
|
-
return n ? /* @__PURE__ */ a(
|
|
229
|
-
S.Item,
|
|
230
|
-
{
|
|
231
|
-
...e,
|
|
232
|
-
name: c,
|
|
233
|
-
required: s,
|
|
234
|
-
tooltip: v,
|
|
235
|
-
rules: u,
|
|
236
|
-
label: i,
|
|
237
|
-
className: ["w-100", f].join(" "),
|
|
238
|
-
children: /* @__PURE__ */ a(
|
|
239
|
-
q.Group,
|
|
240
|
-
{
|
|
241
|
-
...e,
|
|
242
|
-
onChange: g ? (l) => {
|
|
243
|
-
var y;
|
|
244
|
-
return g((y = l == null ? void 0 : l.target) == null ? void 0 : y.value, p);
|
|
245
|
-
} : void 0,
|
|
246
|
-
children: T.map((l) => /* @__PURE__ */ a(q, { disabled: !h, value: l, children: o ? N(o[l]) : l }, l))
|
|
247
|
-
}
|
|
248
|
-
)
|
|
249
|
-
}
|
|
250
|
-
) : /* @__PURE__ */ a(
|
|
251
|
-
M,
|
|
252
|
-
{
|
|
253
|
-
...e,
|
|
254
|
-
onChange: g ? (l) => g(l, p) : void 0,
|
|
255
|
-
className: ["w-100", f].join(" "),
|
|
256
|
-
name: c,
|
|
257
|
-
items: T,
|
|
258
|
-
required: s,
|
|
259
|
-
tooltip: v,
|
|
260
|
-
rules: u,
|
|
261
|
-
label: i,
|
|
262
|
-
disabled: !h,
|
|
263
|
-
onSearch: C ? (l) => C(l, p) : void 0,
|
|
264
|
-
allowClear: !0,
|
|
265
|
-
mode: m ? "multiple" : void 0,
|
|
266
|
-
itemBuilder: (l) => /* @__PURE__ */ a(A.Option, { value: l, children: o ? N(o[l]) : l }, l)
|
|
267
|
-
}
|
|
268
|
-
);
|
|
269
|
-
}
|
|
270
|
-
case "checkbox": {
|
|
271
|
-
const { onChange: t } = e;
|
|
272
|
-
return /* @__PURE__ */ a(
|
|
273
|
-
ee,
|
|
274
|
-
{
|
|
275
|
-
className: f,
|
|
276
|
-
rules: u,
|
|
277
|
-
onChange: t ? (n) => t(n, p) : void 0,
|
|
278
|
-
label: i,
|
|
279
|
-
tooltip: v,
|
|
280
|
-
disabled: !h,
|
|
281
|
-
name: c
|
|
282
|
-
}
|
|
283
|
-
);
|
|
284
|
-
}
|
|
285
|
-
case "color":
|
|
286
|
-
return /* @__PURE__ */ a(
|
|
287
|
-
ne,
|
|
288
|
-
{
|
|
289
|
-
...e,
|
|
290
|
-
type: "color",
|
|
291
|
-
required: s,
|
|
292
|
-
name: c,
|
|
293
|
-
label: i,
|
|
294
|
-
rules: u,
|
|
295
|
-
fieldClassName: f,
|
|
296
|
-
updatable: h,
|
|
297
|
-
readonly: w,
|
|
298
|
-
fieldTooltip: v
|
|
299
|
-
}
|
|
300
|
-
);
|
|
301
|
-
default:
|
|
302
|
-
return /* @__PURE__ */ a(O, { children: `${b} Not Implemented` });
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
function le(x) {
|
|
306
|
-
const {
|
|
307
|
-
items: i = [],
|
|
308
|
-
loading: c,
|
|
309
|
-
searchOnType: b,
|
|
310
|
-
onSearch: s,
|
|
311
|
-
multiple: F,
|
|
312
|
-
onChange: u,
|
|
313
|
-
highlightSearch: h,
|
|
314
|
-
required: w,
|
|
315
|
-
fieldClassName: f,
|
|
316
|
-
rules: k,
|
|
317
|
-
fieldTooltip: v,
|
|
318
|
-
updatable: e,
|
|
319
|
-
label: p,
|
|
320
|
-
name: N,
|
|
321
|
-
tagRender: t,
|
|
322
|
-
updatingValue: n,
|
|
323
|
-
onSet: o,
|
|
324
|
-
placeholder: g,
|
|
325
|
-
allowClear: C = !0
|
|
326
|
-
} = x, m = x.form, [T, l] = D(""), y = S.useWatch(N, m), [R, j] = D(!0);
|
|
327
|
-
P(() => {
|
|
328
|
-
o && R && y && (o == null || o(y, i, m), j(!1));
|
|
329
|
-
}, [R, m, i, N, o, y]), P(() => {
|
|
330
|
-
y && j(!0);
|
|
331
|
-
}, [y]);
|
|
332
|
-
const W = z(
|
|
333
|
-
async (r) => {
|
|
334
|
-
l(r), b && (s == null || s(r, m, n));
|
|
335
|
-
},
|
|
336
|
-
[m, s, b, n]
|
|
337
|
-
);
|
|
338
|
-
return /* @__PURE__ */ a(
|
|
339
|
-
M,
|
|
340
|
-
{
|
|
341
|
-
...x,
|
|
342
|
-
maxTagCount: "responsive",
|
|
343
|
-
maxTagPlaceholder: (r) => /* @__PURE__ */ U(
|
|
344
|
-
ae,
|
|
345
|
-
{
|
|
346
|
-
title: /* @__PURE__ */ a(O, { children: r.map((d) => /* @__PURE__ */ U(O, { children: [
|
|
347
|
-
d.label,
|
|
348
|
-
" ",
|
|
349
|
-
/* @__PURE__ */ a("br", {})
|
|
350
|
-
] })) }),
|
|
351
|
-
children: [
|
|
352
|
-
"+",
|
|
353
|
-
r == null ? void 0 : r.length
|
|
354
|
-
]
|
|
355
|
-
}
|
|
356
|
-
),
|
|
357
|
-
placeholder: g,
|
|
358
|
-
onSelect: (r) => {
|
|
359
|
-
o == null || o(r == null ? void 0 : r.key, i, m);
|
|
360
|
-
},
|
|
361
|
-
onChange: u ? (r) => {
|
|
362
|
-
l(""), u(r, m);
|
|
363
|
-
} : void 0,
|
|
364
|
-
mode: F ? "multiple" : void 0,
|
|
365
|
-
className: ["w-100", f].join(" "),
|
|
366
|
-
name: N,
|
|
367
|
-
items: i,
|
|
368
|
-
required: w,
|
|
369
|
-
tooltip: v,
|
|
370
|
-
tagRender: t,
|
|
371
|
-
rules: k,
|
|
372
|
-
disabled: !e,
|
|
373
|
-
label: p,
|
|
374
|
-
allowClear: C,
|
|
375
|
-
onSearch: W,
|
|
376
|
-
loading: c,
|
|
377
|
-
filterOption: h ? (r, d) => {
|
|
378
|
-
var I, L, B;
|
|
379
|
-
try {
|
|
380
|
-
const E = r.toLowerCase().split(/\s+/), _ = ((typeof (d == null ? void 0 : d.children) == "string" ? d == null ? void 0 : d.children : (L = (I = d == null ? void 0 : d.children) == null ? void 0 : I.props) == null ? void 0 : L.textToHighlight) ?? "").toLowerCase(), G = (((B = d == null ? void 0 : d.value) == null ? void 0 : B.toString()) ?? "").toLowerCase();
|
|
381
|
-
return E.every(
|
|
382
|
-
(H) => _.indexOf(H) >= 0 || G.indexOf(H) >= 0
|
|
383
|
-
);
|
|
384
|
-
} catch {
|
|
385
|
-
return !0;
|
|
386
|
-
}
|
|
387
|
-
} : void 0,
|
|
388
|
-
itemBuilder: h ? (r) => {
|
|
389
|
-
const d = r.value ? String(r.value) : void 0;
|
|
390
|
-
return /* @__PURE__ */ a(
|
|
391
|
-
A.Option,
|
|
392
|
-
{
|
|
393
|
-
value: r.key,
|
|
394
|
-
title: d,
|
|
395
|
-
disabled: r.disabled,
|
|
396
|
-
children: /* @__PURE__ */ a(
|
|
397
|
-
J,
|
|
398
|
-
{
|
|
399
|
-
highlightClassName: "highlight-text",
|
|
400
|
-
searchWords: (T ?? "").split(" "),
|
|
401
|
-
autoEscape: !0,
|
|
402
|
-
textToHighlight: d ?? ""
|
|
403
|
-
}
|
|
404
|
-
)
|
|
405
|
-
},
|
|
406
|
-
r.key
|
|
407
|
-
);
|
|
408
|
-
} : (r) => /* @__PURE__ */ a(
|
|
409
|
-
A.Option,
|
|
410
|
-
{
|
|
411
|
-
value: r.key,
|
|
412
|
-
title: r.value,
|
|
413
|
-
disabled: r.disabled,
|
|
414
|
-
children: r.value
|
|
415
|
-
},
|
|
416
|
-
r.key
|
|
417
|
-
)
|
|
418
|
-
}
|
|
419
|
-
);
|
|
420
|
-
}
|
|
421
|
-
function ne(x) {
|
|
422
|
-
const {
|
|
423
|
-
required: i,
|
|
424
|
-
fieldClassName: c,
|
|
425
|
-
rules: b,
|
|
426
|
-
fieldTooltip: s,
|
|
427
|
-
updatable: F,
|
|
428
|
-
label: u,
|
|
429
|
-
name: h
|
|
430
|
-
} = x;
|
|
431
|
-
return /* @__PURE__ */ a(
|
|
432
|
-
S.Item,
|
|
433
|
-
{
|
|
434
|
-
label: u,
|
|
435
|
-
name: h,
|
|
436
|
-
required: i,
|
|
437
|
-
rules: b,
|
|
438
|
-
tooltip: s,
|
|
439
|
-
children: /* @__PURE__ */ a(
|
|
440
|
-
$,
|
|
441
|
-
{
|
|
442
|
-
disabledAlpha: !0,
|
|
443
|
-
format: "hex",
|
|
444
|
-
defaultFormat: "hex",
|
|
445
|
-
showText: !0,
|
|
446
|
-
trigger: "click",
|
|
447
|
-
className: c,
|
|
448
|
-
disabled: !F,
|
|
449
|
-
...x.innerProps
|
|
450
|
-
}
|
|
451
|
-
)
|
|
452
|
-
}
|
|
453
|
-
);
|
|
454
|
-
}
|
|
455
|
-
export {
|
|
456
|
-
ne as ColorCrudFieldComponent,
|
|
457
|
-
le as SelectCrudFieldComponent,
|
|
458
|
-
Ne as default
|
|
459
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("react"),u=require("antd"),g=require("./CrudField.cjs");function h({form:d,purpose:m="new",...s}){return t.jsx(t.Fragment,{children:t.jsx(u.Form,{form:d,layout:"vertical",children:t.jsx(y,{...s,purpose:m})})})}function y({fields:d,formBuilder:m,grid:s,onDeleteFile:l,onUploadFile:o,purpose:c}){const f=i.useMemo(()=>d.filter(r=>!r.readonly).map(r=>{const a={onUploading:e=>{var n;r.onUploading&&((n=r.onUploading)==null||n.call(r,e)),o==null||o(e)},onDelete:e=>{var n;r.onUploading&&((n=r.onDelete)==null||n.call(r,e)),l==null||l(e)}};return t.jsx(i.Fragment,{children:r.grid&&s?t.jsx(u.Col,{...r.grid,children:i.createElement(g.default,{...r,...a,key:typeof r.name=="string"?r.name:String(r.name),updatable:c!=="update"?!0:r.updatable})}):i.createElement(g.default,{...r,...a,key:typeof r.name=="string"?r.name:String(r.name),updatable:c!=="update"?!0:r.updatable})},r.name)}),[d,s,l,o,c]),j=i.useCallback((r,a={})=>{const e=d.find(n=>n.name===r);if(e!=null&&e.hidden)return t.jsx(t.Fragment,{});if(e){const n=i.createElement(g.default,{...e,...a,key:typeof e.name=="string"?e.name:String(e.name),updatable:c!=="update"?!0:e.updatable});return a.render?a.render(n):n}return t.jsx(t.Fragment,{})},[d,c]);return t.jsx(t.Fragment,{children:m?t.jsxs(t.Fragment,{children:[m(j,{isAnyFieldHidden(...r){const a=Array.isArray(r)?r:[r];return d.filter(n=>a.includes(n.name)).some(n=>n.hidden)},isAllFieldsHidden(...r){const a=Array.isArray(r)?r:[r];return d.filter(n=>a.includes(n.name)).every(n=>n.hidden)}}),t.jsxs(u.Form.Item,{hidden:!0,noStyle:!0,children:[t.jsx(u.Input,{name:"id"}),t.jsx(u.Input,{})]})]}):s?t.jsx(u.Row,{gutter:[8,8],children:f}):f})}exports.CrudForm=h;exports.CrudFormFields=y;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { FormInstance } from 'antd';
|
|
2
|
-
import { CrudFieldProps, CrudPurpose, FormBuilderFunc } from './CrudComponent';
|
|
3
|
-
export interface CurdFormFieldsProps<T> {
|
|
4
|
-
onDeleteFile?: (e: any) => void;
|
|
5
|
-
onUploadFile?: (e: any) => void;
|
|
6
|
-
grid?: boolean;
|
|
7
|
-
formBuilder?: FormBuilderFunc<T>;
|
|
8
|
-
fields: CrudFieldProps<T>[];
|
|
9
|
-
purpose?: CrudPurpose;
|
|
10
|
-
}
|
|
11
|
-
export declare function CrudForm<T>({ form, purpose, ...props }: CurdFormFieldsProps<T> & {
|
|
12
|
-
form: FormInstance;
|
|
13
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export declare function CrudFormFields<T>({ fields, formBuilder, grid, onDeleteFile, onUploadFile, purpose, }: CurdFormFieldsProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { jsx as d, Fragment as m, jsxs as g } from "react/jsx-runtime";
|
|
2
|
-
import A, { useMemo as C, createElement as f, useCallback as k } from "react";
|
|
3
|
-
import { Form as p, Col as S, Input as h, Row as j } from "antd";
|
|
4
|
-
import s from "./CrudField.js";
|
|
5
|
-
function x({
|
|
6
|
-
form: e,
|
|
7
|
-
purpose: c = "new",
|
|
8
|
-
...i
|
|
9
|
-
}) {
|
|
10
|
-
return /* @__PURE__ */ d(m, { children: /* @__PURE__ */ d(p, { form: e, layout: "vertical", children: /* @__PURE__ */ d(v, { ...i, purpose: c }) }) });
|
|
11
|
-
}
|
|
12
|
-
function v({
|
|
13
|
-
fields: e,
|
|
14
|
-
formBuilder: c,
|
|
15
|
-
grid: i,
|
|
16
|
-
onDeleteFile: o,
|
|
17
|
-
onUploadFile: l,
|
|
18
|
-
purpose: u
|
|
19
|
-
}) {
|
|
20
|
-
const y = C(
|
|
21
|
-
() => e.filter((r) => !r.readonly).map((r) => {
|
|
22
|
-
const a = {
|
|
23
|
-
onUploading: (t) => {
|
|
24
|
-
var n;
|
|
25
|
-
r.onUploading && ((n = r.onUploading) == null || n.call(r, t)), l == null || l(t);
|
|
26
|
-
},
|
|
27
|
-
onDelete: (t) => {
|
|
28
|
-
var n;
|
|
29
|
-
r.onUploading && ((n = r.onDelete) == null || n.call(r, t)), o == null || o(t);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
return /* @__PURE__ */ d(A.Fragment, { children: r.grid && i ? /* @__PURE__ */ d(S, { ...r.grid, children: /* @__PURE__ */ f(
|
|
33
|
-
s,
|
|
34
|
-
{
|
|
35
|
-
...r,
|
|
36
|
-
...a,
|
|
37
|
-
key: typeof r.name == "string" ? r.name : String(r.name),
|
|
38
|
-
updatable: u !== "update" ? !0 : r.updatable
|
|
39
|
-
}
|
|
40
|
-
) }) : /* @__PURE__ */ f(
|
|
41
|
-
s,
|
|
42
|
-
{
|
|
43
|
-
...r,
|
|
44
|
-
...a,
|
|
45
|
-
key: typeof r.name == "string" ? r.name : String(r.name),
|
|
46
|
-
updatable: u !== "update" ? !0 : r.updatable
|
|
47
|
-
}
|
|
48
|
-
) }, r.name);
|
|
49
|
-
}),
|
|
50
|
-
[e, i, o, l, u]
|
|
51
|
-
), b = k(
|
|
52
|
-
(r, a = {}) => {
|
|
53
|
-
const t = e.find((n) => n.name === r);
|
|
54
|
-
if (t != null && t.hidden) return /* @__PURE__ */ d(m, {});
|
|
55
|
-
if (t) {
|
|
56
|
-
const n = /* @__PURE__ */ f(
|
|
57
|
-
s,
|
|
58
|
-
{
|
|
59
|
-
...t,
|
|
60
|
-
...a,
|
|
61
|
-
key: typeof t.name == "string" ? t.name : String(t.name),
|
|
62
|
-
updatable: u !== "update" ? !0 : t.updatable
|
|
63
|
-
}
|
|
64
|
-
);
|
|
65
|
-
return a.render ? a.render(n) : n;
|
|
66
|
-
}
|
|
67
|
-
return /* @__PURE__ */ d(m, {});
|
|
68
|
-
},
|
|
69
|
-
[e, u]
|
|
70
|
-
);
|
|
71
|
-
return /* @__PURE__ */ d(m, { children: c ? /* @__PURE__ */ g(m, { children: [
|
|
72
|
-
c(b, {
|
|
73
|
-
isAnyFieldHidden(...r) {
|
|
74
|
-
const a = Array.isArray(r) ? r : [r];
|
|
75
|
-
return e.filter((n) => a.includes(n.name)).some((n) => n.hidden);
|
|
76
|
-
},
|
|
77
|
-
isAllFieldsHidden(...r) {
|
|
78
|
-
const a = Array.isArray(r) ? r : [r];
|
|
79
|
-
return e.filter((n) => a.includes(n.name)).every((n) => n.hidden);
|
|
80
|
-
}
|
|
81
|
-
}),
|
|
82
|
-
/* @__PURE__ */ g(p.Item, { hidden: !0, noStyle: !0, children: [
|
|
83
|
-
/* @__PURE__ */ d(h, { name: "id" }),
|
|
84
|
-
/* @__PURE__ */ d(h, {})
|
|
85
|
-
] })
|
|
86
|
-
] }) : i ? /* @__PURE__ */ d(j, { gutter: [8, 8], children: y }) : y });
|
|
87
|
-
}
|
|
88
|
-
export {
|
|
89
|
-
x as CrudForm,
|
|
90
|
-
v as CrudFormFields
|
|
91
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),g=require("@ant-design/icons"),u=require("antd"),F=require("react"),k=require("react-i18next"),S=require("../../locale/hooks/translation-constants.cjs"),y=require("./CrudForm.cjs"),C=require("../common/button/Button.cjs"),T=require("../common/wizard/WizardViewForm.cjs");function v({fields:l,className:m,onDeleteFile:h,onUploadFile:i,purpose:c,wizard:r=[],updatingValue:f,onSave:x,submitting:j}){const d=F.useMemo(()=>r.map(n=>{let t=!0;const o=l.filter(s=>n.fields.includes(s.name));return o.forEach(s=>t&&(t=s.hidden??!1)),{...n,hidden:t,fieldThatShouldShowing:o}}),[l,r]),a=F.useMemo(()=>d.filter(n=>!n.hidden),[d]);return e.jsx(e.Fragment,{children:e.jsx(T,{onSubmit:(n,t)=>{console.log(t),x(t)},className:m,pages:a.map(({title:n,icon:t,fieldThatShouldShowing:o,hidden:s},b)=>({title:n,icon:t,hidden:s,component:q=>e.jsx(R,{fields:o,onDeleteFile:h,onUploadFile:i,purpose:c,i:b,updatingValue:f,backward:q.backward,forward:q.forward,wizard:a,submitting:j},b)}))})})}function R({fields:l,onDeleteFile:m,onUploadFile:h,purpose:i,wizard:c=[],i:r,forward:f,backward:x,submitting:j,updatingValue:d}){const a=c[r],{t:n}=k.useTranslation(S.TRANSLATION_NAMESPACE),[t]=u.Form.useForm();return F.useEffect(()=>{if(d&&(i==="update"||i==="clone")){const o={};for(const s of l)o[s.name]=d[s.name];t.setFieldsValue(o)}},[l,t,i,d]),e.jsxs(u.Form,{name:String(r),form:t,layout:"vertical",children:[e.jsx(y.CrudFormFields,{fields:l,formBuilder:a.formBuilder,grid:a.grid,onDeleteFile:m,onUploadFile:h,purpose:i}),e.jsx(u.Divider,{}),e.jsxs(u.Row,{gutter:[8,8],children:[r>0&&e.jsx(u.Col,{md:12,children:e.jsx(C,{block:!0,icon:e.jsx(g.LeftOutlined,{}),htmlType:"button",type:"default",size:"large",onClick:()=>x(),children:n("str.back")})}),e.jsx(u.Col,{md:r>0?12:24,children:e.jsx(C,{block:!0,icon:c.length-1===r?e.jsx(g.SaveOutlined,{}):e.jsx(g.RightOutlined,{}),htmlType:"submit",type:"primary",loading:j,size:"large",onClick:()=>{t.validateFields().then(o=>{f(o,c.length-1===r,c.length-1===r)})},children:c.length-1===r?n("str."+(i==="update"?"update":"save")):n("str.next")})})]})]})}module.exports=v;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CrudFieldProps, CrudPurpose, CrudWizardProp } from './CrudComponent';
|
|
2
|
-
export interface CrudFormWizardProps<T> {
|
|
3
|
-
onDeleteFile?: (e: any) => void;
|
|
4
|
-
onUploadFile?: (e: any) => void;
|
|
5
|
-
fields: CrudFieldProps<T>[];
|
|
6
|
-
purpose?: CrudPurpose;
|
|
7
|
-
wizard?: CrudWizardProp<T>[];
|
|
8
|
-
className?: string;
|
|
9
|
-
onSave: (e: T) => void;
|
|
10
|
-
updatingValue?: T;
|
|
11
|
-
submitting?: boolean;
|
|
12
|
-
}
|
|
13
|
-
declare function CrudFormWizard<T>({ fields, className, onDeleteFile, onUploadFile, purpose, wizard, updatingValue, onSave, submitting, }: CrudFormWizardProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export default CrudFormWizard;
|