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