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