@gnwebsoft/ui 2.18.24 → 2.18.26

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