@gnwebsoft/ui 3.0.0 → 3.0.2

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.
Files changed (74) hide show
  1. package/README.md +688 -0
  2. package/dist/chunk-4H3AFH7A.js +505 -0
  3. package/dist/chunk-DE62KYFK.js +122 -0
  4. package/dist/chunk-DEPJRTVT.js +1 -0
  5. package/dist/chunk-EBRUE2WR.cjs +493 -0
  6. package/dist/chunk-FD57PCAC.cjs +1 -0
  7. package/dist/chunk-H3GQLELL.js +2025 -0
  8. package/dist/chunk-MVPLBJRK.cjs +1 -0
  9. package/dist/chunk-OJF67RNM.js +1 -0
  10. package/dist/chunk-OT7COE7R.cjs +2025 -0
  11. package/dist/chunk-R2YK4LTT.cjs +122 -0
  12. package/dist/chunk-U6SDYCWF.js +493 -0
  13. package/dist/chunk-ZC7FGYL2.cjs +505 -0
  14. package/dist/components/index.cjs +25 -0
  15. package/dist/components/index.d.cts +752 -0
  16. package/dist/components/index.d.ts +664 -15
  17. package/dist/components/index.js +25 -24
  18. package/dist/enhanced-z-I7EHVS.d.cts +134 -0
  19. package/dist/enhanced-z-I7EHVS.d.ts +134 -0
  20. package/dist/hooks/index.cjs +12 -0
  21. package/dist/hooks/index.d.cts +95 -0
  22. package/dist/hooks/index.d.ts +82 -4
  23. package/dist/hooks/index.js +12 -7
  24. package/dist/index.cjs +127 -0
  25. package/dist/index.d.cts +14 -0
  26. package/dist/index.d.ts +4 -8
  27. package/dist/index.js +127 -58
  28. package/dist/types/index.cjs +2 -0
  29. package/dist/types/index.d.cts +241 -0
  30. package/dist/types/index.d.ts +212 -15
  31. package/dist/types/index.js +2 -1
  32. package/dist/utils/index.cjs +45 -0
  33. package/dist/utils/index.d.cts +366 -0
  34. package/dist/utils/index.d.ts +317 -10
  35. package/dist/utils/index.js +45 -22
  36. package/dist/wrappers/index.cjs +54 -0
  37. package/dist/wrappers/index.d.cts +1684 -0
  38. package/dist/wrappers/index.d.ts +1601 -118
  39. package/dist/wrappers/index.js +54 -8
  40. package/package.json +139 -92
  41. package/dist/AsyncSelectPayload-Cz4bgak0.d.mts +0 -10
  42. package/dist/AsyncSelectPayload-Cz4bgak0.d.ts +0 -10
  43. package/dist/OptionItem-oN6XnOTJ.d.mts +0 -14
  44. package/dist/OptionItem-oN6XnOTJ.d.ts +0 -14
  45. package/dist/chunk-2JFL7TS5.mjs +0 -0
  46. package/dist/chunk-5HOGPCEO.mjs +0 -1427
  47. package/dist/chunk-6BGQA4BQ.js +0 -1
  48. package/dist/chunk-6JZ35VQJ.js +0 -19
  49. package/dist/chunk-6NOXJGU2.js +0 -1427
  50. package/dist/chunk-7M2VOCYN.js +0 -1
  51. package/dist/chunk-BWQUYXUW.mjs +0 -1634
  52. package/dist/chunk-D3J7MWAU.js +0 -1634
  53. package/dist/chunk-EVPUCTZA.mjs +0 -0
  54. package/dist/chunk-FSU3H777.mjs +0 -473
  55. package/dist/chunk-GFSTK7KN.mjs +0 -19
  56. package/dist/chunk-I7EIUZKK.js +0 -332
  57. package/dist/chunk-JKUOV3MN.js +0 -473
  58. package/dist/chunk-RQS44YC7.mjs +0 -332
  59. package/dist/components/index.d.mts +0 -103
  60. package/dist/components/index.mjs +0 -24
  61. package/dist/hooks/index.d.mts +0 -17
  62. package/dist/hooks/index.mjs +0 -7
  63. package/dist/index.d.mts +0 -18
  64. package/dist/index.mjs +0 -58
  65. package/dist/types/index.d.mts +0 -44
  66. package/dist/types/index.mjs +0 -1
  67. package/dist/utils/index.d.mts +0 -59
  68. package/dist/utils/index.mjs +0 -22
  69. package/dist/wrappers/index.d.mts +0 -201
  70. package/dist/wrappers/index.mjs +0 -8
  71. package/dist/wrappers2/index.d.mts +0 -247
  72. package/dist/wrappers2/index.d.ts +0 -247
  73. package/dist/wrappers2/index.js +0 -8
  74. package/dist/wrappers2/index.mjs +0 -8
@@ -1,1427 +0,0 @@
1
- import {
2
- useTransform
3
- } from "./chunk-GFSTK7KN.mjs";
4
- import {
5
- readValueAsDate
6
- } from "./chunk-RQS44YC7.mjs";
7
-
8
- // src/wrappers2/DatePickerElement/DatePickerElement.tsx
9
- import {
10
- useController
11
- } from "react-hook-form";
12
- import { Grid2, useForkRef } from "@mui/material";
13
- import {
14
- DatePicker
15
- } from "@mui/x-date-pickers";
16
- import { useLocalizationContext } from "@mui/x-date-pickers/internals";
17
- import { jsx } from "react/jsx-runtime";
18
- var Component = function DatePickerElement(props) {
19
- const {
20
- parseError,
21
- name,
22
- required,
23
- rules = {},
24
- inputProps,
25
- control,
26
- textReadOnly,
27
- label,
28
- placeholder,
29
- gridProps,
30
- slotProps,
31
- transform,
32
- datePickerProps = {},
33
- ...rest
34
- } = props;
35
- const adapter = useLocalizationContext();
36
- const { disabled, inputRef, onClose, ...restDatePickerProps } = datePickerProps;
37
- const {
38
- field,
39
- fieldState: { error }
40
- } = useController({
41
- name,
42
- control,
43
- defaultValue: null
44
- });
45
- const { value, onChange } = useTransform({
46
- value: field.value,
47
- onChange: field.onChange,
48
- transform: {
49
- input: typeof transform?.input === "function" ? transform.input : (newValue) => readValueAsDate(adapter, newValue),
50
- output: typeof transform?.output === "function" ? transform.output : (newValue) => newValue
51
- }
52
- });
53
- const handleInputRef = useForkRef(field.ref, inputRef);
54
- return /* @__PURE__ */ jsx(
55
- DatePicker,
56
- {
57
- ...rest,
58
- ...restDatePickerProps,
59
- ...field,
60
- value,
61
- label,
62
- disabled,
63
- ...datePickerProps,
64
- inputRef: handleInputRef,
65
- onClose: (...args) => {
66
- field.onBlur();
67
- if (onClose) {
68
- onClose(...args);
69
- }
70
- },
71
- onChange: (newValue, context) => {
72
- onChange(newValue, context);
73
- if (typeof datePickerProps.onChange === "function") {
74
- datePickerProps.onChange(newValue, context);
75
- }
76
- },
77
- sx: {
78
- "& .MuiInputBase-input": {
79
- cursor: disabled ? "not-allowed" : "default"
80
- }
81
- },
82
- slotProps: {
83
- ...slotProps,
84
- textField: {
85
- ...inputProps,
86
- required,
87
- placeholder,
88
- fullWidth: true,
89
- onBlur: (event) => {
90
- field.onBlur();
91
- if (typeof inputProps?.onBlur === "function") {
92
- inputProps.onBlur(event);
93
- }
94
- },
95
- error: !!error,
96
- helperText: error ? error.message : inputProps?.helperText || rest.helperText,
97
- inputProps: {
98
- readOnly: !!textReadOnly,
99
- ...inputProps?.inputProps
100
- }
101
- }
102
- }
103
- }
104
- );
105
- };
106
- var DatePickerElement2 = ({
107
- gridProps,
108
- ...props
109
- }) => {
110
- if (gridProps) {
111
- return /* @__PURE__ */ jsx(Grid2, { ...gridProps, children: /* @__PURE__ */ jsx(Component, { ...props }) });
112
- }
113
- return /* @__PURE__ */ jsx(Component, { ...props });
114
- };
115
- DatePickerElement2.displayName = "DatePickerElement";
116
- var DatePickerElement_default = DatePickerElement2;
117
-
118
- // src/wrappers2/PasswordElement/PasswordElement.tsx
119
- import { useState } from "react";
120
- import {
121
- IconButton,
122
- InputAdornment,
123
- TextField,
124
- useForkRef as useForkRef2,
125
- Grid2 as Grid22
126
- } from "@mui/material";
127
- import Visibility from "@mui/icons-material/Visibility";
128
- import VisibilityOff from "@mui/icons-material/VisibilityOff";
129
- import {
130
- useController as useController2
131
- } from "react-hook-form";
132
- import { jsx as jsx2 } from "react/jsx-runtime";
133
- var Component2 = function PasswordEl(props) {
134
- const {
135
- type,
136
- required,
137
- iconColor,
138
- renderIcon = (password2) => password2 ? /* @__PURE__ */ jsx2(Visibility, {}) : /* @__PURE__ */ jsx2(VisibilityOff, {}),
139
- slotProps,
140
- name,
141
- control,
142
- component: TextFieldComponent = TextField,
143
- inputRef,
144
- onBlur,
145
- ...rest
146
- } = props;
147
- const [password, setPassword] = useState(true);
148
- const endAdornment = /* @__PURE__ */ jsx2(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx2(
149
- IconButton,
150
- {
151
- onMouseDown: (e) => e.preventDefault(),
152
- onClick: () => setPassword(!password),
153
- tabIndex: -1,
154
- color: iconColor ?? "default",
155
- children: renderIcon(password)
156
- }
157
- ) });
158
- const {
159
- field,
160
- fieldState: { error }
161
- } = useController2({
162
- name,
163
- control
164
- });
165
- const handleInputRef = useForkRef2(field.ref, inputRef);
166
- return /* @__PURE__ */ jsx2(
167
- TextField,
168
- {
169
- ...rest,
170
- inputRef: handleInputRef,
171
- type: password ? "password" : "text",
172
- value: field.value,
173
- fullWidth: true,
174
- onChange: (event) => {
175
- field.onChange(event);
176
- if (typeof rest.onChange === "function") {
177
- rest.onChange(event);
178
- }
179
- },
180
- onBlur: (event) => {
181
- field.onBlur();
182
- if (typeof onBlur === "function") {
183
- onBlur(event);
184
- }
185
- },
186
- ...typeof slotProps === "undefined" ? {
187
- InputProps: {
188
- endAdornment
189
- }
190
- } : {
191
- slotProps: {
192
- ...slotProps,
193
- input: {
194
- endAdornment,
195
- ...slotProps?.input
196
- }
197
- }
198
- },
199
- error: !!error,
200
- helperText: error ? error.message : ""
201
- }
202
- );
203
- };
204
- var PasswordElement = ({
205
- gridProps,
206
- ...props
207
- }) => {
208
- if (gridProps) {
209
- return /* @__PURE__ */ jsx2(Grid22, { ...gridProps, children: /* @__PURE__ */ jsx2(Component2, { ...props }) });
210
- }
211
- return /* @__PURE__ */ jsx2(Component2, { ...props });
212
- };
213
- PasswordElement.displayName = "PasswordElement";
214
- var PasswordElement_default = PasswordElement;
215
-
216
- // src/wrappers2/RadioButtonGroup/RadioButtonGroup.tsx
217
- import {
218
- useController as useController3
219
- } from "react-hook-form";
220
- import {
221
- FormControl,
222
- FormControlLabel,
223
- FormHelperText,
224
- FormLabel,
225
- Radio,
226
- RadioGroup,
227
- useTheme,
228
- Grid2 as Grid23
229
- } from "@mui/material";
230
- import { jsx as jsx3, jsxs } from "react/jsx-runtime";
231
- import { createElement } from "react";
232
- var Component3 = function RadioButtonGroup(props) {
233
- const {
234
- helperText,
235
- options,
236
- label,
237
- name,
238
- parseError,
239
- labelKey = "label",
240
- valueKey = "id",
241
- disabledKey = "disabled",
242
- required,
243
- emptyOptionLabel,
244
- returnObject,
245
- row,
246
- control,
247
- type,
248
- labelProps,
249
- disabled,
250
- formLabelProps,
251
- radioProps,
252
- transform,
253
- rules = {},
254
- ...rest
255
- } = props;
256
- const theme = useTheme();
257
- const {
258
- field,
259
- fieldState: { error }
260
- } = useController3({
261
- name,
262
- disabled,
263
- control
264
- });
265
- const { value, onChange } = useTransform({
266
- value: field.value,
267
- onChange: field.onChange,
268
- transform: {
269
- input: typeof transform?.input === "function" ? transform.input : (value2) => {
270
- return value2 || "";
271
- },
272
- output: typeof transform?.output === "function" ? transform?.output : (_event, value2) => {
273
- if (value2 && type === "number") {
274
- return Number(value2);
275
- }
276
- return value2;
277
- }
278
- }
279
- });
280
- const onRadioChange = (event, radioValue) => {
281
- const returnValue = returnObject ? options.find((items) => items[valueKey] === radioValue) : radioValue;
282
- onChange(event, returnValue);
283
- if (typeof rest.onChange === "function") {
284
- rest.onChange(returnValue);
285
- }
286
- };
287
- return /* @__PURE__ */ jsxs(FormControl, { error: !!error, children: [
288
- label && /* @__PURE__ */ jsx3(FormLabel, { ...formLabelProps, required, error: !!error, children: label }),
289
- /* @__PURE__ */ jsxs(RadioGroup, { onChange: onRadioChange, name, row, value, children: [
290
- emptyOptionLabel && /* @__PURE__ */ jsx3(
291
- FormControlLabel,
292
- {
293
- ...labelProps,
294
- control: /* @__PURE__ */ jsx3(
295
- Radio,
296
- {
297
- ...radioProps,
298
- sx: {
299
- color: error ? theme.palette.error.main : void 0
300
- },
301
- checked: !value
302
- }
303
- ),
304
- label: emptyOptionLabel,
305
- value: ""
306
- }
307
- ),
308
- options.map((option) => {
309
- const optionKey = option[valueKey];
310
- const optionDisabled = option[disabledKey] || false;
311
- if (optionKey === void 0) {
312
- console.error(
313
- `RadioButtonGroup: valueKey ${valueKey} does not exist on option`,
314
- option
315
- );
316
- }
317
- let val = returnObject ? value?.[valueKey] : value;
318
- if (type === "number") {
319
- val = Number(val);
320
- }
321
- const isChecked = val === optionKey;
322
- return /* @__PURE__ */ createElement(
323
- FormControlLabel,
324
- {
325
- ...labelProps,
326
- control: /* @__PURE__ */ jsx3(
327
- Radio,
328
- {
329
- ...radioProps,
330
- sx: {
331
- color: error ? theme.palette.error.main : void 0
332
- },
333
- disabled: disabled || optionDisabled,
334
- checked: isChecked
335
- }
336
- ),
337
- value: optionKey,
338
- label: option[labelKey],
339
- key: optionKey
340
- }
341
- );
342
- })
343
- ] }),
344
- error && /* @__PURE__ */ jsx3(FormHelperText, { children: error.message })
345
- ] });
346
- };
347
- var RadioButtonGroup2 = ({
348
- gridProps,
349
- ...props
350
- }) => {
351
- if (gridProps) {
352
- return /* @__PURE__ */ jsx3(Grid23, { ...gridProps, children: /* @__PURE__ */ jsx3(Component3, { ...props }) });
353
- }
354
- return /* @__PURE__ */ jsx3(Component3, { ...props });
355
- };
356
- RadioButtonGroup2.displayName = "RadioButtonGroup";
357
- var RadioButtonGroup_default = RadioButtonGroup2;
358
-
359
- // src/wrappers2/TextFieldElement/TextFieldElement.tsx
360
- import {
361
- Grid2 as Grid24,
362
- TextField as TextField2,
363
- useForkRef as useForkRef3
364
- } from "@mui/material";
365
- import {
366
- useController as useController4
367
- } from "react-hook-form";
368
- import { jsx as jsx4 } from "react/jsx-runtime";
369
- var Component4 = function TextFieldElement(props) {
370
- const {
371
- rules = {},
372
- parseError,
373
- name,
374
- control,
375
- component: TextFieldComponent = TextField2,
376
- gridProps,
377
- transform,
378
- label,
379
- placeholder,
380
- textFieldProps = {},
381
- ...rest
382
- } = props;
383
- const {
384
- type,
385
- required,
386
- helperText,
387
- inputRef,
388
- onBlur,
389
- disabled,
390
- ...restTextProps
391
- } = textFieldProps;
392
- const {
393
- field,
394
- fieldState: { error }
395
- } = useController4({
396
- name,
397
- control
398
- });
399
- const { value, onChange } = useTransform({
400
- value: field.value,
401
- onChange: field.onChange,
402
- transform: {
403
- input: typeof transform?.input === "function" ? transform.input : (value2) => {
404
- return value2 ?? "";
405
- },
406
- output: typeof transform?.output === "function" ? transform.output : (event) => {
407
- const value2 = event.target.value;
408
- if (type !== "number") {
409
- return value2;
410
- }
411
- if (value2 === "") {
412
- return null;
413
- }
414
- if (value2 == null) {
415
- return value2;
416
- }
417
- return Number(value2);
418
- }
419
- }
420
- });
421
- const handleInputRef = useForkRef3(field.ref, inputRef);
422
- return /* @__PURE__ */ jsx4(
423
- TextFieldComponent,
424
- {
425
- ...rest,
426
- ...restTextProps,
427
- name: field.name,
428
- value,
429
- onChange: (event) => {
430
- field.onChange(event);
431
- if (typeof onChange === "function") {
432
- onChange(event);
433
- }
434
- },
435
- onBlur: (event) => {
436
- field.onBlur();
437
- if (typeof onBlur === "function") {
438
- onBlur(event);
439
- }
440
- },
441
- disabled,
442
- label,
443
- placeholder,
444
- fullWidth: true,
445
- required,
446
- type,
447
- error: !!error,
448
- helperText: error ? error.message : helperText,
449
- inputRef: handleInputRef,
450
- size: "small",
451
- sx: {
452
- "& .MuiInputBase-input": {
453
- cursor: disabled ? "not-allowed" : "default"
454
- }
455
- }
456
- }
457
- );
458
- };
459
- var TextFieldElement2 = ({
460
- gridProps,
461
- ...props
462
- }) => {
463
- if (gridProps) {
464
- return /* @__PURE__ */ jsx4(Grid24, { ...gridProps, children: /* @__PURE__ */ jsx4(Component4, { ...props }) });
465
- }
466
- return /* @__PURE__ */ jsx4(Component4, { ...props });
467
- };
468
- TextFieldElement2.displayName = "TextFieldElement";
469
- var TextFieldElement_default = TextFieldElement2;
470
-
471
- // src/wrappers2/TimePickerElement/TimePickerElement.tsx
472
- import {
473
- TimePicker
474
- } from "@mui/x-date-pickers";
475
- import {
476
- useController as useController5
477
- } from "react-hook-form";
478
- import { useForkRef as useForkRef4, Grid2 as Grid25 } from "@mui/material";
479
- import { useLocalizationContext as useLocalizationContext2 } from "@mui/x-date-pickers/internals";
480
- import { jsx as jsx5 } from "react/jsx-runtime";
481
- var Component5 = function TimePickerElement(props) {
482
- const {
483
- parseError,
484
- name,
485
- required,
486
- rules = {},
487
- inputProps,
488
- control,
489
- textReadOnly,
490
- slotProps,
491
- inputRef,
492
- transform,
493
- ...rest
494
- } = props;
495
- const adapter = useLocalizationContext2();
496
- const {
497
- field,
498
- fieldState: { error }
499
- } = useController5({
500
- name,
501
- control,
502
- disabled: rest.disabled,
503
- defaultValue: null
504
- });
505
- const { value, onChange } = useTransform({
506
- value: field.value,
507
- onChange: field.onChange,
508
- transform: {
509
- input: typeof transform?.input === "function" ? transform.input : (newValue) => readValueAsDate(adapter, newValue),
510
- output: typeof transform?.output === "function" ? transform.output : (newValue) => newValue
511
- }
512
- });
513
- const handleInputRef = useForkRef4(field.ref, inputRef);
514
- return /* @__PURE__ */ jsx5(
515
- TimePicker,
516
- {
517
- ...rest,
518
- ...field,
519
- value,
520
- inputRef: handleInputRef,
521
- onClose: (...args) => {
522
- field.onBlur();
523
- if (rest.onClose) {
524
- rest.onClose(...args);
525
- }
526
- },
527
- onChange: (value2, context) => {
528
- onChange(value2, context);
529
- if (typeof rest.onChange === "function") {
530
- rest.onChange(value2, context);
531
- }
532
- },
533
- slotProps: {
534
- ...slotProps,
535
- textField: {
536
- ...inputProps,
537
- required,
538
- fullWidth: true,
539
- error: !!error,
540
- helperText: error ? error.message : inputProps?.helperText || rest.helperText,
541
- inputProps: {
542
- readOnly: textReadOnly,
543
- ...inputProps?.inputProps
544
- }
545
- }
546
- }
547
- }
548
- );
549
- };
550
- var TimePickerElement2 = ({
551
- gridProps,
552
- ...props
553
- }) => {
554
- if (gridProps) {
555
- return /* @__PURE__ */ jsx5(Grid25, { ...gridProps, children: /* @__PURE__ */ jsx5(Component5, { ...props }) });
556
- }
557
- return /* @__PURE__ */ jsx5(Component5, { ...props });
558
- };
559
- TimePickerElement2.displayName = "TimePickerElement";
560
- var TimePickerElement_default = TimePickerElement2;
561
-
562
- // src/wrappers2/AsyncSelect/AsyncSelect.tsx
563
- import * as React from "react";
564
- import TextField3 from "@mui/material/TextField";
565
- import Autocomplete from "@mui/material/Autocomplete";
566
- import { debounce } from "@mui/material/utils";
567
- import {
568
- Fragment,
569
- useCallback,
570
- useEffect as useEffect2,
571
- useMemo,
572
- useRef,
573
- useState as useState2
574
- } from "react";
575
- import { useController as useController6 } from "react-hook-form";
576
- import { CircularProgress, Grid2 as Grid26 } from "@mui/material";
577
- import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
578
- var Component6 = function AsyncSelectElement(props) {
579
- const {
580
- name,
581
- onBlur,
582
- disabled,
583
- control,
584
- gridProps,
585
- placeholder,
586
- initialValue,
587
- label,
588
- queryFn,
589
- ...rest
590
- } = props;
591
- const {
592
- field,
593
- fieldState: { error }
594
- } = useController6({
595
- name,
596
- control
597
- });
598
- const [loading, setLoading] = useState2(false);
599
- const [selectedOption, setSelectedOption] = useState2(null);
600
- const [inputValue, setInputValue] = useState2("");
601
- const inputValue2 = useMemo(() => inputValue, [inputValue]);
602
- const setInputValue2 = useCallback(
603
- (inputValue3) => setInputValue(inputValue3),
604
- []
605
- );
606
- const [options, setOptions] = useState2([]);
607
- const initialValueLoaded = useRef(
608
- !initialValue ? true : !(initialValue != null && initialValue > 0)
609
- );
610
- const fieldValue = useRef(field.value);
611
- const fetchData = useMemo(
612
- () => debounce(
613
- (payload, callback) => {
614
- queryFn(payload).then((c) => callback(c));
615
- },
616
- 400
617
- ),
618
- []
619
- );
620
- const fillOptions = (results) => {
621
- let newOptions = [];
622
- if (selectedOption) {
623
- newOptions = [selectedOption];
624
- }
625
- if (results) {
626
- newOptions = [...newOptions, ...results];
627
- }
628
- setOptions(newOptions);
629
- setLoading(false);
630
- };
631
- useEffect2(() => {
632
- if (initialValueLoaded.current) return void 0;
633
- let active = true;
634
- const payload = {
635
- query: null,
636
- initialValue
637
- };
638
- setLoading(true);
639
- fetchData(payload, (results) => {
640
- if (active) {
641
- if (!!results && results.length > 0) {
642
- fillOptions(results?.filter((c) => c.value == initialValue));
643
- setSelectedOption(results[0]);
644
- field.onChange(results[0].value);
645
- fieldValue.current = results[0].value;
646
- }
647
- initialValueLoaded.current = true;
648
- setLoading(false);
649
- }
650
- });
651
- return () => {
652
- active = false;
653
- };
654
- }, [initialValue]);
655
- React.useEffect(() => {
656
- let active = true;
657
- if (inputValue2 === "" || initialValueLoaded.current === false) {
658
- setOptions(selectedOption ? [selectedOption] : []);
659
- return void 0;
660
- }
661
- if (!!fieldValue.current) {
662
- if (field.value === fieldValue.current) {
663
- return void 0;
664
- }
665
- }
666
- setLoading(true);
667
- const payload = {
668
- query: inputValue2,
669
- initialValue: null
670
- };
671
- fetchData(payload, (results) => {
672
- if (active) {
673
- fillOptions(results);
674
- }
675
- });
676
- return () => {
677
- active = false;
678
- };
679
- }, [initialValue, inputValue2, fetchData]);
680
- const selectRef = useRef(null);
681
- const handleChange = (_2, selectedOption2, reason) => {
682
- if (reason === "clear") {
683
- setSelectedOption(null);
684
- field.onChange(null);
685
- } else if (reason === "selectOption" || reason === "removeOption") {
686
- if (selectedOption2) {
687
- setSelectedOption(selectedOption2);
688
- field.onChange(selectedOption2.value);
689
- fieldValue.current = selectedOption2.value;
690
- }
691
- }
692
- setOptions([]);
693
- };
694
- return /* @__PURE__ */ jsx6(
695
- Autocomplete,
696
- {
697
- ...rest,
698
- ref: selectRef,
699
- fullWidth: true,
700
- loading,
701
- getOptionLabel: (option) => option.label,
702
- getOptionKey: (option) => option.value,
703
- isOptionEqualToValue: (option, val) => option.value === val.value,
704
- autoComplete: true,
705
- includeInputInList: true,
706
- disabled,
707
- options,
708
- value: selectedOption,
709
- filterSelectedOptions: true,
710
- onChange: handleChange,
711
- onInputChange: (_2, newInputValue) => {
712
- setInputValue2(newInputValue);
713
- },
714
- renderInput: (params) => /* @__PURE__ */ jsx6(
715
- TextField3,
716
- {
717
- ...params,
718
- label,
719
- error: !!error,
720
- helperText: error ? error.message : "",
721
- placeholder,
722
- slotProps: {
723
- input: {
724
- ...params.InputProps,
725
- endAdornment: /* @__PURE__ */ jsxs2(Fragment, { children: [
726
- loading ? /* @__PURE__ */ jsx6(CircularProgress, { color: "inherit", size: 20 }) : null,
727
- params.InputProps.endAdornment
728
- ] })
729
- }
730
- },
731
- sx: {
732
- "& .MuiInputBase-input": {
733
- cursor: disabled ? "not-allowed" : "default"
734
- }
735
- }
736
- }
737
- ),
738
- renderOption: (props2, option) => {
739
- const { key, ...optionProps } = props2;
740
- return /* @__PURE__ */ jsx6("li", { ...optionProps, children: option.label }, key);
741
- }
742
- }
743
- );
744
- };
745
- var AsyncSelectElement2 = ({
746
- gridProps,
747
- ...props
748
- }) => {
749
- if (gridProps) {
750
- return /* @__PURE__ */ jsx6(Grid26, { ...gridProps, children: /* @__PURE__ */ jsx6(Component6, { ...props }) });
751
- }
752
- return /* @__PURE__ */ jsx6(Component6, { ...props });
753
- };
754
- AsyncSelectElement2.displayName = "AsyncSelectElement";
755
- var AsyncSelect_default = AsyncSelectElement2;
756
-
757
- // src/wrappers2/AsyncMultiSelect/AsyncMultiSelect.tsx
758
- import _ from "lodash";
759
- import {
760
- useState as useState3,
761
- useRef as useRef2,
762
- useMemo as useMemo2,
763
- useEffect as useEffect3,
764
- useCallback as useCallback2,
765
- Fragment as Fragment2
766
- } from "react";
767
- import { debounce as debounce2 } from "lodash";
768
- import {
769
- Autocomplete as Autocomplete2,
770
- CircularProgress as CircularProgress2,
771
- Grid2 as Grid27,
772
- TextField as TextField4
773
- } from "@mui/material";
774
- import { useController as useController7 } from "react-hook-form";
775
- import match from "autosuggest-highlight/match";
776
- import parse from "autosuggest-highlight/parse";
777
- import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
778
- var Component7 = function AsyncSelectMultiElement(props) {
779
- const {
780
- name,
781
- onBlur,
782
- disabled,
783
- control,
784
- gridProps,
785
- placeholder,
786
- initialValues,
787
- label,
788
- queryFn,
789
- ...rest
790
- } = props;
791
- const {
792
- field,
793
- fieldState: { error }
794
- } = useController7({
795
- name,
796
- control
797
- });
798
- const multiSelectRef = useRef2(null);
799
- const [selectedOptions, setSelectedOptions] = useState3([]);
800
- const [inputValue, setInputValue] = useState3("");
801
- const [options, setOptions] = useState3([]);
802
- const [loading, setLoading] = useState3(false);
803
- const initialValuesLoaded = useRef2(
804
- !(initialValues && initialValues.length > 0)
805
- );
806
- const inputValue2 = useMemo2(() => inputValue, [inputValue]);
807
- const setInputValue2 = useCallback2(
808
- (inputValue3) => setInputValue(inputValue3),
809
- []
810
- );
811
- const fetchData = useMemo2(
812
- () => debounce2(
813
- (payload, callback) => {
814
- queryFn(payload).then((c) => callback(c));
815
- },
816
- 400
817
- ),
818
- []
819
- );
820
- const fillOptions = (results) => {
821
- let newOptions = [];
822
- if (selectedOptions) {
823
- newOptions = [...selectedOptions];
824
- }
825
- if (results) {
826
- const newlyAdded = _.differenceBy(
827
- results,
828
- selectedOptions,
829
- (c) => c.value
830
- );
831
- newOptions = [...newOptions, ...newlyAdded];
832
- }
833
- setOptions(newOptions);
834
- setLoading(false);
835
- };
836
- useEffect3(() => {
837
- if (initialValuesLoaded.current) return void 0;
838
- let active = true;
839
- const payload = {
840
- query: null,
841
- initialValues
842
- };
843
- setLoading(true);
844
- fetchData(payload, (results) => {
845
- if (active) {
846
- setSelectedOptions([...results]);
847
- field.onChange([...results.map((c) => c.value)]);
848
- initialValuesLoaded.current = true;
849
- setLoading(false);
850
- }
851
- });
852
- return () => {
853
- active = false;
854
- };
855
- }, [initialValues]);
856
- useEffect3(() => {
857
- let active = true;
858
- if (inputValue2 === "" || initialValuesLoaded.current === false) {
859
- setOptions(selectedOptions ? [...selectedOptions] : []);
860
- return void 0;
861
- }
862
- setLoading(true);
863
- const payload = {
864
- query: inputValue2,
865
- initialValues: null
866
- };
867
- fetchData(payload, (results) => {
868
- if (active) {
869
- fillOptions(results);
870
- }
871
- });
872
- return () => {
873
- active = false;
874
- };
875
- }, [initialValues, inputValue2, fetchData]);
876
- const handleChange = (_2, selectedOptions2, reason) => {
877
- if (reason === "clear") {
878
- setSelectedOptions([]);
879
- field.onChange([]);
880
- } else if (reason === "selectOption" || reason === "removeOption") {
881
- setSelectedOptions(selectedOptions2);
882
- field.onChange(selectedOptions2.map((c) => c.value));
883
- }
884
- setOptions([]);
885
- };
886
- return /* @__PURE__ */ jsx7(
887
- Autocomplete2,
888
- {
889
- ref: multiSelectRef,
890
- multiple: true,
891
- loading,
892
- getOptionLabel: (option) => option.Label,
893
- getOptionKey: (option) => option.value,
894
- isOptionEqualToValue: (option, val) => option.value === val.value,
895
- options,
896
- value: selectedOptions,
897
- filterSelectedOptions: true,
898
- disabled,
899
- onChange: handleChange,
900
- onInputChange: (_2, newInputValue) => {
901
- setInputValue2(newInputValue);
902
- },
903
- renderInput: (params) => /* @__PURE__ */ jsx7(
904
- TextField4,
905
- {
906
- ...params,
907
- label,
908
- error: !!error,
909
- helperText: error ? error.message : "",
910
- placeholder,
911
- slotProps: {
912
- input: {
913
- ...params.InputProps,
914
- endAdornment: /* @__PURE__ */ jsxs3(Fragment2, { children: [
915
- loading ? /* @__PURE__ */ jsx7(CircularProgress2, { color: "inherit", size: 20 }) : null,
916
- params.InputProps.endAdornment
917
- ] })
918
- }
919
- },
920
- sx: {
921
- "& .MuiInputBase-input": {
922
- cursor: disabled ? "not-allowed" : "default"
923
- }
924
- }
925
- }
926
- ),
927
- renderOption: (props2, option, { inputValue: inputValue3 }) => {
928
- const { key, ...optionProps } = props2;
929
- const matches = match(option.Label, inputValue3, { insideWords: true });
930
- const parts = parse(option.Label, matches);
931
- return /* @__PURE__ */ jsx7("li", { ...optionProps, children: /* @__PURE__ */ jsx7("div", { children: parts.map((part, index) => /* @__PURE__ */ jsx7(
932
- "span",
933
- {
934
- style: {
935
- fontWeight: part.highlight ? 700 : 400
936
- },
937
- children: part.text
938
- },
939
- index
940
- )) }) }, key);
941
- },
942
- ...rest
943
- }
944
- );
945
- };
946
- var AsyncSelectMultiElement2 = ({
947
- gridProps,
948
- ...props
949
- }) => {
950
- if (gridProps) {
951
- return /* @__PURE__ */ jsx7(Grid27, { ...gridProps, children: /* @__PURE__ */ jsx7(Component7, { ...props }) });
952
- }
953
- return /* @__PURE__ */ jsx7(Component7, { ...props });
954
- };
955
- AsyncSelectMultiElement2.displayName = "AsyncSelectMulti";
956
- var AsyncMultiSelect_default = AsyncSelectMultiElement2;
957
-
958
- // src/wrappers2/SelectElement/SelectElement.tsx
959
- import {
960
- Autocomplete as Autocomplete3,
961
- Grid2 as Grid28,
962
- TextField as TextField5
963
- } from "@mui/material";
964
- import {
965
- useController as useController8
966
- } from "react-hook-form";
967
- import { useEffect as useEffect4, useState as useState4 } from "react";
968
- import { jsx as jsx8 } from "react/jsx-runtime";
969
- var Component8 = function SelectElement(props) {
970
- const {
971
- name,
972
- onBlur,
973
- onChange,
974
- disabled,
975
- options,
976
- control,
977
- gridProps,
978
- loading = false,
979
- placeholder,
980
- label,
981
- ...rest
982
- } = props;
983
- const {
984
- field,
985
- fieldState: { error }
986
- } = useController8({
987
- name,
988
- control
989
- });
990
- const [hasAutoSelected, setHasAutoSelected] = useState4(false);
991
- useEffect4(() => {
992
- if (options.length === 1 && field.value == null && !hasAutoSelected) {
993
- field.onChange(options[0].value);
994
- setHasAutoSelected(true);
995
- }
996
- }, [options, field.value, field.onChange, hasAutoSelected]);
997
- return /* @__PURE__ */ jsx8(
998
- Autocomplete3,
999
- {
1000
- ...rest,
1001
- value: field.value !== null ? options.find((option) => {
1002
- return field.value === option.value;
1003
- }) ?? null : null,
1004
- size: "small",
1005
- loading,
1006
- options,
1007
- getOptionLabel: (c) => c.label,
1008
- isOptionEqualToValue: (option, value) => option.value === value.value,
1009
- ref: field.ref,
1010
- disabled: field.disabled,
1011
- onChange: (event, newValue, reason) => {
1012
- if (reason === "clear") {
1013
- field.onChange(null);
1014
- setHasAutoSelected(true);
1015
- } else {
1016
- field.onChange(newValue?.value ?? null);
1017
- setHasAutoSelected(true);
1018
- }
1019
- onChange?.(event, newValue, reason);
1020
- },
1021
- onBlur: (event) => {
1022
- field.onBlur();
1023
- if (typeof onBlur === "function") {
1024
- onBlur(event);
1025
- }
1026
- },
1027
- fullWidth: true,
1028
- renderInput: (params) => /* @__PURE__ */ jsx8(
1029
- TextField5,
1030
- {
1031
- ...params,
1032
- fullWidth: true,
1033
- error: !!error,
1034
- helperText: error ? error.message : "",
1035
- placeholder,
1036
- label,
1037
- variant: "outlined",
1038
- sx: {
1039
- "& .MuiInputBase-input": {
1040
- cursor: disabled ? "not-allowed" : "default"
1041
- }
1042
- }
1043
- }
1044
- )
1045
- }
1046
- );
1047
- };
1048
- var SelectElement2 = ({
1049
- gridProps,
1050
- ...props
1051
- }) => {
1052
- if (gridProps) {
1053
- return /* @__PURE__ */ jsx8(Grid28, { ...gridProps, children: /* @__PURE__ */ jsx8(Component8, { ...props }) });
1054
- }
1055
- return /* @__PURE__ */ jsx8(Component8, { ...props });
1056
- };
1057
- SelectElement2.displayName = "SelectElement";
1058
- var SelectElement_default = SelectElement2;
1059
-
1060
- // src/wrappers2/SelectMultiElement/SelectMultiElement.tsx
1061
- import {
1062
- Autocomplete as Autocomplete4,
1063
- CircularProgress as CircularProgress3,
1064
- Grid2 as Grid29,
1065
- TextField as TextField6
1066
- } from "@mui/material";
1067
- import {
1068
- useController as useController9
1069
- } from "react-hook-form";
1070
- import { Fragment as Fragment3, useState as useState5 } from "react";
1071
- import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
1072
- var Component9 = function SelectMultiElement(props) {
1073
- const {
1074
- name,
1075
- onBlur,
1076
- disabled,
1077
- options,
1078
- control,
1079
- loading = false,
1080
- placeholder,
1081
- label,
1082
- ...rest
1083
- } = props;
1084
- const {
1085
- field,
1086
- fieldState: { error }
1087
- } = useController9({
1088
- name,
1089
- control
1090
- });
1091
- const [selectedOptions, setSelectedOptions] = useState5([]);
1092
- const handleChange = (_2, selectedOptions2, reason) => {
1093
- if (reason === "clear") {
1094
- setSelectedOptions([]);
1095
- field.onChange([]);
1096
- } else if (reason === "selectOption" || reason === "removeOption") {
1097
- setSelectedOptions(selectedOptions2);
1098
- field.onChange(selectedOptions2.map((c) => c.value));
1099
- }
1100
- };
1101
- return /* @__PURE__ */ jsx9(
1102
- Autocomplete4,
1103
- {
1104
- multiple: true,
1105
- value: selectedOptions,
1106
- loading,
1107
- options,
1108
- getOptionLabel: (c) => c.Label,
1109
- filterSelectedOptions: true,
1110
- ref: field.ref,
1111
- disabled,
1112
- onChange: handleChange,
1113
- onBlur: (event) => {
1114
- field.onBlur();
1115
- if (typeof onBlur === "function") {
1116
- onBlur(event);
1117
- }
1118
- },
1119
- fullWidth: true,
1120
- renderInput: (params) => /* @__PURE__ */ jsx9(
1121
- TextField6,
1122
- {
1123
- ...params,
1124
- label,
1125
- error: !!error,
1126
- helperText: error ? error.message : "",
1127
- placeholder,
1128
- slotProps: {
1129
- input: {
1130
- ...params.InputProps,
1131
- endAdornment: /* @__PURE__ */ jsxs4(Fragment3, { children: [
1132
- loading ? /* @__PURE__ */ jsx9(CircularProgress3, { color: "inherit", size: 20 }) : null,
1133
- params.InputProps.endAdornment
1134
- ] })
1135
- }
1136
- }
1137
- }
1138
- ),
1139
- ...rest
1140
- }
1141
- );
1142
- };
1143
- var SelectMultiElement2 = ({
1144
- gridProps,
1145
- ...props
1146
- }) => {
1147
- if (gridProps) {
1148
- return /* @__PURE__ */ jsx9(Grid29, { ...gridProps, children: /* @__PURE__ */ jsx9(Component9, { ...props }) });
1149
- }
1150
- return /* @__PURE__ */ jsx9(Component9, { ...props });
1151
- };
1152
- SelectMultiElement2.displayName = "SelectMultiElement";
1153
- var SelectMultiElement_default = SelectMultiElement2;
1154
-
1155
- // src/wrappers2/SelectCascadeElement/SelectCascadeElement.tsx
1156
- import {
1157
- Autocomplete as Autocomplete5,
1158
- Grid2 as Grid210,
1159
- TextField as TextField7
1160
- } from "@mui/material";
1161
- import { useEffect as useEffect5, useRef as useRef3 } from "react";
1162
- import {
1163
- useController as useController10
1164
- } from "react-hook-form";
1165
- import { jsx as jsx10 } from "react/jsx-runtime";
1166
- var Component10 = function SelectCascadeElement(props) {
1167
- const {
1168
- name,
1169
- onBlur,
1170
- onChange,
1171
- disabled,
1172
- options,
1173
- control,
1174
- gridProps,
1175
- loading = false,
1176
- placeholder,
1177
- label,
1178
- dependsOn,
1179
- initialValue,
1180
- ...rest
1181
- } = props;
1182
- const {
1183
- field,
1184
- fieldState: { error }
1185
- } = useController10({
1186
- name,
1187
- control
1188
- });
1189
- const { field: dependentField } = useController10({
1190
- name: dependsOn,
1191
- control
1192
- });
1193
- const parentValueRef = useRef3(dependentField.value ?? null);
1194
- useEffect5(() => {
1195
- if (!!dependentField.value && parentValueRef?.current?.value !== dependentField.value || dependentField.value === null) {
1196
- field.onChange(null);
1197
- }
1198
- }, [dependentField.value]);
1199
- useEffect5(() => {
1200
- if (initialValue) {
1201
- field.onChange(initialValue);
1202
- }
1203
- }, [initialValue]);
1204
- return /* @__PURE__ */ jsx10(
1205
- Autocomplete5,
1206
- {
1207
- ...rest,
1208
- value: field.value !== null ? options.find((option) => {
1209
- return field.value === option.value;
1210
- }) ?? null : null,
1211
- size: "small",
1212
- loading,
1213
- options,
1214
- getOptionLabel: (c) => c.label,
1215
- isOptionEqualToValue: (option, value) => option.value === value.value,
1216
- ref: field.ref,
1217
- disabled,
1218
- onChange: (event, newValue, reason) => {
1219
- field.onChange(newValue ? newValue.value : null);
1220
- if (onChange && typeof onChange === "function") {
1221
- onChange(event, newValue, reason);
1222
- }
1223
- },
1224
- onBlur: (event) => {
1225
- field.onBlur();
1226
- if (typeof onBlur === "function") {
1227
- onBlur(event);
1228
- }
1229
- },
1230
- fullWidth: true,
1231
- renderInput: (params) => /* @__PURE__ */ jsx10(
1232
- TextField7,
1233
- {
1234
- ...params,
1235
- fullWidth: true,
1236
- error: !!error,
1237
- helperText: error ? error.message : "",
1238
- placeholder,
1239
- label,
1240
- variant: "outlined",
1241
- sx: {
1242
- "& .MuiInputBase-input": {
1243
- cursor: disabled ? "not-allowed" : "default"
1244
- }
1245
- }
1246
- }
1247
- )
1248
- }
1249
- );
1250
- };
1251
- var SelectCascadeElement2 = ({
1252
- gridProps,
1253
- ...props
1254
- }) => {
1255
- if (gridProps) {
1256
- return /* @__PURE__ */ jsx10(Grid210, { ...gridProps, children: /* @__PURE__ */ jsx10(Component10, { ...props }) });
1257
- }
1258
- return /* @__PURE__ */ jsx10(Component10, { ...props });
1259
- };
1260
- SelectCascadeElement2.displayName = "SelectCascadeElement";
1261
- var SelectCascadeElement_default = SelectCascadeElement2;
1262
-
1263
- // src/wrappers2/CheckboxElement/CheckboxElement.tsx
1264
- import {
1265
- Checkbox,
1266
- FormControl as FormControl2,
1267
- FormControlLabel as FormControlLabel2,
1268
- FormGroup,
1269
- FormHelperText as FormHelperText2,
1270
- Grid2 as Grid211
1271
- } from "@mui/material";
1272
- import {
1273
- useController as useController11
1274
- } from "react-hook-form";
1275
- import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
1276
- var Component11 = function CheckboxElement(props) {
1277
- const { name, control, label, labelProps, inputRef, ...rest } = props;
1278
- const {
1279
- field,
1280
- fieldState: { error }
1281
- } = useController11({
1282
- name,
1283
- control,
1284
- disabled: rest.disabled
1285
- });
1286
- return /* @__PURE__ */ jsxs5(FormControl2, { error: !!error, children: [
1287
- /* @__PURE__ */ jsx11(FormGroup, { row: true, children: /* @__PURE__ */ jsx11(
1288
- FormControlLabel2,
1289
- {
1290
- label: label || "",
1291
- ...labelProps,
1292
- control: /* @__PURE__ */ jsx11(
1293
- Checkbox,
1294
- {
1295
- ...rest,
1296
- color: rest.color || "primary",
1297
- sx: [
1298
- ...Array.isArray(rest.sx) ? rest.sx : [rest.sx],
1299
- {
1300
- color: error ? "error.main" : void 0
1301
- }
1302
- ],
1303
- value: field.value,
1304
- checked: !!field.value,
1305
- onChange: (event, newValue) => {
1306
- field.onChange(event, newValue);
1307
- if (typeof rest.onChange === "function") {
1308
- rest.onChange(event, newValue);
1309
- }
1310
- }
1311
- }
1312
- )
1313
- }
1314
- ) }),
1315
- error && /* @__PURE__ */ jsx11(FormHelperText2, { error: !!error, children: error.message })
1316
- ] });
1317
- };
1318
- var CheckboxElement2 = ({
1319
- gridProps,
1320
- ...props
1321
- }) => {
1322
- if (gridProps) {
1323
- return /* @__PURE__ */ jsx11(Grid211, { ...gridProps, children: /* @__PURE__ */ jsx11(Component11, { ...props }) });
1324
- }
1325
- return /* @__PURE__ */ jsx11(Component11, { ...props });
1326
- };
1327
- CheckboxElement2.displayName = "CheckboxElement";
1328
- var CheckboxElement_default = CheckboxElement2;
1329
-
1330
- // src/wrappers2/CheckboxGroup/CheckboxGroup.tsx
1331
- import {
1332
- Checkbox as Checkbox2,
1333
- FormControl as FormControl3,
1334
- FormControlLabel as FormControlLabel3,
1335
- FormGroup as FormGroup2,
1336
- FormHelperText as FormHelperText3,
1337
- Grid2 as Grid212
1338
- } from "@mui/material";
1339
- import { useEffect as useEffect6, useState as useState6 } from "react";
1340
- import {
1341
- useController as useController12
1342
- } from "react-hook-form";
1343
- import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
1344
- var Component12 = function CheckboxGroup(props) {
1345
- const { name, control, label, labelProps, inputRef, options, ...rest } = props;
1346
- const {
1347
- field,
1348
- fieldState: { error }
1349
- } = useController12({
1350
- name,
1351
- control,
1352
- disabled: rest.disabled
1353
- });
1354
- const [selectedValues, setSelectedValues] = useState6(
1355
- options.filter((c) => field.value?.includes(c.value)).map((c) => c.value) || []
1356
- );
1357
- useEffect6(() => {
1358
- field.onChange(selectedValues ? [...selectedValues] : []);
1359
- }, [selectedValues]);
1360
- const handleChange = (event) => {
1361
- const value = parseInt(event.target.value, 10);
1362
- if (event.target.checked) {
1363
- setSelectedValues([...selectedValues, value]);
1364
- } else {
1365
- setSelectedValues(selectedValues.filter((item) => item !== value));
1366
- }
1367
- };
1368
- return /* @__PURE__ */ jsxs6(FormControl3, { error: !!error, children: [
1369
- /* @__PURE__ */ jsx12(FormGroup2, { row: true, children: options.map((option) => /* @__PURE__ */ jsx12(
1370
- FormControlLabel3,
1371
- {
1372
- label: option.label,
1373
- ...labelProps,
1374
- control: /* @__PURE__ */ jsx12(
1375
- Checkbox2,
1376
- {
1377
- ...rest,
1378
- color: rest.color || "primary",
1379
- sx: [
1380
- ...Array.isArray(rest.sx) ? rest.sx : [rest.sx],
1381
- {
1382
- color: error ? "error.main" : void 0
1383
- }
1384
- ],
1385
- value: option.value,
1386
- checked: selectedValues.includes(option.value),
1387
- onChange: handleChange
1388
- }
1389
- )
1390
- },
1391
- `${option.value}`
1392
- )) }),
1393
- error && /* @__PURE__ */ jsx12(FormHelperText3, { error: !!error, children: error.message })
1394
- ] });
1395
- };
1396
- var CheckboxGroup2 = ({
1397
- gridProps,
1398
- ...props
1399
- }) => {
1400
- if (gridProps) {
1401
- return /* @__PURE__ */ jsx12(Grid212, { ...gridProps, children: /* @__PURE__ */ jsx12(Component12, { ...props }) });
1402
- }
1403
- return /* @__PURE__ */ jsx12(Component12, { ...props });
1404
- };
1405
- CheckboxGroup2.displayName = "CheckboxGroup";
1406
- var CheckboxGroup_default = CheckboxGroup2;
1407
-
1408
- // src/wrappers2/Field/index.ts
1409
- var Field2 = {
1410
- Text: TextFieldElement_default,
1411
- Checkbox: CheckboxElement_default,
1412
- Date: DatePickerElement_default,
1413
- RadioGroup: RadioButtonGroup_default,
1414
- Password: PasswordElement_default,
1415
- Time: TimePickerElement_default,
1416
- Select: SelectElement_default,
1417
- SelectMulti: SelectMultiElement_default,
1418
- SelectCascade: SelectCascadeElement_default,
1419
- AsyncSelect: AsyncSelect_default,
1420
- AsyncMultiSelect: AsyncMultiSelect_default,
1421
- CheckboxGroup: CheckboxGroup_default
1422
- };
1423
- var Field_default = Field2;
1424
-
1425
- export {
1426
- Field_default
1427
- };