dynamic-formik-form 1.0.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.
package/dist/index.js ADDED
@@ -0,0 +1,3666 @@
1
+ 'use strict';
2
+
3
+ var React7 = require('react');
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+
6
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
7
+
8
+ var React7__default = /*#__PURE__*/_interopDefault(React7);
9
+
10
+ // src/components/DynamicForm.tsx
11
+ var FormContext = React7.createContext(null);
12
+ var FormProvider = ({
13
+ children,
14
+ uiLibrary,
15
+ formik
16
+ }) => {
17
+ return /* @__PURE__ */ jsxRuntime.jsx(FormContext.Provider, { value: { uiLibrary, formik }, children });
18
+ };
19
+ var useFormContext = () => {
20
+ const context = React7.useContext(FormContext);
21
+ if (!context) {
22
+ throw new Error("useFormContext must be used within FormProvider");
23
+ }
24
+ return context;
25
+ };
26
+ var defaultAdapter = {
27
+ Input: ({ className, disabled, error, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
28
+ "input",
29
+ {
30
+ className: `${className || ""} ${error ? "error" : ""}`,
31
+ disabled,
32
+ ...props
33
+ }
34
+ ),
35
+ Textarea: ({ className, disabled, error, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
36
+ "textarea",
37
+ {
38
+ className: `${className || ""} ${error ? "error" : ""}`,
39
+ disabled,
40
+ ...props
41
+ }
42
+ ),
43
+ Select: ({ className, disabled, error, children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
44
+ "select",
45
+ {
46
+ className: `${className || ""} ${error ? "error" : ""}`,
47
+ disabled,
48
+ ...props,
49
+ children
50
+ }
51
+ ),
52
+ Checkbox: ({ className, disabled, label, ...props }) => /* @__PURE__ */ jsxRuntime.jsxs("label", { className, children: [
53
+ /* @__PURE__ */ jsxRuntime.jsx("input", { type: "checkbox", disabled, ...props }),
54
+ label
55
+ ] }),
56
+ Radio: ({ className, disabled, label, ...props }) => /* @__PURE__ */ jsxRuntime.jsxs("label", { className, children: [
57
+ /* @__PURE__ */ jsxRuntime.jsx("input", { type: "radio", disabled, ...props }),
58
+ label
59
+ ] }),
60
+ Switch: ({ className, disabled, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
61
+ "input",
62
+ {
63
+ type: "checkbox",
64
+ className: `switch ${className || ""}`,
65
+ disabled,
66
+ ...props
67
+ }
68
+ ),
69
+ Button: ({ className, disabled, children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("button", { className, disabled, ...props, children }),
70
+ FormControl: ({ className, children }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: `form-control ${className || ""}`, children }),
71
+ FormHelperText: ({ className, children }) => /* @__PURE__ */ jsxRuntime.jsx("small", { className: `form-helper-text ${className || ""}`, children }),
72
+ Label: ({ className, htmlFor, children }) => /* @__PURE__ */ jsxRuntime.jsx("label", { className, htmlFor, children }),
73
+ Box: ({ className, children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className, ...props, children }),
74
+ Paper: ({ className, children }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: `paper ${className || ""}`, children }),
75
+ Popover: ({ open, anchorEl, onClose, children, anchorOrigin }) => {
76
+ if (!open || !anchorEl) return null;
77
+ const rect = anchorEl.getBoundingClientRect();
78
+ const style = {
79
+ position: "fixed",
80
+ top: `${rect.bottom}px`,
81
+ left: `${rect.left}px`,
82
+ zIndex: 1e3
83
+ };
84
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "popover", style, onClick: onClose, children });
85
+ },
86
+ MenuItem: ({ className, onClick, children }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: `menu-item ${className || ""}`, onClick, children }),
87
+ Typography: ({ className, variant, children }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: `typography typography-${variant || "body1"} ${className || ""}`, children }),
88
+ IconButton: ({ className, size, onClick, children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
89
+ "button",
90
+ {
91
+ type: "button",
92
+ className: `icon-button icon-button-${size || "medium"} ${className || ""}`,
93
+ onClick,
94
+ ...props,
95
+ children
96
+ }
97
+ )
98
+ };
99
+ var createMUIAdapter = (Box, Button, Checkbox, FormControl, FormControlLabel, FormHelperText, IconButton, MenuItem, Paper, Popover, Radio, RadioGroup, Switch, TextField2, Typography, DatePicker, DateTimePicker) => {
100
+ return {
101
+ Input: ({ className, disabled, error, type, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
102
+ TextField2,
103
+ {
104
+ ...props,
105
+ type,
106
+ disabled,
107
+ error: !!error,
108
+ className,
109
+ fullWidth: true,
110
+ variant: "outlined"
111
+ }
112
+ ),
113
+ Textarea: ({ className, disabled, error, rows, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
114
+ TextField2,
115
+ {
116
+ ...props,
117
+ multiline: true,
118
+ rows: rows || 4,
119
+ disabled,
120
+ error: !!error,
121
+ className,
122
+ fullWidth: true,
123
+ variant: "outlined"
124
+ }
125
+ ),
126
+ Select: ({ className, disabled, error, children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
127
+ TextField2,
128
+ {
129
+ ...props,
130
+ select: true,
131
+ disabled,
132
+ error: !!error,
133
+ className,
134
+ fullWidth: true,
135
+ variant: "outlined",
136
+ children
137
+ }
138
+ ),
139
+ Checkbox: ({ className, disabled, label, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
140
+ FormControlLabel,
141
+ {
142
+ control: /* @__PURE__ */ jsxRuntime.jsx(
143
+ Checkbox,
144
+ {
145
+ ...props,
146
+ disabled,
147
+ className,
148
+ color: "primary"
149
+ }
150
+ ),
151
+ label
152
+ }
153
+ ),
154
+ Radio: ({ className, disabled, label, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
155
+ FormControlLabel,
156
+ {
157
+ control: /* @__PURE__ */ jsxRuntime.jsx(
158
+ Radio,
159
+ {
160
+ ...props,
161
+ disabled,
162
+ className,
163
+ color: "primary"
164
+ }
165
+ ),
166
+ label
167
+ }
168
+ ),
169
+ Switch: ({ className, disabled, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
170
+ Switch,
171
+ {
172
+ ...props,
173
+ disabled,
174
+ className,
175
+ color: "primary"
176
+ }
177
+ ),
178
+ Button: ({ className, disabled, children, variant, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
179
+ Button,
180
+ {
181
+ ...props,
182
+ disabled,
183
+ className,
184
+ variant: variant || "contained",
185
+ color: "primary",
186
+ children
187
+ }
188
+ ),
189
+ FormControl: ({ className, required, error, children }) => /* @__PURE__ */ jsxRuntime.jsx(
190
+ FormControl,
191
+ {
192
+ className,
193
+ required,
194
+ error: !!error,
195
+ fullWidth: true,
196
+ children
197
+ }
198
+ ),
199
+ FormHelperText: ({ className, children }) => /* @__PURE__ */ jsxRuntime.jsx(FormHelperText, { className, children }),
200
+ Label: ({ className, htmlFor, children }) => /* @__PURE__ */ jsxRuntime.jsx(
201
+ Typography,
202
+ {
203
+ component: "label",
204
+ htmlFor,
205
+ className,
206
+ variant: "body2",
207
+ fontWeight: "medium",
208
+ children
209
+ }
210
+ ),
211
+ Box: ({ className, sx, children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(Box, { className, sx, ...props, children }),
212
+ Paper: ({ className, elevation, children }) => /* @__PURE__ */ jsxRuntime.jsx(Paper, { className, elevation: elevation || 3, children }),
213
+ Popover: ({ open, anchorEl, onClose, anchorOrigin, children }) => /* @__PURE__ */ jsxRuntime.jsx(
214
+ Popover,
215
+ {
216
+ open,
217
+ anchorEl,
218
+ onClose,
219
+ anchorOrigin: anchorOrigin || { vertical: "bottom", horizontal: "left" },
220
+ children
221
+ }
222
+ ),
223
+ MenuItem: ({ className, onClick, children }) => /* @__PURE__ */ jsxRuntime.jsx(MenuItem, { className, onClick, children }),
224
+ Typography: ({ className, variant, color, children }) => /* @__PURE__ */ jsxRuntime.jsx(Typography, { className, variant, color, children }),
225
+ IconButton: ({ className, size, onClick, children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
226
+ IconButton,
227
+ {
228
+ className,
229
+ size,
230
+ onClick,
231
+ ...props,
232
+ children
233
+ }
234
+ ),
235
+ DatePicker: DatePicker ? ({ value, onChange, format, disabled, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
236
+ DatePicker,
237
+ {
238
+ value,
239
+ onChange,
240
+ format,
241
+ disabled,
242
+ ...props
243
+ }
244
+ ) : void 0,
245
+ DateTimePicker: DateTimePicker ? ({ value, onChange, format, disabled, views, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
246
+ DateTimePicker,
247
+ {
248
+ value,
249
+ onChange,
250
+ format,
251
+ disabled,
252
+ views,
253
+ ...props
254
+ }
255
+ ) : void 0,
256
+ TextField: TextField2 ? ({ inputRef, inputProps, label, id, error, helperText, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
257
+ TextField2,
258
+ {
259
+ inputRef,
260
+ inputProps,
261
+ label,
262
+ id,
263
+ error: !!error,
264
+ helperText,
265
+ ...props,
266
+ fullWidth: true,
267
+ variant: "outlined"
268
+ }
269
+ ) : void 0
270
+ };
271
+ };
272
+ var createBootstrapAdapter = (Form, FormControl, FormLabel, FormText, FormCheck, FormSelect, ButtonComponent, InputGroup, OverlayTrigger, Popover, ListGroup, ListGroupItem) => {
273
+ return {
274
+ Input: ({ className, disabled, error, type, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
275
+ FormControl,
276
+ {
277
+ ...props,
278
+ type,
279
+ disabled,
280
+ isInvalid: !!error,
281
+ className
282
+ }
283
+ ),
284
+ Textarea: ({ className, disabled, error, rows, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
285
+ FormControl,
286
+ {
287
+ ...props,
288
+ as: "textarea",
289
+ rows: rows || 4,
290
+ disabled,
291
+ isInvalid: !!error,
292
+ className
293
+ }
294
+ ),
295
+ Select: ({ className, disabled, error, children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
296
+ FormSelect,
297
+ {
298
+ ...props,
299
+ disabled,
300
+ isInvalid: !!error,
301
+ className,
302
+ children
303
+ }
304
+ ),
305
+ Checkbox: ({ className, disabled, label, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
306
+ FormCheck,
307
+ {
308
+ ...props,
309
+ type: "checkbox",
310
+ disabled,
311
+ className,
312
+ label
313
+ }
314
+ ),
315
+ Radio: ({ className, disabled, label, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
316
+ FormCheck,
317
+ {
318
+ ...props,
319
+ type: "radio",
320
+ disabled,
321
+ className,
322
+ label
323
+ }
324
+ ),
325
+ Switch: ({ className, disabled, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
326
+ FormCheck,
327
+ {
328
+ ...props,
329
+ type: "switch",
330
+ disabled,
331
+ className
332
+ }
333
+ ),
334
+ Button: ({ className, disabled, children, variant, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
335
+ ButtonComponent,
336
+ {
337
+ ...props,
338
+ disabled,
339
+ className,
340
+ variant: variant || "primary",
341
+ children
342
+ }
343
+ ),
344
+ FormControl: ({ className, required, error, children }) => /* @__PURE__ */ jsxRuntime.jsx(Form, { className, children }),
345
+ FormHelperText: ({ className, children }) => /* @__PURE__ */ jsxRuntime.jsx(FormText, { className, children }),
346
+ Label: ({ className, htmlFor, children }) => /* @__PURE__ */ jsxRuntime.jsx(FormLabel, { htmlFor, className, children }),
347
+ Box: ({ className, children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className, ...props, children }),
348
+ Paper: ({ className, children }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: `card ${className || ""}`, children }),
349
+ Popover: ({ open, anchorEl, onClose, children, anchorOrigin }) => {
350
+ if (!open || !anchorEl) return null;
351
+ const rect = anchorEl.getBoundingClientRect();
352
+ const style = {
353
+ position: "fixed",
354
+ top: `${rect.bottom}px`,
355
+ left: `${rect.left}px`,
356
+ zIndex: 1e3,
357
+ backgroundColor: "white",
358
+ border: "1px solid #ccc",
359
+ borderRadius: "4px",
360
+ padding: "8px",
361
+ boxShadow: "0 2px 8px rgba(0,0,0,0.15)"
362
+ };
363
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { style, onClick: onClose, children });
364
+ },
365
+ MenuItem: ({ className, onClick, children }) => /* @__PURE__ */ jsxRuntime.jsx(
366
+ ListGroupItem,
367
+ {
368
+ className,
369
+ onClick,
370
+ action: true,
371
+ children
372
+ }
373
+ ),
374
+ Typography: ({ className, variant, children }) => {
375
+ const Tag = variant === "h6" ? "h6" : variant === "subtitle2" ? "h6" : "p";
376
+ return /* @__PURE__ */ jsxRuntime.jsx(Tag, { className, children });
377
+ },
378
+ IconButton: ({ className, size, onClick, children }) => /* @__PURE__ */ jsxRuntime.jsx(
379
+ ButtonComponent,
380
+ {
381
+ variant: "link",
382
+ className: `${className || ""} p-0`,
383
+ onClick,
384
+ size,
385
+ children
386
+ }
387
+ )
388
+ };
389
+ };
390
+ var createAntDesignAdapter = (Input, Button, Checkbox, Radio, Switch, Select, Form, Typography, Popover, DatePicker, DateTimePicker, Space, Card) => {
391
+ const TextArea = Input.TextArea || Input;
392
+ const { TextArea: AntDTextArea } = Input;
393
+ const { Text: TypographyText } = Typography;
394
+ const { Group: RadioGroup } = Radio;
395
+ const SpaceComponent = Space || (({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, children }));
396
+ const CardComponent = Card || (({ children, className }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: `ant-card ${className || ""}`, children }));
397
+ return {
398
+ Input: ({ className, disabled, error, type, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
399
+ Input,
400
+ {
401
+ ...props,
402
+ type,
403
+ disabled,
404
+ status: error ? "error" : void 0,
405
+ className
406
+ }
407
+ ),
408
+ Textarea: ({ className, disabled, error, rows, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
409
+ TextArea,
410
+ {
411
+ ...props,
412
+ rows: rows || 4,
413
+ disabled,
414
+ status: error ? "error" : void 0,
415
+ className
416
+ }
417
+ ),
418
+ Select: ({ className, disabled, error, children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
419
+ Select,
420
+ {
421
+ ...props,
422
+ disabled,
423
+ status: error ? "error" : void 0,
424
+ className,
425
+ children
426
+ }
427
+ ),
428
+ Checkbox: ({ className, disabled, label, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
429
+ Checkbox,
430
+ {
431
+ ...props,
432
+ disabled,
433
+ className,
434
+ children: label
435
+ }
436
+ ),
437
+ Radio: ({ className, disabled, label, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
438
+ Radio,
439
+ {
440
+ ...props,
441
+ disabled,
442
+ className,
443
+ children: label
444
+ }
445
+ ),
446
+ Switch: ({ className, disabled, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
447
+ Switch,
448
+ {
449
+ ...props,
450
+ disabled,
451
+ className
452
+ }
453
+ ),
454
+ Button: ({ className, disabled, children, variant, type, onClick, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
455
+ Button,
456
+ {
457
+ ...props,
458
+ disabled,
459
+ type: variant === "primary" ? "primary" : variant === "secondary" ? "default" : variant || "default",
460
+ htmlType: type,
461
+ onClick,
462
+ className,
463
+ children
464
+ }
465
+ ),
466
+ FormControl: ({ className, children }) => {
467
+ const FormComponent = Form;
468
+ const FormItem = FormComponent.Item || FormComponent;
469
+ return /* @__PURE__ */ jsxRuntime.jsx(FormItem, { className, children });
470
+ },
471
+ FormHelperText: ({ className, children }) => /* @__PURE__ */ jsxRuntime.jsx(TypographyText, { type: "secondary", className, children }),
472
+ Label: ({ className, htmlFor, children }) => /* @__PURE__ */ jsxRuntime.jsx("label", { className, htmlFor, children }),
473
+ Box: ({ className, children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(SpaceComponent, { className, ...props, children }),
474
+ Paper: ({ className, children }) => /* @__PURE__ */ jsxRuntime.jsx(CardComponent, { className, children }),
475
+ Popover: ({ open, anchorEl, onClose, children, anchorOrigin, ...props }) => {
476
+ if (!open) return null;
477
+ return /* @__PURE__ */ jsxRuntime.jsx(
478
+ Popover,
479
+ {
480
+ open,
481
+ onOpenChange: (visible) => !visible && onClose(),
482
+ placement: anchorOrigin?.vertical === "bottom" ? "bottom" : "top",
483
+ ...props,
484
+ children
485
+ }
486
+ );
487
+ },
488
+ MenuItem: ({ className, onClick, children }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: `ant-menu-item ${className || ""}`, onClick, children }),
489
+ Typography: ({ className, variant, children, ...props }) => {
490
+ const TypographyComponent = Typography;
491
+ return /* @__PURE__ */ jsxRuntime.jsx(TypographyComponent, { className, ...props, children });
492
+ },
493
+ IconButton: ({ className, size, onClick, children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
494
+ Button,
495
+ {
496
+ type: "text",
497
+ size,
498
+ onClick,
499
+ className,
500
+ icon: children,
501
+ ...props
502
+ }
503
+ ),
504
+ DatePicker: DatePicker ? ({ value, onChange, format, disabled, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
505
+ DatePicker,
506
+ {
507
+ value,
508
+ onChange,
509
+ format,
510
+ disabled,
511
+ ...props
512
+ }
513
+ ) : void 0,
514
+ DateTimePicker: DateTimePicker ? ({ value, onChange, format, disabled, views, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
515
+ DateTimePicker,
516
+ {
517
+ value,
518
+ onChange,
519
+ format,
520
+ disabled,
521
+ showTime: true,
522
+ ...props
523
+ }
524
+ ) : void 0
525
+ };
526
+ };
527
+ var DefaultInfoIcon = ({
528
+ className,
529
+ size = 16
530
+ }) => /* @__PURE__ */ jsxRuntime.jsx(
531
+ "svg",
532
+ {
533
+ width: size,
534
+ height: size,
535
+ viewBox: "0 0 24 24",
536
+ fill: "currentColor",
537
+ className,
538
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" })
539
+ }
540
+ );
541
+ var DefaultVisibilityIcon = ({ className, size = 16 }) => /* @__PURE__ */ jsxRuntime.jsx(
542
+ "svg",
543
+ {
544
+ width: size,
545
+ height: size,
546
+ viewBox: "0 0 24 24",
547
+ fill: "currentColor",
548
+ className,
549
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z" })
550
+ }
551
+ );
552
+ var DefaultVisibilityOffIcon = ({ className, size = 16 }) => /* @__PURE__ */ jsxRuntime.jsx(
553
+ "svg",
554
+ {
555
+ width: size,
556
+ height: size,
557
+ viewBox: "0 0 24 24",
558
+ fill: "currentColor",
559
+ className,
560
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z" })
561
+ }
562
+ );
563
+ var DefaultCopyIcon = ({
564
+ className,
565
+ size = 16
566
+ }) => /* @__PURE__ */ jsxRuntime.jsx(
567
+ "svg",
568
+ {
569
+ width: size,
570
+ height: size,
571
+ viewBox: "0 0 24 24",
572
+ fill: "currentColor",
573
+ className,
574
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z" })
575
+ }
576
+ );
577
+ var DefaultAddIcon = ({
578
+ className,
579
+ size = 16
580
+ }) => /* @__PURE__ */ jsxRuntime.jsx(
581
+ "svg",
582
+ {
583
+ width: size,
584
+ height: size,
585
+ viewBox: "0 0 24 24",
586
+ fill: "currentColor",
587
+ className,
588
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" })
589
+ }
590
+ );
591
+ var DefaultDeleteIcon = ({
592
+ className,
593
+ size = 16
594
+ }) => /* @__PURE__ */ jsxRuntime.jsx(
595
+ "svg",
596
+ {
597
+ width: size,
598
+ height: size,
599
+ viewBox: "0 0 24 24",
600
+ fill: "currentColor",
601
+ className,
602
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z" })
603
+ }
604
+ );
605
+ var defaultIcons = {
606
+ Info: DefaultInfoIcon,
607
+ Visibility: DefaultVisibilityIcon,
608
+ VisibilityOff: DefaultVisibilityOffIcon,
609
+ Copy: DefaultCopyIcon,
610
+ Add: DefaultAddIcon,
611
+ Delete: DefaultDeleteIcon
612
+ };
613
+
614
+ // src/utils/formik.utils.ts
615
+ var getNestedProperty = (obj, path) => {
616
+ if (!path || !obj) {
617
+ return void 0;
618
+ }
619
+ const keys = path.split(/[.[\]]+/).filter(Boolean);
620
+ return keys.reduce((acc, key) => {
621
+ if (acc && typeof acc === "object" && key in acc) {
622
+ return acc[key];
623
+ }
624
+ return void 0;
625
+ }, obj);
626
+ };
627
+ var getNestedValueNew = (obj, path) => {
628
+ if (!obj || !path) {
629
+ return void 0;
630
+ }
631
+ return path.split(".").reduce(
632
+ (acc, key) => acc && typeof acc === "object" && key in acc ? acc[key] : void 0,
633
+ obj
634
+ );
635
+ };
636
+ var getFieldValue = (formik, name) => {
637
+ if (!name) return null;
638
+ if (name.includes(".")) {
639
+ if (name.includes("[")) {
640
+ return getNestedProperty(formik.values, name);
641
+ }
642
+ return name.split(".").reduce(
643
+ (acc, key) => acc && typeof acc === "object" && key in acc ? acc[key] : "",
644
+ formik.values
645
+ );
646
+ }
647
+ return formik.values[name];
648
+ };
649
+ var getFieldError = (formik, name) => {
650
+ if (!name) return void 0;
651
+ if (name.includes(".")) {
652
+ if (name.includes("[")) {
653
+ return getNestedProperty(formik.errors, name);
654
+ }
655
+ return name.split(".").reduce(
656
+ (acc, key) => acc && typeof acc === "object" && key in acc ? acc[key] : "",
657
+ formik.errors
658
+ );
659
+ }
660
+ return formik.errors[name];
661
+ };
662
+ var getFieldTouched = (formik, name) => {
663
+ if (!name) return false;
664
+ if (name.includes(".")) {
665
+ if (name.includes("[")) {
666
+ return !!getNestedProperty(formik.touched, name);
667
+ }
668
+ return !!name.split(".").reduce(
669
+ (acc, key) => acc && typeof acc === "object" && key in acc ? acc[key] : false,
670
+ formik.touched
671
+ );
672
+ }
673
+ return !!formik.touched[name];
674
+ };
675
+ var EmptyField = ({
676
+ name,
677
+ customHandleChange,
678
+ formik: formikProp
679
+ }) => {
680
+ const { uiLibrary, formik } = useFormContext();
681
+ const { adapter } = uiLibrary;
682
+ const Input = adapter.Input;
683
+ const activeFormik = formikProp || formik;
684
+ const fieldValue = getFieldValue(activeFormik, name) || "";
685
+ return /* @__PURE__ */ jsxRuntime.jsx(
686
+ Input,
687
+ {
688
+ id: name,
689
+ type: "hidden",
690
+ name,
691
+ className: "d-none",
692
+ value: fieldValue,
693
+ onChange: (event) => {
694
+ if (customHandleChange) {
695
+ customHandleChange(event, "emptyField");
696
+ } else {
697
+ activeFormik.handleChange(event);
698
+ }
699
+ },
700
+ onBlur: activeFormik.handleBlur
701
+ }
702
+ );
703
+ };
704
+ var FieldWrapper = ({
705
+ children,
706
+ className,
707
+ customClass,
708
+ isChild,
709
+ noIndent,
710
+ hidden,
711
+ index
712
+ }) => {
713
+ if (hidden) {
714
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "d-none", children });
715
+ }
716
+ const wrapperClasses = [
717
+ customClass || "mb-4",
718
+ isChild && !noIndent ? "ps-5" : "",
719
+ className || ""
720
+ ].filter(Boolean).join(" ");
721
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: wrapperClasses, children }, index);
722
+ };
723
+ var IconRenderer = ({
724
+ Icon,
725
+ size = 16,
726
+ className
727
+ }) => {
728
+ if (!Icon) return null;
729
+ return React7__default.default.createElement(Icon, { size, className });
730
+ };
731
+ var FieldLabel = ({
732
+ name,
733
+ label,
734
+ required,
735
+ showOptional,
736
+ info,
737
+ htmlFor,
738
+ className,
739
+ customLabelClass
740
+ }) => {
741
+ const { uiLibrary } = useFormContext();
742
+ const { adapter, icons } = uiLibrary;
743
+ const Label = adapter.Label;
744
+ const IconButton = adapter.IconButton;
745
+ if (!label) return null;
746
+ const InfoIcon = icons?.Info;
747
+ return /* @__PURE__ */ jsxRuntime.jsxs(
748
+ Label,
749
+ {
750
+ htmlFor: htmlFor || name,
751
+ className: `${customLabelClass || className || ""}`,
752
+ children: [
753
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: label }),
754
+ required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-danger", children: " *" }),
755
+ showOptional && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-12 ps-1 text-body-tertiary", children: " (Optional)" }),
756
+ info && InfoIcon && /* @__PURE__ */ jsxRuntime.jsx(
757
+ IconButton,
758
+ {
759
+ size: "small",
760
+ className: "p-0",
761
+ "aria-label": "show info",
762
+ tabIndex: -1,
763
+ children: /* @__PURE__ */ jsxRuntime.jsx(IconRenderer, { Icon: InfoIcon, size: 16 })
764
+ }
765
+ )
766
+ ]
767
+ }
768
+ );
769
+ };
770
+
771
+ // src/utils/field.utils.ts
772
+ var formatString = (inputStr, ignoreChar = false) => {
773
+ if (!inputStr) return "";
774
+ let result = inputStr.replace(/_/g, "-").toLowerCase();
775
+ result = result.replace(/\s+/g, "-");
776
+ result = result.replace(/([a-z])([A-Z])/g, "$1-$2");
777
+ if (!ignoreChar) {
778
+ result = result.replace(/\//g, "-");
779
+ }
780
+ return result;
781
+ };
782
+ var camelToKebabCase = (str) => {
783
+ return str.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
784
+ };
785
+ var sanitizeLabelForCSS = (label) => {
786
+ return label?.replace(/\s+/g, "_") || "";
787
+ };
788
+ var isBlank = (value) => {
789
+ return value === null || value === void 0 || value === "";
790
+ };
791
+ var isNotBlank = (value) => {
792
+ return !isBlank(value);
793
+ };
794
+ var FieldError = ({
795
+ name,
796
+ error,
797
+ touched,
798
+ showCustomError,
799
+ dataTestId,
800
+ className
801
+ }) => {
802
+ if (!showCustomError && (!error || !touched)) {
803
+ return null;
804
+ }
805
+ return /* @__PURE__ */ jsxRuntime.jsx(
806
+ "small",
807
+ {
808
+ id: "error",
809
+ "data-testid": dataTestId || `${formatString(name)}-error`,
810
+ className: className || "d-flex text-danger mt-1 text-12",
811
+ children: error
812
+ }
813
+ );
814
+ };
815
+ var TextField = ({
816
+ name,
817
+ label,
818
+ required,
819
+ customClass,
820
+ isChild,
821
+ noIndent,
822
+ hidden,
823
+ dataTestId,
824
+ showCustomError,
825
+ error: customError,
826
+ index,
827
+ formik: formikProp
828
+ }) => {
829
+ const { formik } = useFormContext();
830
+ const activeFormik = formikProp || formik;
831
+ const fieldValue = getFieldValue(activeFormik, name);
832
+ const fieldError = getFieldError(activeFormik, name);
833
+ const fieldTouched = getFieldTouched(activeFormik, name);
834
+ const isGroupHeading = typeof name === "string" && name.endsWith("__heading");
835
+ const groupKeyForHeading = isGroupHeading ? name.split("__")[0] : null;
836
+ const groupLevelError = groupKeyForHeading ? getFieldError(activeFormik, groupKeyForHeading) : null;
837
+ const resolvedTextError = showCustomError && customError ? customError : groupLevelError || fieldError;
838
+ const showErrorNow = !!resolvedTextError && (fieldTouched || activeFormik.submitCount > 0 || showCustomError);
839
+ return /* @__PURE__ */ jsxRuntime.jsxs(
840
+ FieldWrapper,
841
+ {
842
+ customClass,
843
+ isChild,
844
+ noIndent,
845
+ hidden,
846
+ index,
847
+ children: [
848
+ label && /* @__PURE__ */ jsxRuntime.jsx(
849
+ FieldLabel,
850
+ {
851
+ name,
852
+ label,
853
+ required
854
+ }
855
+ ),
856
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("p", { onClick: () => {
857
+ }, children: fieldValue }) }),
858
+ (showCustomError || showErrorNow) && /* @__PURE__ */ jsxRuntime.jsx(
859
+ FieldError,
860
+ {
861
+ name,
862
+ error: resolvedTextError,
863
+ touched: fieldTouched,
864
+ showCustomError,
865
+ dataTestId
866
+ }
867
+ )
868
+ ]
869
+ }
870
+ );
871
+ };
872
+ var FieldDescription = ({
873
+ desc,
874
+ className,
875
+ customDescClass
876
+ }) => {
877
+ const { uiLibrary } = useFormContext();
878
+ const { adapter } = uiLibrary;
879
+ const FormHelperText = adapter.FormHelperText;
880
+ if (!desc) return null;
881
+ return /* @__PURE__ */ jsxRuntime.jsx(FormHelperText, { className: customDescClass || className || "", children: desc });
882
+ };
883
+ var LinkField = ({
884
+ name,
885
+ label,
886
+ desc,
887
+ required,
888
+ customClass,
889
+ customComponentClass,
890
+ isChild,
891
+ noIndent,
892
+ hidden,
893
+ onClickLink,
894
+ component,
895
+ targetType,
896
+ index
897
+ }) => {
898
+ const handleClick = () => {
899
+ if (onClickLink) {
900
+ onClickLink();
901
+ }
902
+ };
903
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
904
+ /* @__PURE__ */ jsxRuntime.jsxs(
905
+ FieldWrapper,
906
+ {
907
+ customClass,
908
+ isChild,
909
+ noIndent,
910
+ hidden,
911
+ index,
912
+ children: [
913
+ label && /* @__PURE__ */ jsxRuntime.jsxs(
914
+ "a",
915
+ {
916
+ href: targetType === "blank" ? "#" : void 0,
917
+ target: targetType === "blank" ? "_blank" : void 0,
918
+ onClick: (e) => {
919
+ e.preventDefault();
920
+ handleClick();
921
+ },
922
+ style: { cursor: "pointer" },
923
+ children: [
924
+ label,
925
+ required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-danger", children: " *" })
926
+ ]
927
+ }
928
+ ),
929
+ desc && /* @__PURE__ */ jsxRuntime.jsx(FieldDescription, { desc })
930
+ ]
931
+ }
932
+ ),
933
+ component && /* @__PURE__ */ jsxRuntime.jsx("div", { className: customComponentClass || "mb-1 mx-1", children: component })
934
+ ] });
935
+ };
936
+ var ComponentField = ({
937
+ customClass,
938
+ isChild,
939
+ noIndent,
940
+ component,
941
+ blockComponent,
942
+ index
943
+ }) => {
944
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
945
+ component && /* @__PURE__ */ jsxRuntime.jsx(
946
+ FieldWrapper,
947
+ {
948
+ customClass,
949
+ isChild,
950
+ noIndent,
951
+ index,
952
+ children: component
953
+ }
954
+ ),
955
+ blockComponent && /* @__PURE__ */ jsxRuntime.jsx(
956
+ FieldWrapper,
957
+ {
958
+ customClass,
959
+ isChild,
960
+ noIndent,
961
+ index,
962
+ children: blockComponent
963
+ }
964
+ )
965
+ ] });
966
+ };
967
+ var CustomField = ({
968
+ name,
969
+ label,
970
+ desc,
971
+ required,
972
+ customClass,
973
+ isChild,
974
+ noIndent,
975
+ hidden,
976
+ component,
977
+ index
978
+ }) => {
979
+ return /* @__PURE__ */ jsxRuntime.jsxs(
980
+ FieldWrapper,
981
+ {
982
+ customClass,
983
+ isChild,
984
+ noIndent,
985
+ hidden,
986
+ index,
987
+ children: [
988
+ label && /* @__PURE__ */ jsxRuntime.jsx(
989
+ FieldLabel,
990
+ {
991
+ name,
992
+ label,
993
+ required
994
+ }
995
+ ),
996
+ desc && /* @__PURE__ */ jsxRuntime.jsx(FieldDescription, { desc }),
997
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: component })
998
+ ]
999
+ }
1000
+ );
1001
+ };
1002
+ var InputField = ({
1003
+ name,
1004
+ type,
1005
+ label,
1006
+ placeholder,
1007
+ desc,
1008
+ info,
1009
+ required,
1010
+ disabled,
1011
+ hidden,
1012
+ readonly,
1013
+ fieldType = "text",
1014
+ autocomplete,
1015
+ customClass,
1016
+ customLabelClass,
1017
+ dataTestId,
1018
+ isVisibleEnable,
1019
+ isCopyEnable,
1020
+ customIcon,
1021
+ customHandleChange,
1022
+ customFormChange,
1023
+ component,
1024
+ blockComponent,
1025
+ showCustomError,
1026
+ ref: inputRef,
1027
+ onBlur,
1028
+ isChild,
1029
+ noIndent,
1030
+ index,
1031
+ formik: formikProp
1032
+ }) => {
1033
+ const { uiLibrary, formik } = useFormContext();
1034
+ const { adapter, icons } = uiLibrary;
1035
+ const Input = adapter.Input;
1036
+ adapter.IconButton;
1037
+ const activeFormik = formikProp || formik;
1038
+ const [showField, setShowField] = React7.useState({});
1039
+ const fieldValue = getFieldValue(activeFormik, name);
1040
+ const fieldError = getFieldError(activeFormik, name);
1041
+ const fieldTouched = getFieldTouched(activeFormik, name);
1042
+ const showFieldHandler = React7.useCallback((fieldName) => {
1043
+ setShowField((prev) => ({
1044
+ ...prev,
1045
+ [fieldName]: !prev[fieldName]
1046
+ }));
1047
+ }, []);
1048
+ const handleCopy = React7.useCallback(() => {
1049
+ if (typeof window !== "undefined" && document) {
1050
+ const input = document.getElementById(name);
1051
+ if (input) {
1052
+ input.select();
1053
+ document.execCommand("copy");
1054
+ }
1055
+ }
1056
+ }, [name]);
1057
+ const VisibilityIcon = icons?.Visibility;
1058
+ const VisibilityOffIcon = icons?.VisibilityOff;
1059
+ const CopyIcon = icons?.Copy;
1060
+ const inputType = fieldType === "password" ? !showField[name] ? "password" : "text" : fieldType;
1061
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1062
+ FieldWrapper,
1063
+ {
1064
+ customClass,
1065
+ isChild,
1066
+ noIndent,
1067
+ hidden,
1068
+ index,
1069
+ children: [
1070
+ label && /* @__PURE__ */ jsxRuntime.jsx(
1071
+ FieldLabel,
1072
+ {
1073
+ name,
1074
+ label,
1075
+ required,
1076
+ info,
1077
+ customLabelClass
1078
+ }
1079
+ ),
1080
+ desc && /* @__PURE__ */ jsxRuntime.jsx(FieldDescription, { desc }),
1081
+ /* @__PURE__ */ jsxRuntime.jsxs(
1082
+ "div",
1083
+ {
1084
+ className: `input-group ${isCopyEnable || isVisibleEnable ? "" : "rounded"}`,
1085
+ children: [
1086
+ /* @__PURE__ */ jsxRuntime.jsx(
1087
+ Input,
1088
+ {
1089
+ className: `form-control font-14 ${isCopyEnable || isVisibleEnable || customIcon ? "border border-end-0" : "rounded"} ${fieldError && fieldTouched ? "border-danger" : ""}`,
1090
+ id: name,
1091
+ "data-testid": dataTestId || `${formatString(name)}-input`,
1092
+ ref: inputRef,
1093
+ autoComplete: autocomplete || fieldType === "password" ? "new-password" : "off",
1094
+ type: inputType,
1095
+ disabled: disabled || false,
1096
+ name,
1097
+ placeholder,
1098
+ value: fieldValue || "",
1099
+ onChange: (event) => {
1100
+ if (customHandleChange) {
1101
+ customHandleChange(event, type);
1102
+ } else if (customFormChange) {
1103
+ customFormChange(event, type);
1104
+ } else {
1105
+ activeFormik.handleChange(event);
1106
+ }
1107
+ },
1108
+ onBlur: onBlur || activeFormik.handleBlur,
1109
+ readOnly: readonly || false,
1110
+ error: !!(fieldError && fieldTouched)
1111
+ }
1112
+ ),
1113
+ customIcon && /* @__PURE__ */ jsxRuntime.jsx(
1114
+ "div",
1115
+ {
1116
+ className: `z-0 bg-transparent btn btn-outline-secondary border-0 border-top border-bottom px-3 ${!isCopyEnable && !isVisibleEnable ? "border-end rounded-end" : ""} ${fieldError && fieldTouched ? "border-danger" : ""}`,
1117
+ style: { cursor: "default" },
1118
+ children: customIcon
1119
+ }
1120
+ ),
1121
+ isVisibleEnable && VisibilityIcon && VisibilityOffIcon && /* @__PURE__ */ jsxRuntime.jsx(
1122
+ "button",
1123
+ {
1124
+ className: `z-0 btn btn-outline-secondary border-0 rounded-0 border-top border-bottom ${!isCopyEnable ? "border-end rounded-end" : ""} ${fieldError && fieldTouched ? "border-danger" : ""}`,
1125
+ type: "button",
1126
+ "data-testid": `${formatString(name)}-visible-btn`,
1127
+ onClick: () => showFieldHandler(name),
1128
+ children: !showField[name] ? /* @__PURE__ */ jsxRuntime.jsx(IconRenderer, { Icon: VisibilityOffIcon, size: 16 }) : /* @__PURE__ */ jsxRuntime.jsx(IconRenderer, { Icon: VisibilityIcon, size: 16 })
1129
+ }
1130
+ ),
1131
+ isCopyEnable && CopyIcon && /* @__PURE__ */ jsxRuntime.jsx(
1132
+ "button",
1133
+ {
1134
+ className: `z-0 btn btn-outline-secondary border border-start-0 border-end rounded-end ${fieldError && fieldTouched ? "border-danger" : ""}`,
1135
+ type: "button",
1136
+ "data-testid": `${formatString(name)}-copy-btn`,
1137
+ "aria-label": "copy",
1138
+ onClick: handleCopy,
1139
+ children: /* @__PURE__ */ jsxRuntime.jsx(IconRenderer, { Icon: CopyIcon, size: 16 })
1140
+ }
1141
+ ),
1142
+ component && /* @__PURE__ */ jsxRuntime.jsx("div", { children: component })
1143
+ ]
1144
+ }
1145
+ ),
1146
+ blockComponent && /* @__PURE__ */ jsxRuntime.jsx("div", { children: blockComponent }),
1147
+ (showCustomError || fieldError && fieldTouched) && /* @__PURE__ */ jsxRuntime.jsx(
1148
+ FieldError,
1149
+ {
1150
+ name,
1151
+ error: fieldError,
1152
+ touched: fieldTouched,
1153
+ showCustomError,
1154
+ dataTestId
1155
+ }
1156
+ )
1157
+ ]
1158
+ }
1159
+ );
1160
+ };
1161
+ var TextareaField = ({
1162
+ name,
1163
+ type,
1164
+ label,
1165
+ placeholder,
1166
+ desc,
1167
+ required,
1168
+ customClass,
1169
+ customComponentClass,
1170
+ isChild,
1171
+ noIndent,
1172
+ hidden,
1173
+ readonly,
1174
+ rows = 4,
1175
+ dataTestId,
1176
+ customHandleChange,
1177
+ customFormChange,
1178
+ component,
1179
+ formik: formikProp
1180
+ }) => {
1181
+ const { uiLibrary, formik } = useFormContext();
1182
+ const { adapter } = uiLibrary;
1183
+ const Textarea = adapter.Textarea;
1184
+ const activeFormik = formikProp || formik;
1185
+ const fieldValue = getFieldValue(activeFormik, name);
1186
+ const fieldError = getFieldError(activeFormik, name);
1187
+ const fieldTouched = getFieldTouched(activeFormik, name);
1188
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1189
+ /* @__PURE__ */ jsxRuntime.jsxs(
1190
+ FieldWrapper,
1191
+ {
1192
+ customClass,
1193
+ isChild,
1194
+ noIndent,
1195
+ hidden,
1196
+ children: [
1197
+ label && /* @__PURE__ */ jsxRuntime.jsx(
1198
+ FieldLabel,
1199
+ {
1200
+ name,
1201
+ label,
1202
+ required
1203
+ }
1204
+ ),
1205
+ desc && /* @__PURE__ */ jsxRuntime.jsx(FieldDescription, { desc }),
1206
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
1207
+ Textarea,
1208
+ {
1209
+ id: name,
1210
+ className: `form-control text-14 ${required && fieldError && fieldTouched ? "border-danger" : ""}`,
1211
+ name,
1212
+ "data-testid": dataTestId || `${formatString(name)}-text-box`,
1213
+ placeholder,
1214
+ rows,
1215
+ value: fieldValue || "",
1216
+ autoComplete: "off",
1217
+ onChange: (event) => {
1218
+ if (customHandleChange) {
1219
+ customHandleChange(event, type);
1220
+ } else if (customFormChange) {
1221
+ customFormChange(event, type);
1222
+ } else {
1223
+ activeFormik.handleChange(event);
1224
+ }
1225
+ },
1226
+ onBlur: activeFormik.handleBlur,
1227
+ readOnly: readonly || false,
1228
+ disabled: readonly || false,
1229
+ error: !!(required && fieldError && fieldTouched)
1230
+ }
1231
+ ) }),
1232
+ required && fieldError && fieldTouched && /* @__PURE__ */ jsxRuntime.jsx(
1233
+ FieldError,
1234
+ {
1235
+ name,
1236
+ error: fieldError,
1237
+ touched: fieldTouched,
1238
+ dataTestId
1239
+ }
1240
+ )
1241
+ ]
1242
+ }
1243
+ ),
1244
+ component && /* @__PURE__ */ jsxRuntime.jsx("div", { className: customComponentClass || "mb-1 mx-1", children: component })
1245
+ ] });
1246
+ };
1247
+ var CheckboxField = ({
1248
+ name,
1249
+ type,
1250
+ label,
1251
+ desc,
1252
+ info,
1253
+ required,
1254
+ disabled,
1255
+ customClass,
1256
+ customComponentClass,
1257
+ isChild,
1258
+ noIndent,
1259
+ hidden,
1260
+ dataTestId,
1261
+ showCustomError,
1262
+ customHandleChange,
1263
+ customFormChange,
1264
+ component,
1265
+ child,
1266
+ formik: formikProp
1267
+ }) => {
1268
+ const { uiLibrary, formik } = useFormContext();
1269
+ const { adapter, icons } = uiLibrary;
1270
+ const Checkbox = adapter.Checkbox;
1271
+ const FormHelperText = adapter.FormHelperText;
1272
+ const IconButton = adapter.IconButton;
1273
+ const activeFormik = formikProp || formik;
1274
+ const fieldValue = getFieldValue(activeFormik, name);
1275
+ const fieldError = getFieldError(activeFormik, name);
1276
+ const fieldTouched = getFieldTouched(activeFormik, name);
1277
+ const InfoIcon = icons?.Info;
1278
+ const setFieldValuesRecursive = (childFields) => {
1279
+ if (childFields) {
1280
+ childFields.forEach((c) => {
1281
+ activeFormik.setFieldValue(c.name, "");
1282
+ activeFormik.setFieldTouched(c.name, false);
1283
+ });
1284
+ }
1285
+ };
1286
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1287
+ /* @__PURE__ */ jsxRuntime.jsxs(
1288
+ FieldWrapper,
1289
+ {
1290
+ customClass,
1291
+ isChild,
1292
+ noIndent,
1293
+ hidden,
1294
+ children: [
1295
+ /* @__PURE__ */ jsxRuntime.jsx(
1296
+ Checkbox,
1297
+ {
1298
+ id: name,
1299
+ name,
1300
+ "data-testid": dataTestId || `${formatString(name)}-check-box`,
1301
+ checked: !!fieldValue,
1302
+ disabled: disabled || false,
1303
+ onChange: (event) => {
1304
+ if (customHandleChange) {
1305
+ customHandleChange(event, type);
1306
+ } else if (customFormChange) {
1307
+ customFormChange(event, type);
1308
+ } else {
1309
+ activeFormik.handleChange(event);
1310
+ }
1311
+ if (!event.target.checked) {
1312
+ setFieldValuesRecursive(child);
1313
+ }
1314
+ },
1315
+ label: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "d-flex flex-column align-items-start", children: /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-14 text-dark fw-medium align-items-center", children: [
1316
+ label,
1317
+ required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-danger", children: " *" }),
1318
+ info && InfoIcon && /* @__PURE__ */ jsxRuntime.jsx(
1319
+ IconButton,
1320
+ {
1321
+ size: "small",
1322
+ className: "p-0",
1323
+ "aria-label": "show info",
1324
+ tabIndex: -1,
1325
+ children: /* @__PURE__ */ jsxRuntime.jsx(IconRenderer, { Icon: InfoIcon, size: 16 })
1326
+ }
1327
+ )
1328
+ ] }) }),
1329
+ error: !!(fieldError && fieldTouched)
1330
+ }
1331
+ ),
1332
+ desc && /* @__PURE__ */ jsxRuntime.jsx(FormHelperText, { className: "text-black-50 mt-0 mb-1", children: desc }),
1333
+ (showCustomError || fieldError && fieldTouched) && /* @__PURE__ */ jsxRuntime.jsx(
1334
+ FieldError,
1335
+ {
1336
+ name,
1337
+ error: fieldError,
1338
+ touched: fieldTouched,
1339
+ showCustomError,
1340
+ dataTestId
1341
+ }
1342
+ ),
1343
+ component && /* @__PURE__ */ jsxRuntime.jsx("div", { className: customComponentClass || "mb-1 mx-1", children: component })
1344
+ ]
1345
+ }
1346
+ ),
1347
+ child && child.map((c, childIndex) => {
1348
+ return fieldValue && // This would need to be handled by DynamicForm orchestrator
1349
+ // For now, we'll just render the child if value is truthy
1350
+ null;
1351
+ })
1352
+ ] });
1353
+ };
1354
+ var RadioField = ({
1355
+ name,
1356
+ type,
1357
+ label,
1358
+ desc,
1359
+ required,
1360
+ disabled,
1361
+ customClass,
1362
+ customComponentClass,
1363
+ isChild,
1364
+ noIndent,
1365
+ hidden,
1366
+ values = {},
1367
+ dataTestId,
1368
+ customHandleChange,
1369
+ customFormChange,
1370
+ component,
1371
+ child,
1372
+ formik: formikProp
1373
+ }) => {
1374
+ const { uiLibrary, formik } = useFormContext();
1375
+ const { adapter } = uiLibrary;
1376
+ const Radio = adapter.Radio;
1377
+ const FormHelperText = adapter.FormHelperText;
1378
+ const activeFormik = formikProp || formik;
1379
+ const fieldValue = getFieldValue(activeFormik, name);
1380
+ const fieldError = getFieldError(activeFormik, name);
1381
+ const fieldTouched = getFieldTouched(activeFormik, name);
1382
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1383
+ /* @__PURE__ */ jsxRuntime.jsxs(
1384
+ FieldWrapper,
1385
+ {
1386
+ customClass,
1387
+ isChild,
1388
+ noIndent,
1389
+ hidden,
1390
+ children: [
1391
+ label && /* @__PURE__ */ jsxRuntime.jsx(
1392
+ FieldLabel,
1393
+ {
1394
+ name,
1395
+ label,
1396
+ required
1397
+ }
1398
+ ),
1399
+ /* @__PURE__ */ jsxRuntime.jsx(
1400
+ "div",
1401
+ {
1402
+ id: name,
1403
+ "data-testid": dataTestId || `${formatString(name)}-btn`,
1404
+ role: "radiogroup",
1405
+ children: Object.entries(values).map(([key, value], index) => /* @__PURE__ */ jsxRuntime.jsx(
1406
+ Radio,
1407
+ {
1408
+ name,
1409
+ value: key,
1410
+ checked: fieldValue === key || fieldValue === value,
1411
+ disabled: disabled || false,
1412
+ onChange: (event) => {
1413
+ if (customHandleChange) {
1414
+ customHandleChange(event, type);
1415
+ } else if (customFormChange) {
1416
+ customFormChange(event, type);
1417
+ } else {
1418
+ activeFormik.handleChange(event);
1419
+ }
1420
+ if (!event.target.checked && child) {
1421
+ child.forEach((c) => {
1422
+ activeFormik.setFieldValue(c.name, "");
1423
+ });
1424
+ }
1425
+ },
1426
+ label: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-14 text-secondary m-0", children: value })
1427
+ },
1428
+ key
1429
+ ))
1430
+ }
1431
+ ),
1432
+ desc && /* @__PURE__ */ jsxRuntime.jsx(FormHelperText, { className: "text-black-50 mb-1", children: desc }),
1433
+ fieldError && fieldTouched && /* @__PURE__ */ jsxRuntime.jsx(
1434
+ FieldError,
1435
+ {
1436
+ name,
1437
+ error: fieldError,
1438
+ touched: fieldTouched,
1439
+ dataTestId
1440
+ }
1441
+ ),
1442
+ component && /* @__PURE__ */ jsxRuntime.jsx("div", { className: customComponentClass || "mb-1 mx-1", children: component })
1443
+ ]
1444
+ }
1445
+ ),
1446
+ child && child.map((c, i) => {
1447
+ return null;
1448
+ })
1449
+ ] });
1450
+ };
1451
+ var DropdownField = ({
1452
+ name,
1453
+ type,
1454
+ label,
1455
+ desc,
1456
+ info,
1457
+ required,
1458
+ disabled,
1459
+ customClass,
1460
+ isChild,
1461
+ noIndent,
1462
+ hidden,
1463
+ values = {},
1464
+ headerKey,
1465
+ dataTestId,
1466
+ isCopyEnable,
1467
+ resetChild = true,
1468
+ ignoreChar,
1469
+ customHandleChange,
1470
+ customFormChange,
1471
+ component,
1472
+ child,
1473
+ setFieldValuesRecursive,
1474
+ formik: formikProp,
1475
+ index
1476
+ }) => {
1477
+ const { uiLibrary, formik } = useFormContext();
1478
+ const { adapter } = uiLibrary;
1479
+ const Select = adapter.Select;
1480
+ const FormControl = adapter.FormControl;
1481
+ const activeFormik = formikProp || formik;
1482
+ const fieldValue = getFieldValue(activeFormik, name);
1483
+ const fieldError = getFieldError(activeFormik, name);
1484
+ const fieldTouched = getFieldTouched(activeFormik, name);
1485
+ const handleSetFieldValuesRecursive = (childFields, parentValue) => {
1486
+ if (childFields && setFieldValuesRecursive) {
1487
+ setFieldValuesRecursive(childFields, parentValue);
1488
+ }
1489
+ };
1490
+ const options = Array.isArray(values) ? values : Object.entries(values).map(([key, value]) => ({
1491
+ value: key,
1492
+ label: value || key
1493
+ }));
1494
+ const sortedOptions = [...options].sort((a, b) => {
1495
+ if (a.value === "") return -1;
1496
+ return 0;
1497
+ });
1498
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1499
+ /* @__PURE__ */ jsxRuntime.jsx(
1500
+ FieldWrapper,
1501
+ {
1502
+ customClass,
1503
+ isChild,
1504
+ noIndent,
1505
+ hidden,
1506
+ index,
1507
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
1508
+ FormControl,
1509
+ {
1510
+ className: "w-100",
1511
+ required,
1512
+ error: !!(fieldTouched && fieldError),
1513
+ children: [
1514
+ label && /* @__PURE__ */ jsxRuntime.jsx(
1515
+ FieldLabel,
1516
+ {
1517
+ name,
1518
+ label,
1519
+ required,
1520
+ info
1521
+ }
1522
+ ),
1523
+ desc && /* @__PURE__ */ jsxRuntime.jsx(FieldDescription, { desc }),
1524
+ /* @__PURE__ */ jsxRuntime.jsxs(
1525
+ Select,
1526
+ {
1527
+ className: `form-select text-14 ${isCopyEnable ? "border border-end-0" : ""} ${fieldError && fieldTouched ? "border-danger" : ""}`,
1528
+ id: name,
1529
+ name,
1530
+ "data-testid": dataTestId || `${formatString(name)}-dropdown`,
1531
+ disabled: disabled || false,
1532
+ value: fieldValue || "",
1533
+ onChange: (event) => {
1534
+ if (customHandleChange) {
1535
+ customHandleChange(event, type, typeof index === "number" ? index : void 0);
1536
+ } else if (customFormChange) {
1537
+ customFormChange(event, type);
1538
+ } else {
1539
+ activeFormik.handleChange(event);
1540
+ }
1541
+ if (resetChild) {
1542
+ handleSetFieldValuesRecursive(child, event.target.value);
1543
+ }
1544
+ },
1545
+ onBlur: activeFormik.handleBlur,
1546
+ error: !!(fieldError && fieldTouched),
1547
+ children: [
1548
+ headerKey && /* @__PURE__ */ jsxRuntime.jsx("option", { children: headerKey }),
1549
+ sortedOptions.map((option, i) => /* @__PURE__ */ jsxRuntime.jsx(
1550
+ "option",
1551
+ {
1552
+ "data-testid": `${formatString(String(option.value), ignoreChar)}-option`,
1553
+ value: option.value,
1554
+ children: option.label
1555
+ },
1556
+ i
1557
+ ))
1558
+ ]
1559
+ }
1560
+ ),
1561
+ fieldError && fieldTouched && /* @__PURE__ */ jsxRuntime.jsx(
1562
+ FieldError,
1563
+ {
1564
+ name,
1565
+ error: fieldError,
1566
+ touched: fieldTouched,
1567
+ dataTestId
1568
+ }
1569
+ )
1570
+ ]
1571
+ }
1572
+ )
1573
+ }
1574
+ ),
1575
+ child && child.map((childField, childIndex) => {
1576
+ return null;
1577
+ }),
1578
+ component && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-1 mx-1", children: component })
1579
+ ] });
1580
+ };
1581
+ var ToggleField = ({
1582
+ name,
1583
+ type,
1584
+ label,
1585
+ required,
1586
+ disabled,
1587
+ customClass,
1588
+ isChild,
1589
+ noIndent,
1590
+ dataTestId,
1591
+ customHandleChange,
1592
+ customFormChange,
1593
+ formik: formikProp
1594
+ }) => {
1595
+ const { uiLibrary, formik } = useFormContext();
1596
+ const { adapter } = uiLibrary;
1597
+ const Switch = adapter.Switch;
1598
+ const activeFormik = formikProp || formik;
1599
+ const fieldValue = getFieldValue(activeFormik, name);
1600
+ const fieldError = getFieldError(activeFormik, name);
1601
+ const fieldTouched = getFieldTouched(activeFormik, name);
1602
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1603
+ "div",
1604
+ {
1605
+ className: `d-flex gap-2 align-items-center ${isChild && !noIndent ? "ps-5" : ""}`,
1606
+ children: [
1607
+ /* @__PURE__ */ jsxRuntime.jsx(
1608
+ Switch,
1609
+ {
1610
+ id: name,
1611
+ name,
1612
+ "data-testid": dataTestId || `${formatString(name)}-check-box`,
1613
+ disabled: disabled || false,
1614
+ checked: !!fieldValue,
1615
+ onChange: (event) => {
1616
+ const newValue = event.target.checked;
1617
+ if (customHandleChange) {
1618
+ customHandleChange(event, type);
1619
+ } else if (customFormChange) {
1620
+ customFormChange(event, type);
1621
+ } else {
1622
+ activeFormik.setFieldValue(name, newValue);
1623
+ }
1624
+ }
1625
+ }
1626
+ ),
1627
+ label && /* @__PURE__ */ jsxRuntime.jsx(
1628
+ FieldLabel,
1629
+ {
1630
+ name,
1631
+ label,
1632
+ required,
1633
+ htmlFor: name
1634
+ }
1635
+ ),
1636
+ fieldError && fieldTouched && /* @__PURE__ */ jsxRuntime.jsx(
1637
+ FieldError,
1638
+ {
1639
+ name,
1640
+ error: fieldError,
1641
+ touched: fieldTouched,
1642
+ dataTestId
1643
+ }
1644
+ )
1645
+ ]
1646
+ }
1647
+ );
1648
+ };
1649
+ var FileUploadField = ({
1650
+ name,
1651
+ type,
1652
+ label,
1653
+ info,
1654
+ required,
1655
+ customClass,
1656
+ customComponentClass,
1657
+ isChild,
1658
+ noIndent,
1659
+ dataTestId,
1660
+ customHandleChange,
1661
+ customFormChange,
1662
+ component,
1663
+ ref: inputRef,
1664
+ formik: formikProp,
1665
+ index
1666
+ }) => {
1667
+ const { uiLibrary, formik } = useFormContext();
1668
+ const { adapter, icons } = uiLibrary;
1669
+ adapter.Input;
1670
+ const Button = adapter.Button;
1671
+ adapter.IconButton;
1672
+ const activeFormik = formikProp || formik;
1673
+ const fieldValue = getFieldValue(activeFormik, name);
1674
+ const fieldError = getFieldError(activeFormik, name);
1675
+ const fieldTouched = getFieldTouched(activeFormik, name);
1676
+ icons?.Info;
1677
+ const DeleteIcon = icons?.Delete;
1678
+ const handleRemoveFile = () => {
1679
+ activeFormik.setFieldValue(name, null);
1680
+ };
1681
+ const fileValue = fieldValue;
1682
+ const fileName = fileValue instanceof File ? fileValue.name : typeof fileValue === "string" ? fileValue.split("/").pop() : null;
1683
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1684
+ /* @__PURE__ */ jsxRuntime.jsxs(
1685
+ FieldWrapper,
1686
+ {
1687
+ customClass,
1688
+ isChild,
1689
+ noIndent,
1690
+ index,
1691
+ children: [
1692
+ label && /* @__PURE__ */ jsxRuntime.jsx(
1693
+ FieldLabel,
1694
+ {
1695
+ name,
1696
+ label,
1697
+ required,
1698
+ info
1699
+ }
1700
+ ),
1701
+ !fileValue && /* @__PURE__ */ jsxRuntime.jsx(
1702
+ "input",
1703
+ {
1704
+ className: `form-control ${required && fieldError && fieldTouched ? "border-danger" : ""}`,
1705
+ type: "file",
1706
+ id: name,
1707
+ name,
1708
+ "data-testid": dataTestId || `${formatString(name)}-file`,
1709
+ ref: inputRef,
1710
+ onChange: (event) => {
1711
+ if (customHandleChange) {
1712
+ customHandleChange(event, type);
1713
+ } else if (customFormChange) {
1714
+ customFormChange(event, type);
1715
+ } else {
1716
+ activeFormik.handleChange(event);
1717
+ }
1718
+ if (event.currentTarget.files?.[0]) {
1719
+ activeFormik.setFieldValue(name, event.currentTarget.files[0]);
1720
+ }
1721
+ },
1722
+ onBlur: activeFormik.handleBlur
1723
+ }
1724
+ ),
1725
+ required && fieldError && fieldTouched && /* @__PURE__ */ jsxRuntime.jsx(
1726
+ FieldError,
1727
+ {
1728
+ name,
1729
+ error: fieldError,
1730
+ touched: fieldTouched,
1731
+ dataTestId
1732
+ }
1733
+ ),
1734
+ fileValue && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1735
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "d-flex justify-content-between align-items-center", children: [
1736
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1737
+ "File: ",
1738
+ fileName
1739
+ ] }),
1740
+ /* @__PURE__ */ jsxRuntime.jsxs(
1741
+ Button,
1742
+ {
1743
+ variant: "text",
1744
+ "data-testid": `${formatString(name)}-remove-btn`,
1745
+ className: "text-14 text-capitalize p-1 text-danger gap-1 col-3",
1746
+ onClick: handleRemoveFile,
1747
+ children: [
1748
+ DeleteIcon && /* @__PURE__ */ jsxRuntime.jsx(IconRenderer, { Icon: DeleteIcon, size: 16 }),
1749
+ " Remove File"
1750
+ ]
1751
+ }
1752
+ )
1753
+ ] }),
1754
+ fieldError && /* @__PURE__ */ jsxRuntime.jsx(
1755
+ FieldError,
1756
+ {
1757
+ name,
1758
+ error: fieldError,
1759
+ touched: fieldTouched,
1760
+ dataTestId
1761
+ }
1762
+ )
1763
+ ] })
1764
+ ]
1765
+ }
1766
+ ),
1767
+ component && /* @__PURE__ */ jsxRuntime.jsx("div", { className: customComponentClass || "mb-1 mx-1", children: component })
1768
+ ] });
1769
+ };
1770
+ var SingleSelectField = ({
1771
+ name,
1772
+ type,
1773
+ label,
1774
+ desc,
1775
+ info,
1776
+ required,
1777
+ disabled,
1778
+ customClass,
1779
+ customComponentClass,
1780
+ isChild,
1781
+ noIndent,
1782
+ hidden,
1783
+ values = [],
1784
+ isSearchable,
1785
+ isMulti = false,
1786
+ optionsLabel,
1787
+ dataTestId,
1788
+ customHandleChange,
1789
+ customFormChange,
1790
+ component,
1791
+ child,
1792
+ setFieldValuesRecursive,
1793
+ formik: formikProp,
1794
+ index
1795
+ }) => {
1796
+ const { uiLibrary, formik } = useFormContext();
1797
+ const { adapter } = uiLibrary;
1798
+ const FormControl = adapter.FormControl;
1799
+ const activeFormik = formikProp || formik;
1800
+ const fieldValue = getFieldValue(activeFormik, name);
1801
+ const fieldError = getFieldError(activeFormik, name);
1802
+ const fieldTouched = getFieldTouched(activeFormik, name);
1803
+ const options = Array.isArray(values) ? values : Object.entries(values).map(([value, label2]) => ({
1804
+ value,
1805
+ label: String(label2)
1806
+ }));
1807
+ const selectedOption = fieldValue ? options.find((opt) => opt.value === fieldValue) : null;
1808
+ const handleSelectChange = (selected) => {
1809
+ const event = {
1810
+ target: {
1811
+ name,
1812
+ value: selected ? selected.value : ""
1813
+ }
1814
+ };
1815
+ if (customHandleChange) {
1816
+ customHandleChange(event, type);
1817
+ } else if (customFormChange) {
1818
+ customFormChange(event, type);
1819
+ } else {
1820
+ activeFormik.handleChange(event);
1821
+ }
1822
+ if (child && setFieldValuesRecursive) {
1823
+ setFieldValuesRecursive(child);
1824
+ }
1825
+ };
1826
+ const Select = adapter.Select;
1827
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1828
+ /* @__PURE__ */ jsxRuntime.jsx(
1829
+ FieldWrapper,
1830
+ {
1831
+ customClass,
1832
+ isChild,
1833
+ noIndent,
1834
+ hidden,
1835
+ index,
1836
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
1837
+ FormControl,
1838
+ {
1839
+ className: "w-100",
1840
+ required,
1841
+ error: !!(fieldTouched && fieldError),
1842
+ children: [
1843
+ label && /* @__PURE__ */ jsxRuntime.jsx(
1844
+ FieldLabel,
1845
+ {
1846
+ name,
1847
+ label,
1848
+ required,
1849
+ info
1850
+ }
1851
+ ),
1852
+ desc && /* @__PURE__ */ jsxRuntime.jsx(FieldDescription, { desc }),
1853
+ /* @__PURE__ */ jsxRuntime.jsx("div", { "data-testid": dataTestId || `${formatString(name)}-single-select`, children: /* @__PURE__ */ jsxRuntime.jsx(
1854
+ Select,
1855
+ {
1856
+ className: `text-14 ${isMulti ? "" : ""} ${fieldError && fieldTouched ? "border-danger" : ""}`,
1857
+ name,
1858
+ disabled: disabled || false,
1859
+ value: selectedOption ? String(selectedOption.value) : "",
1860
+ onChange: (event) => {
1861
+ const selected = options.find(
1862
+ (opt) => String(opt.value) === event.target.value
1863
+ );
1864
+ handleSelectChange(selected || null);
1865
+ },
1866
+ onBlur: activeFormik.handleBlur,
1867
+ error: !!(fieldError && fieldTouched),
1868
+ children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: String(option.value), children: option.label }, option.value))
1869
+ }
1870
+ ) }),
1871
+ fieldError && fieldTouched && /* @__PURE__ */ jsxRuntime.jsx(
1872
+ FieldError,
1873
+ {
1874
+ name,
1875
+ error: fieldError,
1876
+ touched: fieldTouched,
1877
+ dataTestId
1878
+ }
1879
+ )
1880
+ ]
1881
+ }
1882
+ )
1883
+ }
1884
+ ),
1885
+ child && child.map((childField, childIndex) => {
1886
+ return null;
1887
+ }),
1888
+ component && /* @__PURE__ */ jsxRuntime.jsx("div", { className: customComponentClass || "mb-1 mx-1", children: component })
1889
+ ] });
1890
+ };
1891
+ var MultiSelectField = ({
1892
+ name,
1893
+ type,
1894
+ label,
1895
+ desc,
1896
+ info,
1897
+ required,
1898
+ customClass,
1899
+ customDescClass,
1900
+ customComponentClass,
1901
+ isChild,
1902
+ noIndent,
1903
+ hidden,
1904
+ values = [],
1905
+ dataTestId,
1906
+ customHandleChange,
1907
+ component,
1908
+ blockComponent,
1909
+ formik: formikProp,
1910
+ index
1911
+ }) => {
1912
+ const { uiLibrary, formik } = useFormContext();
1913
+ const { adapter } = uiLibrary;
1914
+ const FormControl = adapter.FormControl;
1915
+ const activeFormik = formikProp || formik;
1916
+ const fieldValue = getFieldValue(activeFormik, name);
1917
+ const fieldError = getFieldError(activeFormik, name);
1918
+ const fieldTouched = getFieldTouched(activeFormik, name);
1919
+ const options = Array.isArray(values) ? values : Object.entries(values).map(([value, label2]) => ({
1920
+ value,
1921
+ label: String(label2)
1922
+ }));
1923
+ const selectedValues = Array.isArray(fieldValue) ? fieldValue : [];
1924
+ const handleChange = (event) => {
1925
+ const selectedOptions = Array.from(
1926
+ event.target.selectedOptions,
1927
+ (option) => option.value
1928
+ );
1929
+ const syntheticEvent = {
1930
+ target: {
1931
+ name,
1932
+ value: selectedOptions
1933
+ }
1934
+ };
1935
+ if (customHandleChange) {
1936
+ customHandleChange(syntheticEvent, "multiSelect");
1937
+ } else {
1938
+ activeFormik.setFieldValue(name, selectedOptions);
1939
+ }
1940
+ };
1941
+ adapter.Select;
1942
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1943
+ /* @__PURE__ */ jsxRuntime.jsxs(
1944
+ FieldWrapper,
1945
+ {
1946
+ customClass,
1947
+ isChild,
1948
+ noIndent,
1949
+ hidden,
1950
+ index,
1951
+ "data-testid": dataTestId || `${formatString(name)}-multi-select`,
1952
+ children: [
1953
+ blockComponent && /* @__PURE__ */ jsxRuntime.jsx("div", { children: blockComponent }),
1954
+ /* @__PURE__ */ jsxRuntime.jsxs(FormControl, { className: "w-100", required, children: [
1955
+ label && /* @__PURE__ */ jsxRuntime.jsx(
1956
+ FieldLabel,
1957
+ {
1958
+ name,
1959
+ label,
1960
+ required,
1961
+ info
1962
+ }
1963
+ ),
1964
+ desc && /* @__PURE__ */ jsxRuntime.jsx(FieldDescription, { desc, customDescClass }),
1965
+ /* @__PURE__ */ jsxRuntime.jsx("div", { "data-testid": dataTestId || `${formatString(name)}-select`, children: /* @__PURE__ */ jsxRuntime.jsx(
1966
+ "select",
1967
+ {
1968
+ name,
1969
+ multiple: true,
1970
+ value: selectedValues.map(String),
1971
+ onChange: handleChange,
1972
+ onBlur: activeFormik.handleBlur,
1973
+ className: `form-select text-14 ${fieldError && fieldTouched ? "border-danger" : ""}`,
1974
+ children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: String(option.value), children: option.label }, option.value))
1975
+ }
1976
+ ) }),
1977
+ fieldError && fieldTouched && /* @__PURE__ */ jsxRuntime.jsx(
1978
+ FieldError,
1979
+ {
1980
+ name,
1981
+ error: fieldError,
1982
+ touched: fieldTouched,
1983
+ dataTestId
1984
+ }
1985
+ )
1986
+ ] })
1987
+ ]
1988
+ }
1989
+ ),
1990
+ component && /* @__PURE__ */ jsxRuntime.jsx("div", { className: customComponentClass || "mb-1 mx-1", children: component })
1991
+ ] });
1992
+ };
1993
+ var AsyncSelectField = ({
1994
+ name,
1995
+ type,
1996
+ label,
1997
+ desc,
1998
+ info,
1999
+ required,
2000
+ disabled,
2001
+ customClass,
2002
+ customComponentClass,
2003
+ isChild,
2004
+ noIndent,
2005
+ hidden,
2006
+ values = [],
2007
+ isMulti = false,
2008
+ loaderCall,
2009
+ dataTestId,
2010
+ customHandleChange,
2011
+ customFormChange,
2012
+ component,
2013
+ child,
2014
+ setFieldValuesRecursive,
2015
+ formik: formikProp,
2016
+ index
2017
+ }) => {
2018
+ const { uiLibrary, formik } = useFormContext();
2019
+ const { adapter } = uiLibrary;
2020
+ const FormControl = adapter.FormControl;
2021
+ const activeFormik = formikProp || formik;
2022
+ const [asyncLoading, setAsyncLoading] = React7.useState(false);
2023
+ const fieldValue = getFieldValue(activeFormik, name);
2024
+ const fieldError = getFieldError(activeFormik, name);
2025
+ const fieldTouched = getFieldTouched(activeFormik, name);
2026
+ const handleChange = (event) => {
2027
+ if (customHandleChange) {
2028
+ customHandleChange(event, type);
2029
+ } else if (customFormChange) {
2030
+ customFormChange(event, type);
2031
+ } else {
2032
+ activeFormik.handleChange(event);
2033
+ }
2034
+ if (child && setFieldValuesRecursive) {
2035
+ setFieldValuesRecursive(child);
2036
+ }
2037
+ };
2038
+ const Select = adapter.Select;
2039
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2040
+ /* @__PURE__ */ jsxRuntime.jsx(
2041
+ FieldWrapper,
2042
+ {
2043
+ customClass,
2044
+ isChild,
2045
+ noIndent,
2046
+ hidden,
2047
+ index,
2048
+ "data-testid": dataTestId || `${formatString(name)}-async-select`,
2049
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
2050
+ FormControl,
2051
+ {
2052
+ className: "w-100",
2053
+ required,
2054
+ error: !!(fieldTouched && fieldError),
2055
+ children: [
2056
+ label && /* @__PURE__ */ jsxRuntime.jsx(
2057
+ FieldLabel,
2058
+ {
2059
+ name,
2060
+ label,
2061
+ required,
2062
+ info
2063
+ }
2064
+ ),
2065
+ desc && /* @__PURE__ */ jsxRuntime.jsx(FieldDescription, { desc }),
2066
+ /* @__PURE__ */ jsxRuntime.jsx(
2067
+ "div",
2068
+ {
2069
+ "data-testid": dataTestId || `${formatString(name)}-async-select`,
2070
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
2071
+ Select,
2072
+ {
2073
+ name,
2074
+ disabled,
2075
+ value: fieldValue ? String(fieldValue) : "",
2076
+ onChange: handleChange,
2077
+ onBlur: activeFormik.handleBlur,
2078
+ error: !!(fieldError && fieldTouched),
2079
+ children: [
2080
+ asyncLoading && /* @__PURE__ */ jsxRuntime.jsx("option", { children: "Loading..." }),
2081
+ !asyncLoading && values && (Array.isArray(values) ? values : Object.entries(values).map(([value, label2]) => ({
2082
+ value,
2083
+ label: String(label2)
2084
+ }))).map((option) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: String(option.value), children: option.label }, option.value))
2085
+ ]
2086
+ }
2087
+ )
2088
+ }
2089
+ ),
2090
+ fieldError && fieldTouched && /* @__PURE__ */ jsxRuntime.jsx(
2091
+ FieldError,
2092
+ {
2093
+ name,
2094
+ error: fieldError,
2095
+ touched: fieldTouched,
2096
+ dataTestId
2097
+ }
2098
+ )
2099
+ ]
2100
+ }
2101
+ )
2102
+ }
2103
+ ),
2104
+ child && child.map((childField, childIndex) => {
2105
+ return null;
2106
+ }),
2107
+ component && /* @__PURE__ */ jsxRuntime.jsx("div", { className: customComponentClass || "mb-1 mx-1", children: component })
2108
+ ] });
2109
+ };
2110
+ var DatePickerField = ({
2111
+ name,
2112
+ type,
2113
+ label,
2114
+ info,
2115
+ required,
2116
+ disabled,
2117
+ customClass,
2118
+ isChild,
2119
+ noIndent,
2120
+ hidden,
2121
+ dateFormat = "DD/MM/YYYY",
2122
+ dataTestId,
2123
+ component,
2124
+ formik: formikProp,
2125
+ index
2126
+ }) => {
2127
+ const { uiLibrary, formik } = useFormContext();
2128
+ const { adapter } = uiLibrary;
2129
+ const activeFormik = formikProp || formik;
2130
+ const fieldValue = getFieldValue(activeFormik, name);
2131
+ const fieldError = getFieldError(activeFormik, name);
2132
+ const fieldTouched = getFieldTouched(activeFormik, name);
2133
+ const DatePicker = adapter.DatePicker;
2134
+ const Input = adapter.Input;
2135
+ const handleDateChange = (date) => {
2136
+ let formattedDate = "";
2137
+ if (date) {
2138
+ if (typeof date === "string") {
2139
+ formattedDate = date;
2140
+ } else if (date instanceof Date) {
2141
+ const day = String(date.getDate()).padStart(2, "0");
2142
+ const month = String(date.getMonth() + 1).padStart(2, "0");
2143
+ const year = date.getFullYear();
2144
+ formattedDate = `${day}/${month}/${year}`;
2145
+ }
2146
+ }
2147
+ activeFormik.setFieldValue(name, formattedDate);
2148
+ };
2149
+ if (!DatePicker) {
2150
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2151
+ FieldWrapper,
2152
+ {
2153
+ customClass,
2154
+ isChild,
2155
+ noIndent,
2156
+ hidden,
2157
+ index,
2158
+ children: [
2159
+ label && /* @__PURE__ */ jsxRuntime.jsx(
2160
+ FieldLabel,
2161
+ {
2162
+ name,
2163
+ label,
2164
+ required,
2165
+ info
2166
+ }
2167
+ ),
2168
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-xs-12 col-md-5 col-sm-9 px-0", children: /* @__PURE__ */ jsxRuntime.jsx(
2169
+ Input,
2170
+ {
2171
+ type: "date",
2172
+ name,
2173
+ "data-testid": dataTestId || `${formatString(name)}-date-picker`,
2174
+ value: fieldValue || "",
2175
+ onChange: (event) => activeFormik.handleChange(event),
2176
+ onBlur: activeFormik.handleBlur,
2177
+ disabled: disabled || false,
2178
+ error: !!(fieldError && fieldTouched)
2179
+ }
2180
+ ) }),
2181
+ fieldError && fieldTouched && /* @__PURE__ */ jsxRuntime.jsx(
2182
+ FieldError,
2183
+ {
2184
+ name,
2185
+ error: fieldError,
2186
+ touched: fieldTouched,
2187
+ dataTestId
2188
+ }
2189
+ ),
2190
+ component && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3", children: component })
2191
+ ]
2192
+ }
2193
+ );
2194
+ }
2195
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2196
+ FieldWrapper,
2197
+ {
2198
+ customClass,
2199
+ isChild,
2200
+ noIndent,
2201
+ hidden,
2202
+ index,
2203
+ children: [
2204
+ label && /* @__PURE__ */ jsxRuntime.jsx(
2205
+ FieldLabel,
2206
+ {
2207
+ name,
2208
+ label,
2209
+ required,
2210
+ info
2211
+ }
2212
+ ),
2213
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-xs-12 col-md-5 col-sm-9 px-0", children: /* @__PURE__ */ jsxRuntime.jsx(
2214
+ DatePicker,
2215
+ {
2216
+ value: fieldValue || null,
2217
+ onChange: handleDateChange,
2218
+ format: dateFormat,
2219
+ disabled,
2220
+ "data-testid": dataTestId || `${formatString(name)}-date-picker`
2221
+ }
2222
+ ) }),
2223
+ fieldError && fieldTouched && /* @__PURE__ */ jsxRuntime.jsx(
2224
+ FieldError,
2225
+ {
2226
+ name,
2227
+ error: fieldError,
2228
+ touched: fieldTouched,
2229
+ dataTestId
2230
+ }
2231
+ ),
2232
+ component && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3", children: component })
2233
+ ]
2234
+ }
2235
+ );
2236
+ };
2237
+ var DateTimePickerField = ({
2238
+ name,
2239
+ type,
2240
+ label,
2241
+ desc,
2242
+ info,
2243
+ required,
2244
+ disabled,
2245
+ customClass,
2246
+ customComponentClass,
2247
+ isChild,
2248
+ noIndent,
2249
+ hidden,
2250
+ views,
2251
+ disablePast,
2252
+ dataTestId,
2253
+ customHandleChange,
2254
+ customFormChange,
2255
+ component,
2256
+ child,
2257
+ formik: formikProp,
2258
+ index
2259
+ }) => {
2260
+ const { uiLibrary, formik } = useFormContext();
2261
+ const { adapter } = uiLibrary;
2262
+ const FormControl = adapter.FormControl;
2263
+ const activeFormik = formikProp || formik;
2264
+ const fieldValue = getFieldValue(activeFormik, name);
2265
+ const fieldError = getFieldError(activeFormik, name);
2266
+ const fieldTouched = getFieldTouched(activeFormik, name);
2267
+ const DateTimePicker = adapter.DateTimePicker;
2268
+ const Input = adapter.Input;
2269
+ const handleDateTimeChange = (date) => {
2270
+ const event = {
2271
+ name,
2272
+ value: date
2273
+ };
2274
+ if (customHandleChange) {
2275
+ customHandleChange(event, type);
2276
+ } else if (customFormChange) {
2277
+ customFormChange(event, type);
2278
+ } else {
2279
+ activeFormik.handleChange(event);
2280
+ }
2281
+ };
2282
+ const format = Array.isArray(views) && views.length === 2 && views[0] === "day" && views[1] === "hours" ? "DD/MM/YYYY HH:mm:ss" : "DD/MM/YYYY HH:mm";
2283
+ if (!DateTimePicker) {
2284
+ return /* @__PURE__ */ jsxRuntime.jsx(
2285
+ FieldWrapper,
2286
+ {
2287
+ customClass,
2288
+ isChild,
2289
+ noIndent,
2290
+ hidden,
2291
+ index,
2292
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
2293
+ FormControl,
2294
+ {
2295
+ className: "w-100",
2296
+ required,
2297
+ error: !!(fieldTouched && fieldError),
2298
+ children: [
2299
+ label && /* @__PURE__ */ jsxRuntime.jsx(
2300
+ FieldLabel,
2301
+ {
2302
+ name,
2303
+ label,
2304
+ required,
2305
+ info
2306
+ }
2307
+ ),
2308
+ desc && /* @__PURE__ */ jsxRuntime.jsx(FieldDescription, { desc }),
2309
+ /* @__PURE__ */ jsxRuntime.jsx(
2310
+ Input,
2311
+ {
2312
+ type: "datetime-local",
2313
+ name,
2314
+ "data-testid": dataTestId || `${formatString(name)}-date-time-picker`,
2315
+ value: fieldValue || "",
2316
+ onChange: (event) => activeFormik.handleChange(event),
2317
+ onBlur: activeFormik.handleBlur,
2318
+ disabled: disabled || false,
2319
+ error: !!(fieldError && fieldTouched)
2320
+ }
2321
+ ),
2322
+ fieldError && fieldTouched && /* @__PURE__ */ jsxRuntime.jsx(
2323
+ FieldError,
2324
+ {
2325
+ name,
2326
+ error: fieldError,
2327
+ touched: fieldTouched,
2328
+ dataTestId
2329
+ }
2330
+ )
2331
+ ]
2332
+ }
2333
+ )
2334
+ }
2335
+ );
2336
+ }
2337
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2338
+ /* @__PURE__ */ jsxRuntime.jsx(
2339
+ FieldWrapper,
2340
+ {
2341
+ customClass,
2342
+ isChild,
2343
+ noIndent,
2344
+ hidden,
2345
+ index,
2346
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
2347
+ FormControl,
2348
+ {
2349
+ className: "w-100",
2350
+ required,
2351
+ error: !!(fieldTouched && fieldError),
2352
+ children: [
2353
+ label && /* @__PURE__ */ jsxRuntime.jsx(
2354
+ FieldLabel,
2355
+ {
2356
+ name,
2357
+ label,
2358
+ required,
2359
+ info
2360
+ }
2361
+ ),
2362
+ desc && /* @__PURE__ */ jsxRuntime.jsx(FieldDescription, { desc }),
2363
+ /* @__PURE__ */ jsxRuntime.jsx(
2364
+ DateTimePicker,
2365
+ {
2366
+ value: fieldValue || null,
2367
+ onChange: handleDateTimeChange,
2368
+ format,
2369
+ disabled,
2370
+ views,
2371
+ disablePast,
2372
+ "data-testid": dataTestId || `${formatString(name)}-date-time-picker`
2373
+ }
2374
+ ),
2375
+ fieldError && fieldTouched && /* @__PURE__ */ jsxRuntime.jsx(
2376
+ FieldError,
2377
+ {
2378
+ name,
2379
+ error: fieldError,
2380
+ touched: fieldTouched,
2381
+ dataTestId
2382
+ }
2383
+ )
2384
+ ]
2385
+ }
2386
+ )
2387
+ }
2388
+ ),
2389
+ child && child.map((childField, childIndex) => {
2390
+ return null;
2391
+ }),
2392
+ component && /* @__PURE__ */ jsxRuntime.jsx("div", { className: customComponentClass || "mb-1 mx-1", children: component })
2393
+ ] });
2394
+ };
2395
+ var DeleteField = ({
2396
+ name,
2397
+ type,
2398
+ handleDeleteAttribute,
2399
+ index
2400
+ }) => {
2401
+ const { uiLibrary } = useFormContext();
2402
+ const { adapter, icons } = uiLibrary;
2403
+ const IconButton = adapter.IconButton;
2404
+ const DeleteIcon = icons?.Delete;
2405
+ const handleClick = () => {
2406
+ if (handleDeleteAttribute) {
2407
+ handleDeleteAttribute(name);
2408
+ }
2409
+ };
2410
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-1", children: DeleteIcon && IconButton ? /* @__PURE__ */ jsxRuntime.jsx(
2411
+ IconButton,
2412
+ {
2413
+ role: "button",
2414
+ "data-testid": `${formatString(name)}-delete-btn`,
2415
+ onClick: handleClick,
2416
+ className: "text-danger fs-4 mt-3",
2417
+ children: /* @__PURE__ */ jsxRuntime.jsx(IconRenderer, { Icon: DeleteIcon, size: 20 })
2418
+ }
2419
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
2420
+ "button",
2421
+ {
2422
+ type: "button",
2423
+ "data-testid": `${formatString(name)}-delete-btn`,
2424
+ onClick: handleClick,
2425
+ className: "text-danger fs-4 mt-3",
2426
+ children: "\xD7"
2427
+ }
2428
+ ) }, index);
2429
+ };
2430
+ var CounterField = ({
2431
+ name,
2432
+ type,
2433
+ label,
2434
+ desc,
2435
+ info,
2436
+ required,
2437
+ customClass,
2438
+ customComponentClass,
2439
+ isChild,
2440
+ noIndent,
2441
+ hidden,
2442
+ min,
2443
+ max,
2444
+ suffix,
2445
+ dataTestId,
2446
+ customHandleChange,
2447
+ customFormChange,
2448
+ component,
2449
+ child,
2450
+ formik: formikProp,
2451
+ index
2452
+ }) => {
2453
+ const { uiLibrary, formik } = useFormContext();
2454
+ const { adapter } = uiLibrary;
2455
+ const FormControl = adapter.FormControl;
2456
+ const Button = adapter.Button;
2457
+ const Input = adapter.Input;
2458
+ const activeFormik = formikProp || formik;
2459
+ const fieldValue = getFieldValue(activeFormik, name);
2460
+ const numericValue = Number(fieldValue) || 0;
2461
+ const fieldError = getFieldError(activeFormik, name);
2462
+ const fieldTouched = getFieldTouched(activeFormik, name);
2463
+ const handleIncrement = () => {
2464
+ const newValue = max !== void 0 ? Math.min(numericValue + 1, max) : numericValue + 1;
2465
+ const event = {
2466
+ name,
2467
+ value: newValue
2468
+ };
2469
+ if (customHandleChange) {
2470
+ customHandleChange(event, type);
2471
+ } else if (customFormChange) {
2472
+ customFormChange(event, type);
2473
+ } else {
2474
+ activeFormik.handleChange(event);
2475
+ }
2476
+ };
2477
+ const handleDecrement = () => {
2478
+ const newValue = min !== void 0 ? Math.max(numericValue - 1, min) : numericValue - 1;
2479
+ const event = {
2480
+ name,
2481
+ value: newValue
2482
+ };
2483
+ if (customHandleChange) {
2484
+ customHandleChange(event, type);
2485
+ } else if (customFormChange) {
2486
+ customFormChange(event, type);
2487
+ } else {
2488
+ activeFormik.handleChange(event);
2489
+ }
2490
+ };
2491
+ const handleInputChange = (event) => {
2492
+ const value = Number(event.target.value);
2493
+ if (isNaN(value)) return;
2494
+ let newValue = value;
2495
+ if (min !== void 0 && value < min) newValue = min;
2496
+ if (max !== void 0 && value > max) newValue = max;
2497
+ const syntheticEvent = {
2498
+ target: {
2499
+ name,
2500
+ value: newValue
2501
+ }
2502
+ };
2503
+ if (customHandleChange) {
2504
+ customHandleChange(syntheticEvent, type);
2505
+ } else if (customFormChange) {
2506
+ customFormChange(syntheticEvent, type);
2507
+ } else {
2508
+ activeFormik.handleChange(syntheticEvent);
2509
+ }
2510
+ };
2511
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2512
+ /* @__PURE__ */ jsxRuntime.jsx(
2513
+ FieldWrapper,
2514
+ {
2515
+ customClass,
2516
+ isChild,
2517
+ noIndent,
2518
+ hidden,
2519
+ index,
2520
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
2521
+ FormControl,
2522
+ {
2523
+ className: "w-100",
2524
+ required,
2525
+ error: !!(fieldTouched && fieldError),
2526
+ children: [
2527
+ label && /* @__PURE__ */ jsxRuntime.jsx(
2528
+ FieldLabel,
2529
+ {
2530
+ name,
2531
+ label,
2532
+ required,
2533
+ info
2534
+ }
2535
+ ),
2536
+ desc && /* @__PURE__ */ jsxRuntime.jsx(FieldDescription, { desc }),
2537
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "d-flex align-items-center gap-2", children: [
2538
+ /* @__PURE__ */ jsxRuntime.jsx(
2539
+ Button,
2540
+ {
2541
+ type: "button",
2542
+ onClick: handleDecrement,
2543
+ disabled: min !== void 0 && numericValue <= min,
2544
+ children: "\u2212"
2545
+ }
2546
+ ),
2547
+ /* @__PURE__ */ jsxRuntime.jsx(
2548
+ Input,
2549
+ {
2550
+ type: "number",
2551
+ name,
2552
+ "data-testid": dataTestId || `${formatString(name)}-counter`,
2553
+ value: numericValue,
2554
+ onChange: handleInputChange,
2555
+ onBlur: activeFormik.handleBlur,
2556
+ min,
2557
+ max,
2558
+ className: "text-center",
2559
+ style: { width: "80px" },
2560
+ error: !!(fieldError && fieldTouched)
2561
+ }
2562
+ ),
2563
+ suffix && /* @__PURE__ */ jsxRuntime.jsx("span", { children: suffix }),
2564
+ /* @__PURE__ */ jsxRuntime.jsx(
2565
+ Button,
2566
+ {
2567
+ type: "button",
2568
+ onClick: handleIncrement,
2569
+ disabled: max !== void 0 && numericValue >= max,
2570
+ children: "+"
2571
+ }
2572
+ )
2573
+ ] }),
2574
+ fieldError && fieldTouched && /* @__PURE__ */ jsxRuntime.jsx(
2575
+ FieldError,
2576
+ {
2577
+ name,
2578
+ error: fieldError,
2579
+ touched: fieldTouched,
2580
+ dataTestId
2581
+ }
2582
+ )
2583
+ ]
2584
+ }
2585
+ )
2586
+ }
2587
+ ),
2588
+ child && child.map((childField, childIndex) => {
2589
+ return null;
2590
+ }),
2591
+ component && /* @__PURE__ */ jsxRuntime.jsx("div", { className: customComponentClass || "mb-1 mx-1", children: component })
2592
+ ] });
2593
+ };
2594
+
2595
+ // src/hooks/useTranslation.ts
2596
+ var useTranslation = () => {
2597
+ return {
2598
+ t: (key) => {
2599
+ const translations = {
2600
+ "COMMON:add": "Add",
2601
+ "COMMON:choose_attribute": "Choose Attribute",
2602
+ "COMMON:attribute_mapping.no_attributes_added": "No attributes added"
2603
+ };
2604
+ return translations[key] || key;
2605
+ }
2606
+ };
2607
+ };
2608
+ var FieldArrayField = ({
2609
+ name,
2610
+ type,
2611
+ label,
2612
+ desc,
2613
+ info,
2614
+ required,
2615
+ showOptional,
2616
+ customClass,
2617
+ customComponentClass,
2618
+ isButtonVisible = true,
2619
+ buttonLabel,
2620
+ properties,
2621
+ component,
2622
+ formik: formikProp,
2623
+ index
2624
+ }) => {
2625
+ const { uiLibrary, formik } = useFormContext();
2626
+ const { adapter, icons } = uiLibrary;
2627
+ const Input = adapter.Input;
2628
+ const Button = adapter.Button;
2629
+ const IconButton = adapter.IconButton;
2630
+ const activeFormik = formikProp || formik;
2631
+ const { t } = useTranslation();
2632
+ const fieldValue = getFieldValue(activeFormik, name);
2633
+ const arrayValue = Array.isArray(fieldValue) ? fieldValue : [];
2634
+ const AddIcon = icons?.Add;
2635
+ const DeleteIcon = icons?.Delete;
2636
+ const deleteRow = (indexToDelete) => {
2637
+ const updatedArray = arrayValue.filter((_, i) => i !== indexToDelete);
2638
+ activeFormik.setFieldValue(name, updatedArray);
2639
+ };
2640
+ const addRow = () => {
2641
+ if (properties?.isKeyValue) {
2642
+ activeFormik.setFieldValue(name, [...arrayValue, { key: "", value: "" }]);
2643
+ } else {
2644
+ activeFormik.setFieldValue(name, [...arrayValue, ""]);
2645
+ }
2646
+ };
2647
+ const isKeyValue = properties?.isKeyValue || false;
2648
+ return /* @__PURE__ */ jsxRuntime.jsxs(FieldWrapper, { customClass, index, children: [
2649
+ label && /* @__PURE__ */ jsxRuntime.jsx(
2650
+ FieldLabel,
2651
+ {
2652
+ name,
2653
+ label,
2654
+ required,
2655
+ showOptional,
2656
+ info
2657
+ }
2658
+ ),
2659
+ desc && /* @__PURE__ */ jsxRuntime.jsx(FieldDescription, { desc }),
2660
+ component && /* @__PURE__ */ jsxRuntime.jsx("div", { className: customComponentClass || "mb-2", children: component }),
2661
+ isKeyValue ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2662
+ arrayValue.map((item, itemIndex) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "d-flex mb-2 gap-2", children: [
2663
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col", children: [
2664
+ /* @__PURE__ */ jsxRuntime.jsx(
2665
+ Input,
2666
+ {
2667
+ name: `${name}[${itemIndex}].key`,
2668
+ "data-testid": formatString(name) + "-key-field",
2669
+ className: `form-control font-14 ${activeFormik.touched[name]?.[itemIndex] && activeFormik.errors[name]?.[itemIndex]?.key ? "border-danger" : ""}`,
2670
+ value: item.key || "",
2671
+ onChange: (event) => {
2672
+ const newValue = [...arrayValue];
2673
+ newValue[itemIndex] = {
2674
+ ...newValue[itemIndex],
2675
+ key: event.target.value
2676
+ };
2677
+ activeFormik.setFieldValue(name, newValue);
2678
+ },
2679
+ onBlur: activeFormik.handleBlur,
2680
+ placeholder: properties?.keyPlaceholder || "Enter key",
2681
+ autoComplete: "off"
2682
+ }
2683
+ ),
2684
+ (() => {
2685
+ const errorKey = activeFormik.errors[name]?.[itemIndex]?.key;
2686
+ const isTouched = activeFormik.touched[name]?.[itemIndex];
2687
+ return isTouched && errorKey ? /* @__PURE__ */ jsxRuntime.jsx(
2688
+ "small",
2689
+ {
2690
+ "data-testid": `${formatString(name)}-key-error`,
2691
+ className: "d-flex text-danger mt-1 text-12",
2692
+ children: String(errorKey)
2693
+ }
2694
+ ) : null;
2695
+ })()
2696
+ ] }),
2697
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col", children: [
2698
+ /* @__PURE__ */ jsxRuntime.jsx(
2699
+ Input,
2700
+ {
2701
+ name: `${name}[${itemIndex}].value`,
2702
+ "data-testid": formatString(name) + "-value-field",
2703
+ className: `form-control font-14 ${activeFormik.touched[name]?.[itemIndex] && activeFormik.errors[name]?.[itemIndex]?.value ? "border-danger" : ""}`,
2704
+ value: item.value || "",
2705
+ onChange: (event) => {
2706
+ const newValue = [...arrayValue];
2707
+ newValue[itemIndex] = {
2708
+ ...newValue[itemIndex],
2709
+ value: event.target.value
2710
+ };
2711
+ activeFormik.setFieldValue(name, newValue);
2712
+ },
2713
+ onBlur: activeFormik.handleBlur,
2714
+ placeholder: properties?.valuePlaceholder || "Enter value",
2715
+ autoComplete: "off"
2716
+ }
2717
+ ),
2718
+ (() => {
2719
+ const errorValue = activeFormik.errors[name]?.[itemIndex]?.value;
2720
+ const isTouched = activeFormik.touched[name]?.[itemIndex];
2721
+ return isTouched && errorValue ? /* @__PURE__ */ jsxRuntime.jsx(
2722
+ "small",
2723
+ {
2724
+ "data-testid": `${formatString(name)}-value-error`,
2725
+ className: "d-flex text-danger mt-1 text-12",
2726
+ children: String(errorValue)
2727
+ }
2728
+ ) : null;
2729
+ })()
2730
+ ] }),
2731
+ arrayValue.length !== 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { children: IconButton && DeleteIcon ? /* @__PURE__ */ jsxRuntime.jsx(
2732
+ IconButton,
2733
+ {
2734
+ size: "small",
2735
+ "data-testid": `${formatString(name)}-del-btn`,
2736
+ onClick: () => deleteRow(itemIndex),
2737
+ children: /* @__PURE__ */ jsxRuntime.jsx(IconRenderer, { Icon: DeleteIcon, size: 20, className: "text-danger" })
2738
+ }
2739
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
2740
+ "button",
2741
+ {
2742
+ type: "button",
2743
+ "data-testid": `${formatString(name)}-del-btn`,
2744
+ onClick: () => deleteRow(itemIndex),
2745
+ children: "\xD7"
2746
+ }
2747
+ ) })
2748
+ ] }, itemIndex)),
2749
+ isButtonVisible && /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
2750
+ Button,
2751
+ {
2752
+ variant: "text",
2753
+ className: "text-primary text-capitalize text-start",
2754
+ startIcon: AddIcon ? /* @__PURE__ */ jsxRuntime.jsx(IconRenderer, { Icon: AddIcon, size: 16 }) : "+",
2755
+ "data-testid": `${formatString(name)}-add-btn`,
2756
+ onClick: addRow,
2757
+ children: buttonLabel || t("COMMON:add")
2758
+ }
2759
+ ) })
2760
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2761
+ arrayValue.map((item, itemIndex) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "d-flex mb-2", children: [
2762
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col", children: [
2763
+ /* @__PURE__ */ jsxRuntime.jsx(
2764
+ Input,
2765
+ {
2766
+ name: `${name}[${itemIndex}]`,
2767
+ "data-testid": formatString(name) + "-field",
2768
+ className: `form-control font-14 ${activeFormik.touched[name]?.[itemIndex] && activeFormik.errors[name]?.[itemIndex] ? "border-danger" : ""}`,
2769
+ value: item,
2770
+ onChange: (event) => {
2771
+ const newValue = [...arrayValue];
2772
+ newValue[itemIndex] = event.target.value;
2773
+ activeFormik.setFieldValue(name, newValue);
2774
+ },
2775
+ onBlur: activeFormik.handleBlur,
2776
+ autoComplete: "off"
2777
+ }
2778
+ ),
2779
+ (() => {
2780
+ const error = activeFormik.errors[name]?.[itemIndex];
2781
+ const isTouched = activeFormik.touched[name]?.[itemIndex];
2782
+ return isTouched && error ? /* @__PURE__ */ jsxRuntime.jsx(
2783
+ "small",
2784
+ {
2785
+ "data-testid": `${formatString(name)}-error`,
2786
+ className: "d-flex text-danger mt-1 text-12",
2787
+ children: String(error)
2788
+ }
2789
+ ) : null;
2790
+ })()
2791
+ ] }),
2792
+ arrayValue.length !== 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { children: IconButton && DeleteIcon ? /* @__PURE__ */ jsxRuntime.jsx(
2793
+ IconButton,
2794
+ {
2795
+ size: "small",
2796
+ "data-testid": `${formatString(name)}-del-btn`,
2797
+ onClick: () => deleteRow(itemIndex),
2798
+ children: /* @__PURE__ */ jsxRuntime.jsx(IconRenderer, { Icon: DeleteIcon, size: 20, className: "text-danger" })
2799
+ }
2800
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
2801
+ "button",
2802
+ {
2803
+ type: "button",
2804
+ "data-testid": `${formatString(name)}-del-btn`,
2805
+ onClick: () => deleteRow(itemIndex),
2806
+ children: "\xD7"
2807
+ }
2808
+ ) })
2809
+ ] }, itemIndex)),
2810
+ isButtonVisible && /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
2811
+ Button,
2812
+ {
2813
+ variant: "text",
2814
+ className: "text-primary text-capitalize text-start",
2815
+ startIcon: AddIcon ? /* @__PURE__ */ jsxRuntime.jsx(IconRenderer, { Icon: AddIcon, size: 16 }) : "+",
2816
+ "data-testid": `${formatString(name)}-add-btn`,
2817
+ onClick: addRow,
2818
+ children: buttonLabel || t("COMMON:add")
2819
+ }
2820
+ ) })
2821
+ ] })
2822
+ ] });
2823
+ };
2824
+ var PROPERTY_FIELD_MAP = {
2825
+ inputfield: InputField,
2826
+ dropdown: DropdownField,
2827
+ checkbox: CheckboxField,
2828
+ radiobtn: RadioField,
2829
+ textarea: TextareaField,
2830
+ fileupload: FileUploadField,
2831
+ multiSelect: MultiSelectField,
2832
+ singleSelect: SingleSelectField,
2833
+ component: ComponentField,
2834
+ link: LinkField
2835
+ };
2836
+ var AttributeField = ({
2837
+ name,
2838
+ type,
2839
+ label,
2840
+ desc,
2841
+ required,
2842
+ customClass,
2843
+ customAttrClass,
2844
+ showIllustration = true,
2845
+ showAddNewFieldBtn = true,
2846
+ addNewFieldBtnLabel,
2847
+ properties = [],
2848
+ addNewField = {},
2849
+ component,
2850
+ formik: formikProp,
2851
+ minimumValuePresent = false,
2852
+ index,
2853
+ setFieldValuesRecursive,
2854
+ customFormChange
2855
+ }) => {
2856
+ const { uiLibrary, formik } = useFormContext();
2857
+ const { adapter, icons } = uiLibrary;
2858
+ const Button = adapter.Button;
2859
+ const IconButton = adapter.IconButton;
2860
+ const activeFormik = formikProp || formik;
2861
+ const { t } = useTranslation();
2862
+ const AddIcon = icons?.Add;
2863
+ const DeleteIcon = icons?.Delete;
2864
+ const attributeValues = getNestedValueNew(activeFormik.values, name);
2865
+ const attributeValuesAlt = getNestedProperty(activeFormik.values, name);
2866
+ const valuesArray = Array.isArray(attributeValues) ? attributeValues : Array.isArray(attributeValuesAlt) ? attributeValuesAlt : [];
2867
+ const deleteRow = (indexToDelete) => {
2868
+ const currentValues = getNestedProperty(activeFormik.values, name);
2869
+ const valuesArray2 = Array.isArray(currentValues) ? currentValues : [];
2870
+ const updatedArray = valuesArray2.filter((_, i) => i !== indexToDelete);
2871
+ activeFormik.setFieldValue(name, updatedArray);
2872
+ };
2873
+ const addNewAttribute = () => {
2874
+ const currentValues = getNestedProperty(activeFormik.values, name);
2875
+ const valuesArray2 = Array.isArray(currentValues) ? currentValues : [];
2876
+ activeFormik.setFieldValue(name, [...valuesArray2, addNewField]);
2877
+ };
2878
+ const hasNoAttributes = valuesArray.length === 0 || typeof valuesArray === "object" && Object.keys(valuesArray).length === 0;
2879
+ const renderPropertyField = (property, propIndex) => {
2880
+ const PropertyComponent = PROPERTY_FIELD_MAP[property.type];
2881
+ if (!PropertyComponent) {
2882
+ console.warn(`Unknown property type in AttributeField: ${property.type}`);
2883
+ return null;
2884
+ }
2885
+ const propertyProps = {
2886
+ ...property,
2887
+ formik: activeFormik,
2888
+ index: propIndex,
2889
+ setFieldValuesRecursive,
2890
+ customFormChange
2891
+ };
2892
+ return /* @__PURE__ */ jsxRuntime.jsx(PropertyComponent, { ...propertyProps }, propIndex);
2893
+ };
2894
+ return /* @__PURE__ */ jsxRuntime.jsxs(FieldWrapper, { customClass, index, children: [
2895
+ label && /* @__PURE__ */ jsxRuntime.jsx(
2896
+ FieldLabel,
2897
+ {
2898
+ name,
2899
+ label,
2900
+ required
2901
+ }
2902
+ ),
2903
+ desc && /* @__PURE__ */ jsxRuntime.jsx(FieldDescription, { desc }),
2904
+ component && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3", children: component }),
2905
+ showIllustration && hasNoAttributes ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "d-flex flex-column justify-content-center align-items-center gap-4 pt-4", children: [
2906
+ /* @__PURE__ */ jsxRuntime.jsx(
2907
+ "div",
2908
+ {
2909
+ "data-testid": "no-attr-img",
2910
+ style: {
2911
+ width: "200px",
2912
+ height: "200px",
2913
+ backgroundColor: "#f0f0f0",
2914
+ display: "flex",
2915
+ alignItems: "center",
2916
+ justifyContent: "center"
2917
+ },
2918
+ children: "No Image"
2919
+ }
2920
+ ),
2921
+ /* @__PURE__ */ jsxRuntime.jsx("h6", { "data-testid": "no-attr-text", className: "mb-4", children: t("COMMON:attribute_mapping.no_attributes_added") })
2922
+ ] }) : valuesArray.map((item, itemIndex) => {
2923
+ const transformedProperties = properties.map((property) => ({
2924
+ ...property,
2925
+ name: `${name}[${itemIndex}].${property.name}`,
2926
+ child: property.child?.map((childItem) => ({
2927
+ ...childItem,
2928
+ name: `${name}[${itemIndex}].${childItem.name}`
2929
+ }))
2930
+ }));
2931
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2932
+ "div",
2933
+ {
2934
+ className: customAttrClass || "d-flex flex-row gap-3 mb-3",
2935
+ children: [
2936
+ transformedProperties.map((property, propIndex) => {
2937
+ return /* @__PURE__ */ jsxRuntime.jsx(React7__default.default.Fragment, { children: renderPropertyField(property, propIndex) }, propIndex);
2938
+ }),
2939
+ (minimumValuePresent ? valuesArray.length > 1 : true) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-1 mt-4 pt-1", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: minimumValuePresent ? "mt-0" : "", children: IconButton && DeleteIcon ? /* @__PURE__ */ jsxRuntime.jsx(
2940
+ IconButton,
2941
+ {
2942
+ size: "small",
2943
+ onClick: () => deleteRow(itemIndex),
2944
+ "data-testid": `${formatString(name)}-delete-icon`,
2945
+ children: /* @__PURE__ */ jsxRuntime.jsx(IconRenderer, { Icon: DeleteIcon, size: 20, className: "text-danger" })
2946
+ }
2947
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
2948
+ "button",
2949
+ {
2950
+ type: "button",
2951
+ onClick: () => deleteRow(itemIndex),
2952
+ "data-testid": `${formatString(name)}-delete-icon`,
2953
+ children: "\xD7"
2954
+ }
2955
+ ) }) })
2956
+ ]
2957
+ },
2958
+ itemIndex
2959
+ );
2960
+ }),
2961
+ showAddNewFieldBtn && /* @__PURE__ */ jsxRuntime.jsx(
2962
+ "div",
2963
+ {
2964
+ className: valuesArray.length ? "" : `d-flex ${showIllustration ? "justify-content-center" : "justify-content-start"} align-items-center`,
2965
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2966
+ Button,
2967
+ {
2968
+ variant: "text",
2969
+ className: "text-primary text-capitalize text-start",
2970
+ startIcon: AddIcon ? /* @__PURE__ */ jsxRuntime.jsx(IconRenderer, { Icon: AddIcon, size: 16 }) : "+",
2971
+ "data-testid": "add-attr-btn",
2972
+ onClick: addNewAttribute,
2973
+ children: addNewFieldBtnLabel ?? "Add"
2974
+ }
2975
+ )
2976
+ }
2977
+ )
2978
+ ] });
2979
+ };
2980
+ var EditableDivField = ({
2981
+ name,
2982
+ type,
2983
+ label,
2984
+ placeholder,
2985
+ desc,
2986
+ info,
2987
+ required,
2988
+ readonly,
2989
+ customClass,
2990
+ isCopyEnable,
2991
+ isVisibleEnable,
2992
+ dataTestId,
2993
+ availableFields = [],
2994
+ customHandleChange,
2995
+ customFormChange,
2996
+ component,
2997
+ showCustomError,
2998
+ formik: formikProp,
2999
+ index
3000
+ }) => {
3001
+ const { uiLibrary, formik } = useFormContext();
3002
+ const { adapter, icons } = uiLibrary;
3003
+ const Box = adapter.Box;
3004
+ const Popover = adapter.Popover;
3005
+ const Paper = adapter.Paper;
3006
+ const MenuItem = adapter.MenuItem;
3007
+ const Typography = adapter.Typography;
3008
+ adapter.IconButton;
3009
+ const activeFormik = formikProp || formik;
3010
+ const { t } = useTranslation();
3011
+ const [showPlaceholder, setShowPlaceholder] = React7.useState({});
3012
+ const [anchorElEditableDiv, setAnchorElEditableDiv] = React7.useState(null);
3013
+ const [activeSpan, setActiveSpan] = React7.useState(null);
3014
+ const [prevKey, setPrevKey] = React7.useState("");
3015
+ const [isTyping, setIsTyping] = React7.useState(false);
3016
+ const editorRefEditableDiv = React7.useRef(null);
3017
+ const fieldTimeoutRef = React7.useRef(null);
3018
+ const isFieldFocusedRef = React7.useRef(false);
3019
+ getFieldValue(activeFormik, name);
3020
+ const fieldError = getFieldError(activeFormik, name);
3021
+ const fieldTouched = getFieldTouched(activeFormik, name);
3022
+ const CopyIcon = icons?.Copy;
3023
+ const VisibilityIcon = icons?.Visibility;
3024
+ const VisibilityOffIcon = icons?.VisibilityOff;
3025
+ const checkPlaceholderVisibility = React7.useCallback((content, fieldName) => {
3026
+ const isEmpty = !content || content.trim() === "" || content === "\u200B";
3027
+ setShowPlaceholder((prev) => ({
3028
+ ...prev,
3029
+ [fieldName]: isEmpty
3030
+ }));
3031
+ }, []);
3032
+ const setCursorToEnd = React7.useCallback(() => {
3033
+ if (editorRefEditableDiv.current) {
3034
+ const editor = editorRefEditableDiv.current;
3035
+ if (editor.childNodes.length > 0) {
3036
+ const range = document.createRange();
3037
+ const selection = window.getSelection();
3038
+ if (selection) {
3039
+ range.selectNodeContents(editor);
3040
+ range.collapse(false);
3041
+ selection.removeAllRanges();
3042
+ selection.addRange(range);
3043
+ }
3044
+ editor.focus();
3045
+ } else {
3046
+ editor.focus();
3047
+ }
3048
+ }
3049
+ }, []);
3050
+ const setEditorContentWithSpans = React7.useCallback((expression, fields) => {
3051
+ if (!editorRefEditableDiv.current) return;
3052
+ const editor = editorRefEditableDiv.current;
3053
+ editor.innerHTML = "";
3054
+ const parts = expression.split(/(\{\{[^}]+\}\}|\$\{[^}]+\})/);
3055
+ parts.forEach((part) => {
3056
+ let key = null;
3057
+ if (part.startsWith("{{") && part.endsWith("}}")) {
3058
+ key = part.slice(2, -2);
3059
+ }
3060
+ if (key) {
3061
+ const field = fields.find((f) => f.key === key);
3062
+ if (field) {
3063
+ const span = document.createElement("span");
3064
+ span.className = "field-span";
3065
+ span.contentEditable = "false";
3066
+ span.style.cursor = "pointer";
3067
+ span.innerText = `{{${field.key}}}`;
3068
+ editor.appendChild(span);
3069
+ } else {
3070
+ editor.appendChild(document.createTextNode(part));
3071
+ }
3072
+ } else if (part) {
3073
+ editor.appendChild(document.createTextNode(part));
3074
+ }
3075
+ });
3076
+ }, [availableFields]);
3077
+ const handleKeyDown = React7.useCallback((e) => {
3078
+ if (e.key === "{" && prevKey === "{") {
3079
+ e.preventDefault();
3080
+ return;
3081
+ }
3082
+ if (e.key === "Backspace") {
3083
+ const sel = window.getSelection();
3084
+ if (sel && sel.rangeCount > 0) {
3085
+ const range = sel.getRangeAt(0);
3086
+ const { startContainer, startOffset } = range;
3087
+ if (startContainer.nodeType === Node.TEXT_NODE && startOffset === 0 && startContainer.previousSibling && startContainer.previousSibling.classList?.contains("field-span")) {
3088
+ e.preventDefault();
3089
+ const prevSibling = startContainer.previousSibling;
3090
+ if (prevSibling.parentNode) {
3091
+ prevSibling.parentNode.removeChild(prevSibling);
3092
+ }
3093
+ return;
3094
+ }
3095
+ if (startContainer.nodeType === Node.ELEMENT_NODE && startContainer.classList?.contains("field-span")) {
3096
+ e.preventDefault();
3097
+ if (startContainer.parentNode) {
3098
+ startContainer.parentNode.removeChild(startContainer);
3099
+ }
3100
+ }
3101
+ }
3102
+ }
3103
+ }, [prevKey]);
3104
+ const handleKeyUp = React7.useCallback((e) => {
3105
+ const currentKey = e.key;
3106
+ if (currentKey === "{" && prevKey === "{" && !e.defaultPrevented) {
3107
+ const selection = window.getSelection();
3108
+ if (selection && selection.rangeCount > 0) {
3109
+ const range = selection.getRangeAt(0);
3110
+ const { startContainer, startOffset } = range;
3111
+ if (startContainer.nodeType === Node.TEXT_NODE) {
3112
+ const textContent = startContainer.textContent || "";
3113
+ const beforeCursor = textContent.substring(0, startOffset);
3114
+ if (beforeCursor.endsWith("{")) {
3115
+ if (editorRefEditableDiv.current) {
3116
+ setAnchorElEditableDiv(editorRefEditableDiv.current);
3117
+ }
3118
+ }
3119
+ }
3120
+ }
3121
+ }
3122
+ setPrevKey(currentKey);
3123
+ }, [prevKey]);
3124
+ const handleFieldSelect = React7.useCallback((item) => {
3125
+ if (!editorRefEditableDiv.current) return;
3126
+ const newSpan = document.createElement("span");
3127
+ newSpan.className = "field-span";
3128
+ newSpan.contentEditable = "false";
3129
+ newSpan.style.cursor = "pointer";
3130
+ newSpan.innerText = `{{${item.key}}}`;
3131
+ if (activeSpan) {
3132
+ activeSpan.replaceWith(newSpan);
3133
+ const spaceNode = document.createTextNode("\u200B");
3134
+ newSpan.after(spaceNode);
3135
+ if (spaceNode.parentNode) {
3136
+ const range = document.createRange();
3137
+ range.setStartAfter(spaceNode);
3138
+ range.setEndAfter(spaceNode);
3139
+ const sel = window.getSelection();
3140
+ if (sel) {
3141
+ sel.removeAllRanges();
3142
+ sel.addRange(range);
3143
+ }
3144
+ }
3145
+ setActiveSpan(null);
3146
+ } else {
3147
+ const selection = window.getSelection();
3148
+ if (selection && selection.rangeCount > 0) {
3149
+ const range = selection.getRangeAt(0);
3150
+ range.deleteContents();
3151
+ range.insertNode(newSpan);
3152
+ const spaceNode = document.createTextNode("\u200B");
3153
+ newSpan.after(spaceNode);
3154
+ const newRange = document.createRange();
3155
+ newRange.setStartAfter(spaceNode);
3156
+ newRange.setEndAfter(spaceNode);
3157
+ const sel = window.getSelection();
3158
+ if (sel) {
3159
+ sel.removeAllRanges();
3160
+ sel.addRange(newRange);
3161
+ }
3162
+ }
3163
+ }
3164
+ const content = editorRefEditableDiv.current.innerText;
3165
+ if (customHandleChange) {
3166
+ customHandleChange(
3167
+ { target: { name, value: content } },
3168
+ "editablediv"
3169
+ );
3170
+ } else if (customFormChange) {
3171
+ customFormChange(
3172
+ { target: { name, value: content } },
3173
+ "editablediv"
3174
+ );
3175
+ } else {
3176
+ activeFormik.setFieldValue(name, content);
3177
+ }
3178
+ setAnchorElEditableDiv(null);
3179
+ setTimeout(() => {
3180
+ setCursorToEnd();
3181
+ }, 0);
3182
+ }, [activeSpan, name, customHandleChange, customFormChange, activeFormik, setCursorToEnd]);
3183
+ React7.useEffect(() => {
3184
+ if (editorRefEditableDiv.current && activeFormik.values && !isTyping && availableFields.length > 0) {
3185
+ const fieldValue2 = getNestedProperty(activeFormik.values, name);
3186
+ checkPlaceholderVisibility(String(fieldValue2 || ""), name);
3187
+ setTimeout(() => {
3188
+ setEditorContentWithSpans(String(fieldValue2 || ""), availableFields);
3189
+ }, 0);
3190
+ }
3191
+ }, [activeFormik.values, name, isTyping, availableFields, checkPlaceholderVisibility, setEditorContentWithSpans]);
3192
+ React7.useEffect(() => {
3193
+ return () => {
3194
+ if (fieldTimeoutRef.current) {
3195
+ clearTimeout(fieldTimeoutRef.current);
3196
+ }
3197
+ };
3198
+ }, []);
3199
+ return /* @__PURE__ */ jsxRuntime.jsxs(FieldWrapper, { customClass, index, children: [
3200
+ label && /* @__PURE__ */ jsxRuntime.jsx(
3201
+ FieldLabel,
3202
+ {
3203
+ name,
3204
+ label,
3205
+ required,
3206
+ info
3207
+ }
3208
+ ),
3209
+ desc && /* @__PURE__ */ jsxRuntime.jsx(FieldDescription, { desc }),
3210
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `input-group ${isCopyEnable || isVisibleEnable ? "" : "rounded"}`, children: [
3211
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "d-flex w-100 flex-wrap", children: [
3212
+ /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "w-100 d-flex flex-column align-items-start position-relative", children: [
3213
+ /* @__PURE__ */ jsxRuntime.jsx(
3214
+ Box,
3215
+ {
3216
+ contentEditable: !readonly,
3217
+ ref: editorRefEditableDiv,
3218
+ id: name,
3219
+ onKeyDown: handleKeyDown,
3220
+ onKeyUp: handleKeyUp,
3221
+ onInput: (event) => {
3222
+ const content = event.target.innerText;
3223
+ setIsTyping(true);
3224
+ checkPlaceholderVisibility(content, name);
3225
+ if (fieldTimeoutRef.current) {
3226
+ clearTimeout(fieldTimeoutRef.current);
3227
+ }
3228
+ if (isFieldFocusedRef.current) {
3229
+ fieldTimeoutRef.current = setTimeout(() => {
3230
+ setIsTyping(false);
3231
+ }, 9e3);
3232
+ }
3233
+ if (customHandleChange) {
3234
+ customHandleChange(
3235
+ { target: { name, value: content } },
3236
+ type
3237
+ );
3238
+ } else if (customFormChange) {
3239
+ customFormChange(
3240
+ { target: { name, value: content } },
3241
+ type
3242
+ );
3243
+ } else {
3244
+ activeFormik.setFieldValue(name, content);
3245
+ }
3246
+ },
3247
+ onPaste: (e) => {
3248
+ e.preventDefault();
3249
+ const text = (e.clipboardData || window.clipboardData)?.getData("text/plain") || "";
3250
+ const selection = window.getSelection();
3251
+ if (selection && selection.rangeCount > 0) {
3252
+ const range = selection.getRangeAt(0);
3253
+ range.deleteContents();
3254
+ range.insertNode(document.createTextNode(text));
3255
+ range.collapse(false);
3256
+ selection.removeAllRanges();
3257
+ selection.addRange(range);
3258
+ }
3259
+ const editor = e.target;
3260
+ const content = editor.innerText;
3261
+ checkPlaceholderVisibility(content, name);
3262
+ if (availableFields.length > 0) {
3263
+ setTimeout(() => {
3264
+ setEditorContentWithSpans(content, availableFields);
3265
+ setCursorToEnd();
3266
+ }, 0);
3267
+ }
3268
+ if (customHandleChange) {
3269
+ customHandleChange(
3270
+ { target: { name, value: content } },
3271
+ type
3272
+ );
3273
+ } else if (customFormChange) {
3274
+ customFormChange(
3275
+ { target: { name, value: content } },
3276
+ type
3277
+ );
3278
+ } else {
3279
+ activeFormik.setFieldValue(name, content);
3280
+ }
3281
+ },
3282
+ onClick: (e) => {
3283
+ const target = e.target;
3284
+ if (target.classList?.contains("field-span")) {
3285
+ setActiveSpan(target);
3286
+ setAnchorElEditableDiv(target);
3287
+ setIsTyping(true);
3288
+ }
3289
+ },
3290
+ suppressContentEditableWarning: true,
3291
+ "data-testid": dataTestId || `${formatString(name)}-editable-div`,
3292
+ className: `form-control ${isCopyEnable || isVisibleEnable ? "border border-end-0" : "rounded"} ${fieldError && fieldTouched ? "border-danger" : ""}`,
3293
+ style: {
3294
+ borderRadius: "8px",
3295
+ border: "1px solid #dee2e6",
3296
+ padding: "6px 12px",
3297
+ display: "inline-block",
3298
+ flexGrow: 1,
3299
+ minHeight: "37px"
3300
+ },
3301
+ onFocus: () => {
3302
+ isFieldFocusedRef.current = true;
3303
+ setIsTyping(true);
3304
+ const content = editorRefEditableDiv.current?.innerText || "";
3305
+ checkPlaceholderVisibility(content, name);
3306
+ },
3307
+ onBlur: (event) => {
3308
+ isFieldFocusedRef.current = false;
3309
+ if (fieldTimeoutRef.current) {
3310
+ clearTimeout(fieldTimeoutRef.current);
3311
+ fieldTimeoutRef.current = null;
3312
+ }
3313
+ const content = event.target.innerText;
3314
+ checkPlaceholderVisibility(content, name);
3315
+ activeFormik.setFieldValue(name, content);
3316
+ const syntheticEvent = {
3317
+ ...event,
3318
+ target: { name, value: content }
3319
+ };
3320
+ activeFormik.handleBlur(syntheticEvent);
3321
+ },
3322
+ readOnly: readonly || false
3323
+ }
3324
+ ),
3325
+ showPlaceholder[name] && placeholder && /* @__PURE__ */ jsxRuntime.jsx(
3326
+ Box,
3327
+ {
3328
+ sx: {
3329
+ position: "absolute",
3330
+ top: "8px",
3331
+ left: "12px",
3332
+ color: "#acadaf",
3333
+ pointerEvents: "none",
3334
+ fontSize: "14px",
3335
+ zIndex: 1
3336
+ },
3337
+ children: placeholder
3338
+ }
3339
+ )
3340
+ ] }),
3341
+ /* @__PURE__ */ jsxRuntime.jsx(
3342
+ Popover,
3343
+ {
3344
+ open: Boolean(anchorElEditableDiv),
3345
+ anchorEl: anchorElEditableDiv,
3346
+ onClose: () => setAnchorElEditableDiv(null),
3347
+ anchorOrigin: { vertical: "bottom", horizontal: "left" },
3348
+ "data-testid": `${formatString(name)}-attribute-popover`,
3349
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
3350
+ Paper,
3351
+ {
3352
+ elevation: 3,
3353
+ className: "attribute-popover",
3354
+ children: [
3355
+ /* @__PURE__ */ jsxRuntime.jsx(
3356
+ Box,
3357
+ {
3358
+ style: {
3359
+ padding: "12px 16px",
3360
+ backgroundColor: "#f8f9fa",
3361
+ borderBottom: "1px solid #e0e0e0"
3362
+ },
3363
+ children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "subtitle2", color: "text.secondary", children: t("COMMON:choose_attribute") })
3364
+ }
3365
+ ),
3366
+ availableFields.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
3367
+ MenuItem,
3368
+ {
3369
+ "data-testid": `${formatString(name)}-attribute-${item.key}`,
3370
+ onClick: () => handleFieldSelect(item),
3371
+ className: "d-flex justify-content-between align-items-center",
3372
+ children: [
3373
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { children: item.label }),
3374
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { color: "text.secondary", className: "text-12", children: item.key })
3375
+ ]
3376
+ },
3377
+ item.key
3378
+ ))
3379
+ ]
3380
+ }
3381
+ )
3382
+ }
3383
+ )
3384
+ ] }),
3385
+ isVisibleEnable && VisibilityIcon && VisibilityOffIcon && /* @__PURE__ */ jsxRuntime.jsx(
3386
+ "button",
3387
+ {
3388
+ className: `z-0 btn btn-outline-secondary border-0 rounded-0 border-top border-bottom ${!isCopyEnable ? "border-end rounded-end" : ""} ${fieldError && fieldTouched ? "border-danger" : ""}`,
3389
+ type: "button",
3390
+ "data-testid": `${formatString(name)}-visible-btn`,
3391
+ onClick: () => {
3392
+ },
3393
+ children: /* @__PURE__ */ jsxRuntime.jsx(IconRenderer, { Icon: VisibilityIcon, size: 16 })
3394
+ }
3395
+ ),
3396
+ isCopyEnable && CopyIcon && /* @__PURE__ */ jsxRuntime.jsx(
3397
+ "button",
3398
+ {
3399
+ className: `z-0 btn btn-outline-secondary border border-start-0 border-end rounded-end ${fieldError && fieldTouched ? "border-danger" : ""}`,
3400
+ type: "button",
3401
+ "data-testid": `${formatString(name)}-copy-btn`,
3402
+ "aria-label": "copy",
3403
+ onClick: () => {
3404
+ if (editorRefEditableDiv.current) {
3405
+ const text = editorRefEditableDiv.current.innerText;
3406
+ navigator.clipboard.writeText(text);
3407
+ }
3408
+ },
3409
+ children: /* @__PURE__ */ jsxRuntime.jsx(IconRenderer, { Icon: CopyIcon, size: 16 })
3410
+ }
3411
+ ),
3412
+ component && /* @__PURE__ */ jsxRuntime.jsx("div", { children: component })
3413
+ ] }),
3414
+ (showCustomError || fieldError && fieldTouched) && /* @__PURE__ */ jsxRuntime.jsx(
3415
+ FieldError,
3416
+ {
3417
+ name,
3418
+ error: fieldError,
3419
+ touched: fieldTouched,
3420
+ showCustomError,
3421
+ dataTestId
3422
+ }
3423
+ )
3424
+ ] });
3425
+ };
3426
+ var FIELD_COMPONENT_MAP = {
3427
+ emptyField: EmptyField,
3428
+ text: TextField,
3429
+ link: LinkField,
3430
+ component: ComponentField,
3431
+ custom: CustomField,
3432
+ inputfield: InputField,
3433
+ textarea: TextareaField,
3434
+ checkbox: CheckboxField,
3435
+ radiobtn: RadioField,
3436
+ dropdown: DropdownField,
3437
+ toggle: ToggleField,
3438
+ fileupload: FileUploadField,
3439
+ singleSelect: SingleSelectField,
3440
+ multiSelect: MultiSelectField,
3441
+ asyncSelect: AsyncSelectField,
3442
+ datePicker: DatePickerField,
3443
+ dateTimePicker: DateTimePickerField,
3444
+ delete: DeleteField,
3445
+ counter: CounterField,
3446
+ fieldArray: FieldArrayField,
3447
+ attribute: AttributeField,
3448
+ editablediv: EditableDivField
3449
+ };
3450
+ var DynamicForm = ({
3451
+ fields,
3452
+ formik,
3453
+ firstInitialValues,
3454
+ fieldCount,
3455
+ attributeFields,
3456
+ customFormChange,
3457
+ RadiusTab = false,
3458
+ uiLibrary
3459
+ }) => {
3460
+ const [formFields, setFormFields] = React7.useState([]);
3461
+ const activeUILibrary = uiLibrary || {
3462
+ adapter: defaultAdapter,
3463
+ icons: defaultIcons,
3464
+ name: "default"
3465
+ };
3466
+ React7.useEffect(() => {
3467
+ const newFormFields = fields?.filter((item) => item !== false);
3468
+ setFormFields(newFormFields);
3469
+ }, [fields]);
3470
+ const setFieldValuesRecursive = React7.useCallback(
3471
+ (child, parentValue = null) => {
3472
+ if (!child) return;
3473
+ child.forEach((c) => {
3474
+ if (RadiusTab) {
3475
+ if (!c.hidden || parentValue === c.hiddenlabel) {
3476
+ const hasValues = "values" in c && c.values;
3477
+ const fieldValue = hasValues && typeof c.values === "object" && !Array.isArray(c.values) && Object.keys(c.values).length > 0 ? Object.keys(c.values)[0] : firstInitialValues ? getNestedProperty(firstInitialValues, c.name) : "";
3478
+ formik.setFieldValue(c.name, fieldValue);
3479
+ }
3480
+ } else {
3481
+ const value = firstInitialValues ? getNestedProperty(firstInitialValues, c.name) : void 0;
3482
+ formik.setFieldValue(c.name, value === void 0 ? "" : value);
3483
+ formik.setFieldTouched(c.name, false);
3484
+ }
3485
+ if (c.child) {
3486
+ setFieldValuesRecursive(c.child, parentValue);
3487
+ }
3488
+ });
3489
+ },
3490
+ [formik, firstInitialValues, RadiusTab]
3491
+ );
3492
+ const renderField = (field, index, isChild = false) => {
3493
+ if (!field) return null;
3494
+ if (field.shouldHide && field.shouldHide({
3495
+ formik,
3496
+ name: field.name,
3497
+ index: typeof index === "number" ? index : void 0
3498
+ })) {
3499
+ return null;
3500
+ }
3501
+ const FieldComponent = FIELD_COMPONENT_MAP[field.type];
3502
+ if (!FieldComponent) {
3503
+ console.warn(`Unknown field type: ${field.type}`);
3504
+ return null;
3505
+ }
3506
+ const fieldProps = {
3507
+ ...field,
3508
+ formik,
3509
+ index,
3510
+ isChild,
3511
+ setFieldValuesRecursive,
3512
+ customFormChange
3513
+ };
3514
+ const fieldElement = /* @__PURE__ */ jsxRuntime.jsx(FieldComponent, { ...fieldProps }, `${field.name}-${index}`);
3515
+ if (field.child && field.child.length > 0) {
3516
+ const fieldValue = getFieldValue(formik, field.name);
3517
+ const valuePath = getNestedProperty(formik.values, field.name);
3518
+ return /* @__PURE__ */ jsxRuntime.jsxs(React7__default.default.Fragment, { children: [
3519
+ fieldElement,
3520
+ field.child.map((childField, childIndex) => {
3521
+ const shouldShowChild = fieldValue === childField.hiddenlabel || valuePath === childField.hiddenlabel || field.type === "checkbox" && fieldValue || field.type === "radiobtn" && (fieldValue === childField.targetType || String(fieldValue) === String(childField.targetType)) || field.type === "attribute" && true;
3522
+ if (shouldShowChild) {
3523
+ return renderField(
3524
+ childField,
3525
+ `child-${childField.name}-${childIndex}`,
3526
+ true
3527
+ );
3528
+ }
3529
+ return null;
3530
+ })
3531
+ ] }, `${field.name}-${index}`);
3532
+ }
3533
+ return fieldElement;
3534
+ };
3535
+ const groupFormFieldsIntoRows = () => {
3536
+ if (!fieldCount) return [];
3537
+ const rows = [];
3538
+ for (let i = 0; i < fieldCount; i += 1) {
3539
+ const startIdx = i * 3;
3540
+ const endIdx = startIdx + 3;
3541
+ const rowFields = formFields.slice(startIdx, endIdx);
3542
+ rows.push(rowFields);
3543
+ }
3544
+ return rows;
3545
+ };
3546
+ if (attributeFields !== void 0) {
3547
+ return /* @__PURE__ */ jsxRuntime.jsx(FormProvider, { uiLibrary: activeUILibrary, formik, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "row", children: groupFormFieldsIntoRows().map((rowFields, rowIndex) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "row", children: rowFields.map((fieldValue, index) => {
3548
+ const uniqueKey = `${fieldValue?.label || fieldValue?.name}-${index}`;
3549
+ return /* @__PURE__ */ jsxRuntime.jsx(React7__default.default.Fragment, { children: renderField(fieldValue, uniqueKey) }, uniqueKey);
3550
+ }) }, rowIndex)) }) });
3551
+ }
3552
+ return /* @__PURE__ */ jsxRuntime.jsx(FormProvider, { uiLibrary: activeUILibrary, formik, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "row mx-0", children: formFields.map((fieldValue, index) => {
3553
+ const uniqueKey = `${fieldValue?.label || fieldValue?.name}-${index}`;
3554
+ return renderField(fieldValue, uniqueKey);
3555
+ }) }) });
3556
+ };
3557
+
3558
+ // src/icons/mui.icons.tsx
3559
+ var createMUIIcons = (Info, Visibility, VisibilityOff, Copy, Add, Delete) => {
3560
+ return {
3561
+ Info,
3562
+ Visibility,
3563
+ VisibilityOff,
3564
+ Copy,
3565
+ Add,
3566
+ Delete
3567
+ };
3568
+ };
3569
+
3570
+ // src/icons/bootstrap.icons.tsx
3571
+ var createBootstrapIcons = (Info, Visibility, VisibilityOff, Copy, Add, Delete) => {
3572
+ return {
3573
+ Info,
3574
+ Visibility,
3575
+ VisibilityOff,
3576
+ Copy,
3577
+ Add,
3578
+ Delete
3579
+ };
3580
+ };
3581
+
3582
+ // src/icons/antd.icons.tsx
3583
+ var createAntDesignIcons = (Info, Visibility, VisibilityOff, Copy, Add, Delete) => {
3584
+ return {
3585
+ Info,
3586
+ Visibility,
3587
+ VisibilityOff,
3588
+ Copy,
3589
+ Add,
3590
+ Delete
3591
+ };
3592
+ };
3593
+
3594
+ // src/utils/validation.utils.ts
3595
+ var validateEmail = (email) => {
3596
+ if (!email) return false;
3597
+ const value = email.trim().toLowerCase();
3598
+ const strictRegex = /^[a-z0-9]+([._-]?[a-z0-9]+)*@[a-z0-9]+([.-]?[a-z0-9]+)*\.[a-z]{2,}$/;
3599
+ return strictRegex.test(value);
3600
+ };
3601
+ var isValidUrl = (url) => {
3602
+ if (!url) return false;
3603
+ try {
3604
+ const urlObj = new URL(url);
3605
+ return urlObj.protocol === "http:" || urlObj.protocol === "https:";
3606
+ } catch {
3607
+ return false;
3608
+ }
3609
+ };
3610
+ var checkValidUsername = (username, minLength, maxLength) => {
3611
+ const regex = new RegExp(`^[a-zA-Z0-9-_\\.]{${minLength},${maxLength}}$`);
3612
+ return regex.test(String(username));
3613
+ };
3614
+
3615
+ exports.AsyncSelectField = AsyncSelectField;
3616
+ exports.AttributeField = AttributeField;
3617
+ exports.CheckboxField = CheckboxField;
3618
+ exports.ComponentField = ComponentField;
3619
+ exports.CounterField = CounterField;
3620
+ exports.CustomField = CustomField;
3621
+ exports.DatePickerField = DatePickerField;
3622
+ exports.DateTimePickerField = DateTimePickerField;
3623
+ exports.DeleteField = DeleteField;
3624
+ exports.DropdownField = DropdownField;
3625
+ exports.DynamicForm = DynamicForm;
3626
+ exports.EditableDivField = EditableDivField;
3627
+ exports.EmptyField = EmptyField;
3628
+ exports.FieldArrayField = FieldArrayField;
3629
+ exports.FieldDescription = FieldDescription;
3630
+ exports.FieldError = FieldError;
3631
+ exports.FieldLabel = FieldLabel;
3632
+ exports.FieldWrapper = FieldWrapper;
3633
+ exports.FileUploadField = FileUploadField;
3634
+ exports.FormProvider = FormProvider;
3635
+ exports.InputField = InputField;
3636
+ exports.LinkField = LinkField;
3637
+ exports.MultiSelectField = MultiSelectField;
3638
+ exports.RadioField = RadioField;
3639
+ exports.SingleSelectField = SingleSelectField;
3640
+ exports.TextField = TextField;
3641
+ exports.TextareaField = TextareaField;
3642
+ exports.ToggleField = ToggleField;
3643
+ exports.camelToKebabCase = camelToKebabCase;
3644
+ exports.checkValidUsername = checkValidUsername;
3645
+ exports.createAntDesignAdapter = createAntDesignAdapter;
3646
+ exports.createAntDesignIcons = createAntDesignIcons;
3647
+ exports.createBootstrapAdapter = createBootstrapAdapter;
3648
+ exports.createBootstrapIcons = createBootstrapIcons;
3649
+ exports.createMUIAdapter = createMUIAdapter;
3650
+ exports.createMUIIcons = createMUIIcons;
3651
+ exports.defaultAdapter = defaultAdapter;
3652
+ exports.defaultIcons = defaultIcons;
3653
+ exports.formatString = formatString;
3654
+ exports.getFieldError = getFieldError;
3655
+ exports.getFieldTouched = getFieldTouched;
3656
+ exports.getFieldValue = getFieldValue;
3657
+ exports.getNestedProperty = getNestedProperty;
3658
+ exports.getNestedValueNew = getNestedValueNew;
3659
+ exports.isBlank = isBlank;
3660
+ exports.isNotBlank = isNotBlank;
3661
+ exports.isValidUrl = isValidUrl;
3662
+ exports.sanitizeLabelForCSS = sanitizeLabelForCSS;
3663
+ exports.useFormContext = useFormContext;
3664
+ exports.validateEmail = validateEmail;
3665
+ //# sourceMappingURL=index.js.map
3666
+ //# sourceMappingURL=index.js.map