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