@kingteza/crud-component 1.36.1 → 1.38.0

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.
@@ -1,537 +1,569 @@
1
- import { jsx as t, Fragment as I, jsxs as M } from "react/jsx-runtime";
2
- import { Form as L, Radio as W, Checkbox as _, Col as re, Select as S, Tag as $, ColorPicker as te } from "antd";
3
- import { useEffect as j, useState as z, useMemo as J, useCallback as K } from "react";
4
- import oe from "react-highlight-words";
5
- import { useTranslationLibNoNS as ae } from "../locale/index.es.js";
6
- import le from "./FileCrudField.es.js";
7
- import ne from "./ImageCrudField.es.js";
8
- import ie from "../common/check-box/CheckBox.es.js";
9
- import de from "../common/date-picker/DatePicker.es.js";
10
- import se from "../common/date-picker/TimePicker.es.js";
11
- import V from "../common/select/SelectComponent.es.js";
12
- import ce from "../common/text-field/NumberField.es.js";
13
- import me from "../common/text-field/PhoneNumberField.es.js";
14
- import ue from "../common/text-field/TextField.es.js";
15
- import he from "../common/tooltip/TooltipComponent.es.js";
16
- import pe from "./CrudTextAreaComponent.es.js";
17
- import Q from "../util/CrudUtil.es.js";
18
- function je(F) {
1
+ import { jsx as r, Fragment as A, jsxs as $ } from "react/jsx-runtime";
2
+ import { Form as L, ColorPicker as ae, Radio as z, Checkbox as J, Col as ne, Select as E, Tag as K } from "antd";
3
+ import { useEffect as G, useCallback as j, useState as Q, useMemo as V } from "react";
4
+ import le from "react-highlight-words";
5
+ import { useTranslationLibNoNS as ie } from "../locale/index.es.js";
6
+ import de from "./FileCrudField.es.js";
7
+ import se from "./ImageCrudField.es.js";
8
+ import ce from "../common/check-box/CheckBox.es.js";
9
+ import me from "../common/date-picker/DatePicker.es.js";
10
+ import ue from "../common/date-picker/TimePicker.es.js";
11
+ import Y from "../common/select/SelectComponent.es.js";
12
+ import he from "../common/text-field/NumberField.es.js";
13
+ import fe from "../common/text-field/PhoneNumberField.es.js";
14
+ import pe from "../common/text-field/TextField.es.js";
15
+ import ge from "../common/tooltip/TooltipComponent.es.js";
16
+ import Ce from "./CrudTextAreaComponent.es.js";
17
+ import X from "../util/CrudUtil.es.js";
18
+ import { useCrudSearchContext as U } from "../context/CrudSearchContext.es.js";
19
+ function Ue(x) {
19
20
  const {
20
- label: n,
21
- name: c,
22
- type: v,
23
- required: s,
24
- hidden: H,
25
- rules: h = [],
26
- updatable: p = !0,
27
- readonly: R = !1,
28
- fieldClassName: m,
29
- customFormFieldRender: T,
30
- fieldTooltip: x,
31
- fieldHelper: f,
32
- formLayoutProps: N,
21
+ label: i,
22
+ name: s,
23
+ type: c,
24
+ required: u,
25
+ hidden: I,
26
+ rules: b = [],
27
+ updatable: h = !0,
28
+ readonly: y = !1,
29
+ fieldClassName: f,
30
+ customFormFieldRender: w,
31
+ fieldTooltip: R,
32
+ fieldHelper: p,
33
+ formLayoutProps: T,
33
34
  ...e
34
- } = F, C = L.useFormInstance();
35
- j(() => {
36
- if (v === "select") {
35
+ } = x, l = L.useFormInstance();
36
+ G(() => {
37
+ if (c === "select") {
37
38
  const {
38
- items: o = [],
39
- onSearch: l,
40
- searchOnType: i
39
+ items: a = [],
40
+ onSearch: n,
41
+ searchOnType: m
41
42
  } = e;
42
- !(o != null && o.length) && !i && (l == null || l(void 0, C, e == null ? void 0 : e.updatingValue));
43
+ !(a != null && a.length) && !m && (n == null || n(void 0, l, e == null ? void 0 : e.updatingValue));
43
44
  }
44
- }, [C, e, v, e == null ? void 0 : e.updatingValue]);
45
- const { t: P } = ae();
46
- if (R || H) return /* @__PURE__ */ t(I, {});
47
- if (T)
48
- return T(C, F);
49
- switch (v) {
45
+ }, [l, e, c, e == null ? void 0 : e.updatingValue]);
46
+ const P = U(), C = j((a, n) => {
47
+ P && P.search(), !y && n && n(a, l);
48
+ }, [P, y, l]);
49
+ if (y || I) return /* @__PURE__ */ r(A, {});
50
+ if (w)
51
+ return w(l, x);
52
+ switch (c) {
50
53
  case "text":
51
54
  case "email":
52
55
  case "password": {
53
- const { maxLength: o, onChange: l, placeholder: i, addonAfter: g, addonBefore: b } = e;
54
- return /* @__PURE__ */ t(
55
- ue,
56
+ const { maxLength: a, onChange: n, placeholder: m, addonAfter: v, addonBefore: d } = e;
57
+ return /* @__PURE__ */ r(
58
+ pe,
56
59
  {
57
- ...N,
58
- maxLength: o,
59
- placeholder: i,
60
- disabled: !p,
61
- rules: h,
62
- required: s,
63
- onChange: l ? (d) => l(d, C) : void 0,
64
- type: v,
65
- name: c,
66
- tooltip: x,
67
- label: n,
68
- className: m,
60
+ ...T,
61
+ maxLength: a,
62
+ placeholder: m,
63
+ disabled: !h,
64
+ rules: b,
65
+ required: u,
66
+ onChange: n ? (N) => n(N, l) : void 0,
67
+ type: c,
68
+ name: s,
69
+ tooltip: R,
70
+ label: i,
71
+ className: f,
69
72
  autoComplete: "new-password",
70
- addonAfter: g,
71
- addonBefore: b,
72
- help: f
73
+ addonAfter: v,
74
+ addonBefore: d,
75
+ help: p
73
76
  }
74
77
  );
75
78
  }
76
79
  case "phone": {
77
- const { onChange: o, placeholder: l, addonAfter: i, addonBefore: g } = e;
78
- return /* @__PURE__ */ t(
79
- me,
80
+ const { onChange: a, placeholder: n, addonAfter: m, addonBefore: v } = e;
81
+ return /* @__PURE__ */ r(
82
+ fe,
80
83
  {
81
84
  ...e,
82
- ...N,
83
- placeholder: l,
84
- disabled: !p,
85
- rules: h,
86
- required: s,
87
- onChange: o ? (b) => o(b, C) : void 0,
88
- type: v,
89
- name: c,
90
- tooltip: x,
91
- label: n,
92
- className: m,
85
+ ...T,
86
+ placeholder: n,
87
+ disabled: !h,
88
+ rules: b,
89
+ required: u,
90
+ onChange: a ? (d) => a(d, l) : void 0,
91
+ type: c,
92
+ name: s,
93
+ tooltip: R,
94
+ label: i,
95
+ className: f,
93
96
  autoComplete: "new-password",
94
- addonAfter: i,
95
- addonBefore: g,
96
- help: f
97
+ addonAfter: m,
98
+ addonBefore: v,
99
+ help: p
97
100
  }
98
101
  );
99
102
  }
100
103
  case "number": {
101
104
  const {
102
- onChange: o,
103
- placeholder: l,
104
- allowMinus: i,
105
- min: g,
106
- max: b,
107
- addonAfter: d,
108
- addonBefore: w
105
+ onChange: a,
106
+ placeholder: n,
107
+ allowMinus: m,
108
+ min: v,
109
+ max: d,
110
+ addonAfter: N,
111
+ addonBefore: k,
112
+ int: H
109
113
  } = e;
110
- return /* @__PURE__ */ t(
111
- ce,
114
+ return /* @__PURE__ */ r(
115
+ he,
112
116
  {
113
- ...N,
114
- placeholder: l,
115
- disabled: !p,
117
+ ...T,
118
+ placeholder: n,
119
+ disabled: !h,
116
120
  moneyField: !!e.formatted,
117
- type: v,
118
- onChange: o ? (r) => o(r, C) : void 0,
119
- rules: h,
121
+ type: c,
122
+ onChange: a ? (o) => a(o, l) : void 0,
123
+ rules: b,
120
124
  autoComplete: "false",
121
- required: s,
122
- tooltip: x,
123
- className: m,
124
- min: i ? null : g,
125
- max: b,
126
- addonAfter: d,
127
- addonBefore: w,
128
- name: c,
129
- label: n,
130
- help: f
125
+ required: u,
126
+ tooltip: R,
127
+ className: f,
128
+ min: m ? null : v,
129
+ max: d,
130
+ addonAfter: N,
131
+ addonBefore: k,
132
+ name: s,
133
+ label: i,
134
+ help: p,
135
+ isInt: H
131
136
  }
132
137
  );
133
138
  }
134
139
  case "date": {
135
140
  const {
136
- range: o,
137
- disableToday: l,
138
- disabledFutureDays: i,
139
- disabledPastDays: g,
140
- onChange: b,
141
- placeholder: d,
142
- format: w
141
+ range: a,
142
+ disableToday: n,
143
+ disabledFutureDays: m,
144
+ disabledPastDays: v,
145
+ onChange: d,
146
+ placeholder: N,
147
+ format: k
143
148
  } = e;
144
- return /* @__PURE__ */ t(
145
- de,
149
+ return /* @__PURE__ */ r(
150
+ me,
146
151
  {
147
- ...N,
148
- placeholder: d,
149
- required: s,
150
- disabled: !p,
151
- type: v,
152
- format: w,
153
- tooltip: x,
154
- range: o,
155
- name: c,
156
- label: n,
157
- onChange: b ? (r) => b(r, C) : void 0,
158
- className: m,
159
- disableToday: l,
160
- disabledFutureDays: i,
161
- disabledPastDays: g,
162
- help: f
152
+ ...T,
153
+ placeholder: N,
154
+ required: u,
155
+ disabled: !h,
156
+ type: c,
157
+ format: k,
158
+ tooltip: R,
159
+ range: a,
160
+ name: s,
161
+ label: i,
162
+ onChange: C,
163
+ className: f,
164
+ disableToday: n,
165
+ disabledFutureDays: m,
166
+ disabledPastDays: v,
167
+ help: p
163
168
  }
164
169
  );
165
170
  }
166
171
  case "time": {
167
172
  const {
168
- range: o = !1,
169
- disableCurrent: l,
170
- disabledFuture: i,
171
- disabledPast: g,
172
- onChange: b,
173
- use12Hours: d,
174
- format: w,
175
- placeholder: r
173
+ range: a = !1,
174
+ disableCurrent: n,
175
+ disabledFuture: m,
176
+ disabledPast: v,
177
+ onChange: d,
178
+ use12Hours: N,
179
+ format: k,
180
+ placeholder: H
176
181
  } = e;
177
- return /* @__PURE__ */ t(
178
- se,
182
+ return /* @__PURE__ */ r(
183
+ ue,
179
184
  {
180
- ...N,
181
- placeholder: r,
182
- required: s,
183
- format: w,
184
- disabled: !p,
185
- type: v,
186
- tooltip: x,
187
- range: o,
188
- use12Hours: d,
189
- name: c,
190
- label: n,
191
- onChange: b ? (y) => b(y, C) : void 0,
192
- className: m,
193
- disableCurrent: l,
194
- disabledFuture: i,
195
- disabledPast: g,
196
- help: f
185
+ ...T,
186
+ placeholder: H,
187
+ required: u,
188
+ format: k,
189
+ disabled: !h,
190
+ type: c,
191
+ tooltip: R,
192
+ range: a,
193
+ use12Hours: N,
194
+ name: s,
195
+ label: i,
196
+ onChange: C,
197
+ className: f,
198
+ disableCurrent: n,
199
+ disabledFuture: m,
200
+ disabledPast: v,
201
+ help: p
197
202
  }
198
203
  );
199
204
  }
200
205
  case "textarea":
201
- return /* @__PURE__ */ t(pe, { ...F });
206
+ return /* @__PURE__ */ r(Ce, { ...x });
202
207
  case "image":
203
- return /* @__PURE__ */ t(
204
- ne,
208
+ return /* @__PURE__ */ r(
209
+ se,
205
210
  {
206
211
  ...e,
207
- required: s,
208
- name: c,
209
- label: n,
210
- rules: h,
211
- fieldHelper: f,
212
- fieldClassName: m,
212
+ required: u,
213
+ name: s,
214
+ label: i,
215
+ rules: b,
216
+ fieldHelper: p,
217
+ fieldClassName: f,
213
218
  onRemoved: e.onRemoved,
214
219
  onUploading: e.onUploading,
215
220
  provider: e.provider
216
221
  }
217
222
  );
218
223
  case "file":
219
- return /* @__PURE__ */ t(
220
- le,
224
+ return /* @__PURE__ */ r(
225
+ de,
221
226
  {
222
227
  ...e,
223
- required: s,
224
- name: c,
225
- label: n,
226
- rules: h,
227
- fieldHelper: f,
228
- fieldClassName: m,
228
+ required: u,
229
+ name: s,
230
+ label: i,
231
+ rules: b,
232
+ fieldHelper: p,
233
+ fieldClassName: f,
229
234
  onRemoved: e.onRemoved,
230
235
  onUploading: e.onUploading,
231
236
  provider: e.provider
232
237
  }
233
238
  );
234
239
  case "select":
235
- return /* @__PURE__ */ t(
236
- fe,
237
- {
238
- ...e,
239
- required: s,
240
- name: c,
241
- label: n,
242
- rules: h,
243
- fieldClassName: m,
244
- form: C,
245
- help: f,
246
- updatable: p,
247
- readonly: R,
248
- fieldTooltip: x,
249
- fieldHelper: f
250
- }
251
- );
252
- case "enum": {
253
- const {
254
- enum: o,
255
- translation: l,
256
- onChange: i,
257
- onSearch: g,
258
- multiple: b,
259
- tagRender: d
260
- } = e, w = Array.isArray(o) ? o : Object.keys(o);
261
- return "radio" in e && e.radio ? /* @__PURE__ */ t(
262
- L.Item,
263
- {
264
- ...e,
265
- ...N,
266
- name: c,
267
- required: s,
268
- tooltip: x,
269
- rules: h,
270
- label: n,
271
- className: ["w-100", m].join(" "),
272
- help: f,
273
- children: /* @__PURE__ */ t(
274
- W.Group,
275
- {
276
- ...e,
277
- onChange: i ? (r) => {
278
- var y;
279
- return i((y = r == null ? void 0 : r.target) == null ? void 0 : y.value, C);
280
- } : void 0,
281
- children: w.map((r) => /* @__PURE__ */ t(W, { disabled: !p, value: r, children: l ? P(l[r]) : r }, r))
282
- }
283
- )
284
- }
285
- ) : "checkbox" in e && e.checkbox ? /* @__PURE__ */ t(
286
- L.Item,
287
- {
288
- ...e,
289
- ...N,
290
- name: c,
291
- required: s,
292
- tooltip: x,
293
- rules: h,
294
- label: n,
295
- className: ["w-100", m].join(" "),
296
- help: f,
297
- children: /* @__PURE__ */ t(_.Group, { className: "w-100", children: w.map((r) => {
298
- const y = /* @__PURE__ */ t(_, { disabled: !p, value: r, children: l ? P(l[r]) : r }, r);
299
- return "checkboxGrid" in e && e.checkboxGrid ? /* @__PURE__ */ t(re, { ...e.checkboxGrid, children: y }) : y;
300
- }) })
301
- }
302
- ) : /* @__PURE__ */ t(
303
- V,
240
+ return /* @__PURE__ */ r(
241
+ xe,
304
242
  {
305
243
  ...e,
306
- ...N,
307
- tagRender: typeof d == "function" ? d : d ? (r) => {
308
- const { value: y, label: O } = r, k = d[y];
309
- return k ? /* @__PURE__ */ t($, { color: k.color, children: O }) : /* @__PURE__ */ t($, { children: O });
310
- } : void 0,
311
- onChange: i ? (r) => i(r, C) : void 0,
312
- className: ["w-100", m].join(" "),
313
- name: c,
314
- items: w,
315
- required: s,
316
- tooltip: x,
317
- rules: h,
318
- label: n,
319
- help: f,
320
- disabled: !p,
321
- onSearch: g ? (r) => g(r, C) : void 0,
322
- allowClear: !0,
323
- mode: b ? "multiple" : void 0,
324
- showLoadingInEmptyIndicator: !0,
325
- itemBuilder: (r) => /* @__PURE__ */ t(S.Option, { value: r, children: l ? P(l[r]) : r }, r)
244
+ required: u,
245
+ name: s,
246
+ label: i,
247
+ rules: b,
248
+ fieldClassName: f,
249
+ form: l,
250
+ help: p,
251
+ updatable: h,
252
+ readonly: y,
253
+ fieldTooltip: R,
254
+ fieldHelper: p
326
255
  }
327
256
  );
328
- }
257
+ case "enum":
258
+ return /* @__PURE__ */ r(be, { ...x });
329
259
  case "checkbox": {
330
- const { onChange: o, switch: l } = e;
331
- return /* @__PURE__ */ t(
332
- ie,
260
+ const { onChange: a, switch: n } = e;
261
+ return /* @__PURE__ */ r(
262
+ ce,
333
263
  {
334
- ...N,
335
- className: m,
336
- rules: h,
337
- onChange: o ? (i) => o(i, C) : void 0,
338
- label: n,
339
- tooltip: x,
340
- disabled: !p,
341
- name: c,
342
- help: f,
343
- switch: l
264
+ ...T,
265
+ className: f,
266
+ rules: b,
267
+ onChange: C,
268
+ label: i,
269
+ tooltip: R,
270
+ disabled: !h,
271
+ name: s,
272
+ help: p,
273
+ switch: n
344
274
  }
345
275
  );
346
276
  }
347
277
  case "color":
348
- return /* @__PURE__ */ t(
349
- ge,
278
+ return /* @__PURE__ */ r(
279
+ ye,
350
280
  {
351
281
  ...e,
352
282
  type: "color",
353
- required: s,
354
- name: c,
355
- label: n,
356
- rules: h,
357
- fieldClassName: m,
358
- updatable: p,
359
- readonly: R,
360
- fieldTooltip: x,
361
- fieldHelper: f
283
+ required: u,
284
+ name: s,
285
+ label: i,
286
+ rules: b,
287
+ fieldClassName: f,
288
+ updatable: h,
289
+ readonly: y,
290
+ fieldTooltip: R,
291
+ fieldHelper: p
362
292
  }
363
293
  );
364
294
  default:
365
- return /* @__PURE__ */ t(I, { children: `${v} Not Implemented` });
295
+ return /* @__PURE__ */ r(A, { children: `${c} Not Implemented` });
366
296
  }
367
297
  }
368
- function fe(F) {
298
+ function be(x) {
299
+ const i = L.useFormInstance(), {
300
+ label: s,
301
+ name: c,
302
+ type: u,
303
+ required: I,
304
+ hidden: b,
305
+ rules: h = [],
306
+ updatable: y = !0,
307
+ readonly: f = !1,
308
+ fieldClassName: w,
309
+ customFormFieldRender: R,
310
+ fieldTooltip: p,
311
+ fieldHelper: T,
312
+ formLayoutProps: e,
313
+ ...l
314
+ } = x, { t: P } = ie(), {
315
+ enum: C,
316
+ translation: a,
317
+ onChange: n,
318
+ onSearch: m,
319
+ multiple: v,
320
+ tagRender: d
321
+ } = l, N = Array.isArray(C) ? C : Object.keys(C), k = U(), H = j(
322
+ (o) => {
323
+ k && k.search(), !f && n && n(o, i);
324
+ },
325
+ [k, f, n, i]
326
+ );
327
+ return "radio" in l && l.radio ? /* @__PURE__ */ r(
328
+ L.Item,
329
+ {
330
+ ...l,
331
+ ...e,
332
+ name: c,
333
+ required: I,
334
+ tooltip: p,
335
+ rules: h,
336
+ label: s,
337
+ className: ["w-100", w].join(" "),
338
+ help: T,
339
+ children: /* @__PURE__ */ r(
340
+ z.Group,
341
+ {
342
+ ...l,
343
+ onChange: (o) => {
344
+ var F;
345
+ return H((F = o == null ? void 0 : o.target) == null ? void 0 : F.value);
346
+ },
347
+ children: N.map((o) => /* @__PURE__ */ r(z, { disabled: !y, value: o, children: a ? P(a[o]) : o }, o))
348
+ }
349
+ )
350
+ }
351
+ ) : "checkbox" in l && l.checkbox ? /* @__PURE__ */ r(
352
+ L.Item,
353
+ {
354
+ ...l,
355
+ ...e,
356
+ name: c,
357
+ required: I,
358
+ tooltip: p,
359
+ rules: h,
360
+ label: s,
361
+ className: ["w-100", w].join(" "),
362
+ help: T,
363
+ children: /* @__PURE__ */ r(J.Group, { className: "w-100", onChange: H, children: N.map((o) => {
364
+ const F = /* @__PURE__ */ r(J, { disabled: !y, value: o, children: a ? P(a[o]) : o }, o);
365
+ return "checkboxGrid" in l && l.checkboxGrid ? /* @__PURE__ */ r(ne, { ...l.checkboxGrid, children: F }) : F;
366
+ }) })
367
+ }
368
+ ) : /* @__PURE__ */ r(
369
+ Y,
370
+ {
371
+ ...l,
372
+ ...e,
373
+ notSearch: !0,
374
+ tagRender: typeof d == "function" ? d : d ? (o) => {
375
+ const { value: F, label: S } = o, O = d[F];
376
+ return O ? /* @__PURE__ */ r(K, { color: O.color, children: S }) : /* @__PURE__ */ r(K, { children: S });
377
+ } : void 0,
378
+ onChange: H,
379
+ className: ["w-100", w].join(" "),
380
+ name: c,
381
+ items: N,
382
+ required: I,
383
+ tooltip: p,
384
+ rules: h,
385
+ label: s,
386
+ help: T,
387
+ disabled: !y,
388
+ onSearch: m ? (o) => m(o, i) : void 0,
389
+ allowClear: !0,
390
+ mode: v ? "multiple" : void 0,
391
+ showLoadingInEmptyIndicator: !0,
392
+ itemBuilder: (o) => /* @__PURE__ */ r(E.Option, { value: o, children: a ? P(a[o]) : o }, o)
393
+ }
394
+ );
395
+ }
396
+ function xe(x) {
369
397
  const {
370
- items: n = [],
371
- loading: c,
372
- searchOnType: v,
373
- onSearch: s,
374
- multiple: H,
375
- onChange: h,
376
- highlightSearch: p,
377
- required: R,
378
- fieldClassName: m,
379
- rules: T,
380
- fieldTooltip: x,
381
- updatable: f,
382
- label: N,
398
+ items: i = [],
399
+ loading: s,
400
+ searchOnType: c,
401
+ onSearch: u,
402
+ multiple: I,
403
+ onChange: b,
404
+ highlightSearch: h,
405
+ required: y,
406
+ fieldClassName: f,
407
+ rules: w,
408
+ fieldTooltip: R,
409
+ updatable: p,
410
+ label: T,
383
411
  name: e,
384
- tagRender: C,
412
+ tagRender: l,
385
413
  updatingValue: P,
386
- onSet: o,
387
- placeholder: l,
388
- allowClear: i = !0,
389
- selectOptionRender: g,
390
- formLayoutProps: b
391
- } = F, d = F.form, [w, r] = z(""), y = J(() => Q.getRealName(e), [e]), O = J(
392
- () => Q.getRealName(e, "upsertFieldName"),
414
+ onSet: C,
415
+ placeholder: a,
416
+ allowClear: n = !0,
417
+ selectOptionRender: m,
418
+ formLayoutProps: v
419
+ } = x, d = x.form, [N, k] = Q(""), H = V(() => X.getRealName(e), [e]), o = V(
420
+ () => X.getRealName(e, "upsertFieldName"),
393
421
  [e]
394
- ), k = L.useWatch(y, d), [A, B] = z(!0);
395
- j(() => {
396
- o && A && k && (o == null || o(k, n, d), B(!1));
397
- }, [A, d, n, y, o, k]), j(() => {
398
- k && B(!0);
399
- }, [k]);
400
- const X = K(
401
- async (a) => {
402
- r(a), v && (s == null || s(a, d, P));
422
+ ), F = L.useWatch(H, d), [S, O] = Q(!0);
423
+ G(() => {
424
+ C && S && F && (C == null || C(F, i, d), O(!1));
425
+ }, [S, d, i, H, C, F]), G(() => {
426
+ F && O(!0);
427
+ }, [F]);
428
+ const Z = j(
429
+ async (t) => {
430
+ k(t), c && (u == null || u(t, d, P));
431
+ },
432
+ [d, u, c, P]
433
+ ), ee = j(
434
+ (t) => m ? m(t) : t.value,
435
+ [m]
436
+ ), B = U(), re = j(
437
+ (t) => {
438
+ B && B.search(), b && (k(""), b(t, d));
403
439
  },
404
- [d, s, v, P]
405
- ), Y = K(
406
- (a) => g ? g(a) : a.value,
407
- [g]
440
+ [B, b, d]
408
441
  );
409
- return /* @__PURE__ */ t(
410
- V,
442
+ return /* @__PURE__ */ r(
443
+ Y,
411
444
  {
412
- ...F,
413
- ...b,
445
+ ...x,
446
+ ...v,
414
447
  showLoadingInEmptyIndicator: !0,
415
448
  maxTagCount: "responsive",
416
- maxTagPlaceholder: (a) => /* @__PURE__ */ M(
417
- he,
449
+ maxTagPlaceholder: (t) => /* @__PURE__ */ $(
450
+ ge,
418
451
  {
419
- title: /* @__PURE__ */ t(I, { children: a.map((u) => /* @__PURE__ */ M(I, { children: [
420
- u.label,
452
+ title: /* @__PURE__ */ r(A, { children: t.map((g) => /* @__PURE__ */ $(A, { children: [
453
+ g.label,
421
454
  " ",
422
- /* @__PURE__ */ t("br", {})
455
+ /* @__PURE__ */ r("br", {})
423
456
  ] })) }),
424
457
  children: [
425
458
  "+",
426
- a == null ? void 0 : a.length
459
+ t == null ? void 0 : t.length
427
460
  ]
428
461
  }
429
462
  ),
430
- placeholder: l,
431
- onSelect: (a) => {
432
- o == null || o(a == null ? void 0 : a.key, n, d);
463
+ placeholder: a,
464
+ onSelect: (t) => {
465
+ C == null || C(t == null ? void 0 : t.key, i, d);
433
466
  },
434
- onChange: h ? (a) => {
435
- r(""), h(a, d);
436
- } : void 0,
437
- mode: H ? "multiple" : void 0,
438
- className: ["w-100", m].join(" "),
439
- name: O,
440
- items: n,
441
- required: R,
442
- tooltip: x,
443
- tagRender: C,
444
- rules: T,
445
- disabled: !f,
446
- label: N,
447
- allowClear: i,
448
- onSearch: X,
449
- loading: c,
450
- filterOption: p ? (a, u) => {
451
- var E, G, U;
467
+ onChange: re,
468
+ mode: I ? "multiple" : void 0,
469
+ className: ["w-100", f].join(" "),
470
+ name: o,
471
+ items: i,
472
+ required: y,
473
+ tooltip: R,
474
+ tagRender: l,
475
+ rules: w,
476
+ disabled: !p,
477
+ label: T,
478
+ allowClear: n,
479
+ onSearch: Z,
480
+ loading: s,
481
+ filterOption: h ? (t, g) => {
482
+ var q, D, M;
452
483
  try {
453
- const q = a.toLowerCase().split(/\s+/), Z = ((typeof (u == null ? void 0 : u.children) == "string" ? u == null ? void 0 : u.children : (G = (E = u == null ? void 0 : u.children) == null ? void 0 : E.props) == null ? void 0 : G.textToHighlight) ?? "").toLowerCase(), ee = (((U = u == null ? void 0 : u.value) == null ? void 0 : U.toString()) ?? "").toLowerCase();
454
- return q.every(
455
- (D) => Z.indexOf(D) >= 0 || ee.indexOf(D) >= 0
484
+ const W = t.toLowerCase().split(/\s+/), te = ((typeof (g == null ? void 0 : g.children) == "string" ? g == null ? void 0 : g.children : (D = (q = g == null ? void 0 : g.children) == null ? void 0 : q.props) == null ? void 0 : D.textToHighlight) ?? "").toLowerCase(), oe = (((M = g == null ? void 0 : g.value) == null ? void 0 : M.toString()) ?? "").toLowerCase();
485
+ return W.every(
486
+ (_) => te.indexOf(_) >= 0 || oe.indexOf(_) >= 0
456
487
  );
457
488
  } catch {
458
489
  return !0;
459
490
  }
460
491
  } : void 0,
461
- itemBuilder: p ? (a) => {
462
- const u = a.value ? String(a.value) : void 0;
463
- return /* @__PURE__ */ t(
464
- S.Option,
492
+ itemBuilder: h ? (t) => {
493
+ const g = t.value ? String(t.value) : void 0;
494
+ return /* @__PURE__ */ r(
495
+ E.Option,
465
496
  {
466
- value: a.key,
467
- title: u,
468
- disabled: a.disabled,
469
- children: /* @__PURE__ */ t(
470
- oe,
497
+ value: t.key,
498
+ title: g,
499
+ disabled: t.disabled,
500
+ children: /* @__PURE__ */ r(
501
+ le,
471
502
  {
472
503
  highlightClassName: "highlight-text",
473
- searchWords: (w ?? "").split(" "),
504
+ searchWords: (N ?? "").split(" "),
474
505
  autoEscape: !0,
475
- textToHighlight: u ?? ""
506
+ textToHighlight: g ?? ""
476
507
  }
477
508
  )
478
509
  },
479
- a.key
510
+ t.key
480
511
  );
481
- } : (a) => /* @__PURE__ */ t(
482
- S.Option,
512
+ } : (t) => /* @__PURE__ */ r(
513
+ E.Option,
483
514
  {
484
- value: a.key,
485
- title: a.value,
486
- disabled: a.disabled,
487
- children: Y(a)
515
+ value: t.key,
516
+ title: t.value,
517
+ disabled: t.disabled,
518
+ children: ee(t)
488
519
  },
489
- a.key
520
+ t.key
490
521
  )
491
522
  }
492
523
  );
493
524
  }
494
- function ge(F) {
525
+ function ye(x) {
495
526
  const {
496
- formLayoutProps: n,
497
- required: c,
498
- fieldClassName: v,
499
- rules: s,
500
- fieldTooltip: H,
501
- updatable: h,
502
- label: p,
503
- name: R,
504
- fieldHelper: m
505
- } = F;
506
- return /* @__PURE__ */ t(
527
+ formLayoutProps: i,
528
+ required: s,
529
+ fieldClassName: c,
530
+ rules: u,
531
+ fieldTooltip: I,
532
+ updatable: b,
533
+ label: h,
534
+ name: y,
535
+ fieldHelper: f
536
+ } = x;
537
+ return /* @__PURE__ */ r(
507
538
  L.Item,
508
539
  {
509
- ...n,
510
- label: p,
511
- name: R,
512
- required: c,
513
- rules: s,
514
- tooltip: H,
515
- help: m,
516
- getValueFromEvent: (T) => typeof T == "object" ? T.toHexString() : T,
517
- children: /* @__PURE__ */ t(
518
- te,
540
+ ...i,
541
+ label: h,
542
+ name: y,
543
+ required: s,
544
+ rules: u,
545
+ tooltip: I,
546
+ help: f,
547
+ getValueFromEvent: (w) => typeof w == "object" ? w.toHexString() : w,
548
+ children: /* @__PURE__ */ r(
549
+ ae,
519
550
  {
520
551
  disabledAlpha: !0,
521
552
  format: "hex",
522
553
  defaultFormat: "hex",
523
554
  showText: !0,
524
555
  trigger: "click",
525
- className: v,
526
- disabled: !h,
527
- ...F.innerProps
556
+ className: c,
557
+ disabled: !b,
558
+ ...x.innerProps
528
559
  }
529
560
  )
530
561
  }
531
562
  );
532
563
  }
533
564
  export {
534
- ge as ColorCrudFieldComponent,
535
- fe as SelectCrudFieldComponent,
536
- je as default
565
+ ye as ColorCrudFieldComponent,
566
+ be as EnumCrudFieldComponent,
567
+ xe as SelectCrudFieldComponent,
568
+ Ue as default
537
569
  };