@rjsf/mantine 6.5.2 → 6.6.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.
Files changed (85) hide show
  1. package/dist/index.cjs +438 -440
  2. package/dist/index.cjs.map +4 -4
  3. package/dist/mantine.esm.js +418 -420
  4. package/dist/mantine.esm.js.map +4 -4
  5. package/dist/mantine.umd.js +245 -245
  6. package/lib/templates/ArrayFieldItemTemplate.js +1 -1
  7. package/lib/templates/ArrayFieldItemTemplate.js.map +1 -1
  8. package/lib/templates/ArrayFieldTemplate.js +1 -1
  9. package/lib/templates/ArrayFieldTemplate.js.map +1 -1
  10. package/lib/templates/ArrayFieldTitleTemplate.js +1 -1
  11. package/lib/templates/ArrayFieldTitleTemplate.js.map +1 -1
  12. package/lib/templates/BaseInputTemplate.js +1 -1
  13. package/lib/templates/BaseInputTemplate.js.map +1 -1
  14. package/lib/templates/ButtonTemplates/AddButton.js +1 -1
  15. package/lib/templates/ButtonTemplates/AddButton.js.map +1 -1
  16. package/lib/templates/ButtonTemplates/index.js +1 -1
  17. package/lib/templates/ButtonTemplates/index.js.map +1 -1
  18. package/lib/templates/DescriptionField.js +1 -1
  19. package/lib/templates/DescriptionField.js.map +1 -1
  20. package/lib/templates/ErrorList.js +1 -1
  21. package/lib/templates/ErrorList.js.map +1 -1
  22. package/lib/templates/FieldErrorTemplate.js +1 -1
  23. package/lib/templates/FieldErrorTemplate.js.map +1 -1
  24. package/lib/templates/FieldHelpTemplate.js +1 -1
  25. package/lib/templates/FieldHelpTemplate.js.map +1 -1
  26. package/lib/templates/TitleField.js.map +1 -1
  27. package/lib/templates/WrapIfAdditionalTemplate.js +1 -1
  28. package/lib/templates/WrapIfAdditionalTemplate.js.map +1 -1
  29. package/lib/templates/index.js +3 -3
  30. package/lib/templates/index.js.map +1 -1
  31. package/lib/tsconfig.tsbuildinfo +1 -1
  32. package/lib/widgets/CheckboxWidget.js +1 -1
  33. package/lib/widgets/CheckboxWidget.js.map +1 -1
  34. package/lib/widgets/CheckboxesWidget.js +1 -1
  35. package/lib/widgets/CheckboxesWidget.js.map +1 -1
  36. package/lib/widgets/ColorWidget.js +1 -1
  37. package/lib/widgets/ColorWidget.js.map +1 -1
  38. package/lib/widgets/DateTime/AltDateWidget.js +1 -1
  39. package/lib/widgets/DateTime/AltDateWidget.js.map +1 -1
  40. package/lib/widgets/DateTime/DateTimeInput.js +1 -1
  41. package/lib/widgets/DateTime/DateTimeInput.js.map +1 -1
  42. package/lib/widgets/DateTime/TimeWidget.js +1 -1
  43. package/lib/widgets/DateTime/TimeWidget.js.map +1 -1
  44. package/lib/widgets/FileWidget.js +3 -2
  45. package/lib/widgets/FileWidget.js.map +1 -1
  46. package/lib/widgets/PasswordWidget.js +1 -1
  47. package/lib/widgets/PasswordWidget.js.map +1 -1
  48. package/lib/widgets/RadioWidget.js +1 -1
  49. package/lib/widgets/RadioWidget.js.map +1 -1
  50. package/lib/widgets/RangeWidget.js +1 -1
  51. package/lib/widgets/RangeWidget.js.map +1 -1
  52. package/lib/widgets/SelectWidget.js +1 -1
  53. package/lib/widgets/SelectWidget.js.map +1 -1
  54. package/lib/widgets/TextareaWidget.js +1 -1
  55. package/lib/widgets/TextareaWidget.js.map +1 -1
  56. package/lib/widgets/index.js +1 -1
  57. package/lib/widgets/index.js.map +1 -1
  58. package/package.json +13 -13
  59. package/src/templates/ArrayFieldItemTemplate.tsx +1 -1
  60. package/src/templates/ArrayFieldTemplate.tsx +1 -1
  61. package/src/templates/ArrayFieldTitleTemplate.tsx +1 -1
  62. package/src/templates/BaseInputTemplate.tsx +2 -2
  63. package/src/templates/ButtonTemplates/AddButton.tsx +1 -1
  64. package/src/templates/ButtonTemplates/index.ts +2 -1
  65. package/src/templates/DescriptionField.tsx +2 -2
  66. package/src/templates/ErrorList.tsx +1 -1
  67. package/src/templates/FieldErrorTemplate.tsx +1 -1
  68. package/src/templates/FieldHelpTemplate.tsx +1 -1
  69. package/src/templates/TitleField.tsx +1 -1
  70. package/src/templates/WrapIfAdditionalTemplate.tsx +1 -1
  71. package/src/templates/index.ts +3 -3
  72. package/src/tsconfig.json +0 -1
  73. package/src/widgets/CheckboxWidget.tsx +1 -1
  74. package/src/widgets/CheckboxesWidget.tsx +1 -1
  75. package/src/widgets/ColorWidget.tsx +1 -1
  76. package/src/widgets/DateTime/AltDateWidget.tsx +1 -1
  77. package/src/widgets/DateTime/DateTimeInput.tsx +1 -1
  78. package/src/widgets/DateTime/TimeWidget.tsx +1 -1
  79. package/src/widgets/FileWidget.tsx +3 -2
  80. package/src/widgets/PasswordWidget.tsx +1 -1
  81. package/src/widgets/RadioWidget.tsx +1 -1
  82. package/src/widgets/RangeWidget.tsx +1 -1
  83. package/src/widgets/SelectWidget.tsx +1 -1
  84. package/src/widgets/TextareaWidget.tsx +1 -1
  85. package/src/widgets/index.ts +1 -1
package/dist/index.cjs CHANGED
@@ -46,8 +46,8 @@ module.exports = __toCommonJS(index_exports);
46
46
  var import_core30 = require("@rjsf/core");
47
47
 
48
48
  // src/templates/ArrayFieldItemTemplate.tsx
49
- var import_utils = require("@rjsf/utils");
50
49
  var import_core = require("@mantine/core");
50
+ var import_utils = require("@rjsf/utils");
51
51
  var import_jsx_runtime = require("react/jsx-runtime");
52
52
  function ArrayFieldItemTemplate(props) {
53
53
  const { buttonsProps, className, hasToolbar, index, uiSchema, registry, children } = props;
@@ -64,8 +64,8 @@ function ArrayFieldItemTemplate(props) {
64
64
  }
65
65
 
66
66
  // src/templates/ArrayFieldTemplate.tsx
67
- var import_utils2 = require("@rjsf/utils");
68
67
  var import_core2 = require("@mantine/core");
68
+ var import_utils2 = require("@rjsf/utils");
69
69
  var import_jsx_runtime2 = require("react/jsx-runtime");
70
70
  function ArrayFieldTemplate(props) {
71
71
  const {
@@ -141,8 +141,8 @@ function ArrayFieldTemplate(props) {
141
141
  }
142
142
 
143
143
  // src/templates/ArrayFieldTitleTemplate.tsx
144
- var import_utils3 = require("@rjsf/utils");
145
144
  var import_core3 = require("@mantine/core");
145
+ var import_utils3 = require("@rjsf/utils");
146
146
  var import_jsx_runtime3 = require("react/jsx-runtime");
147
147
  function ArrayFieldTitleTemplate(props) {
148
148
  const { fieldPathId, title, uiSchema, registry, optionalDataControl } = props;
@@ -163,9 +163,9 @@ function ArrayFieldTitleTemplate(props) {
163
163
 
164
164
  // src/templates/BaseInputTemplate.tsx
165
165
  var import_react = require("react");
166
- var import_utils4 = require("@rjsf/utils");
167
166
  var import_core4 = require("@mantine/core");
168
167
  var import_core5 = require("@rjsf/core");
168
+ var import_utils4 = require("@rjsf/utils");
169
169
 
170
170
  // src/utils.ts
171
171
  var uiOptionsKeys = [
@@ -313,26 +313,13 @@ function BaseInputTemplate(props) {
313
313
  ] });
314
314
  }
315
315
 
316
- // src/templates/DescriptionField.tsx
317
- var import_core6 = require("@rjsf/core");
318
- var import_core7 = require("@mantine/core");
319
- var import_jsx_runtime5 = require("react/jsx-runtime");
320
- function DescriptionField(props) {
321
- const { id, description, registry, uiSchema } = props;
322
- if (description) {
323
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_core7.Text, { id, mt: 3, mb: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_core6.RichDescription, { description, registry, uiSchema }) });
324
- }
325
- return null;
326
- }
327
-
328
- // src/templates/ErrorList.tsx
329
- var import_utils6 = require("@rjsf/utils");
330
- var import_core8 = require("@mantine/core");
316
+ // src/templates/ButtonTemplates/AddButton.tsx
317
+ var import_utils7 = require("@rjsf/utils");
331
318
 
332
319
  // src/templates/icons.tsx
333
- var import_jsx_runtime6 = require("react/jsx-runtime");
320
+ var import_jsx_runtime5 = require("react/jsx-runtime");
334
321
  function Plus({ size, style, ...others }) {
335
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
322
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
336
323
  "svg",
337
324
  {
338
325
  xmlns: "http://www.w3.org/2000/svg",
@@ -348,15 +335,15 @@ function Plus({ size, style, ...others }) {
348
335
  style: { width: size, height: size, ...style },
349
336
  ...others,
350
337
  children: [
351
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
352
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 5l0 14" }),
353
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M5 12l14 0" })
338
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
339
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M12 5l0 14" }),
340
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M5 12l14 0" })
354
341
  ]
355
342
  }
356
343
  );
357
344
  }
358
345
  function Copy({ size, style, ...others }) {
359
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
346
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
360
347
  "svg",
361
348
  {
362
349
  xmlns: "http://www.w3.org/2000/svg",
@@ -372,15 +359,15 @@ function Copy({ size, style, ...others }) {
372
359
  style: { width: size, height: size, ...style },
373
360
  ...others,
374
361
  children: [
375
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
376
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z" }),
377
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1" })
362
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
363
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z" }),
364
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1" })
378
365
  ]
379
366
  }
380
367
  );
381
368
  }
382
369
  function ChevronDown({ size, style, ...others }) {
383
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
370
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
384
371
  "svg",
385
372
  {
386
373
  xmlns: "http://www.w3.org/2000/svg",
@@ -396,14 +383,14 @@ function ChevronDown({ size, style, ...others }) {
396
383
  style: { width: size, height: size, ...style },
397
384
  ...others,
398
385
  children: [
399
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
400
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M6 9l6 6l6 -6" })
386
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
387
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M6 9l6 6l6 -6" })
401
388
  ]
402
389
  }
403
390
  );
404
391
  }
405
392
  function ChevronUp({ size, style, ...others }) {
406
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
393
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
407
394
  "svg",
408
395
  {
409
396
  xmlns: "http://www.w3.org/2000/svg",
@@ -419,14 +406,14 @@ function ChevronUp({ size, style, ...others }) {
419
406
  style: { width: size, height: size, ...style },
420
407
  ...others,
421
408
  children: [
422
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
423
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M6 15l6 -6l6 6" })
409
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
410
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M6 15l6 -6l6 6" })
424
411
  ]
425
412
  }
426
413
  );
427
414
  }
428
415
  function X({ size, style, ...others }) {
429
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
416
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
430
417
  "svg",
431
418
  {
432
419
  xmlns: "http://www.w3.org/2000/svg",
@@ -442,15 +429,15 @@ function X({ size, style, ...others }) {
442
429
  style: { width: size, height: size, ...style },
443
430
  ...others,
444
431
  children: [
445
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
446
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M18 6l-12 12" }),
447
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M6 6l12 12" })
432
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
433
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M18 6l-12 12" }),
434
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M6 6l12 12" })
448
435
  ]
449
436
  }
450
437
  );
451
438
  }
452
439
  function ExclamationCircle({ size, style, ...others }) {
453
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
440
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
454
441
  "svg",
455
442
  {
456
443
  xmlns: "http://www.w3.org/2000/svg",
@@ -466,56 +453,22 @@ function ExclamationCircle({ size, style, ...others }) {
466
453
  style: { width: size, height: size, ...style },
467
454
  ...others,
468
455
  children: [
469
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" }),
470
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 9v4" }),
471
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 16v.01" })
456
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" }),
457
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M12 9v4" }),
458
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M12 16v.01" })
472
459
  ]
473
460
  }
474
461
  );
475
462
  }
476
463
 
477
- // src/templates/ErrorList.tsx
478
- var import_jsx_runtime7 = require("react/jsx-runtime");
479
- function ErrorList({
480
- errors,
481
- registry
482
- }) {
483
- const { translateString } = registry;
484
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
485
- import_core8.Alert,
486
- {
487
- color: "red",
488
- variant: "transparent",
489
- title: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_core8.Title, { order: 5, fw: "normal", children: translateString(import_utils6.TranslatableString.ErrorsLabel) }),
490
- icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ExclamationCircle, {}),
491
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_core8.List, { children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_core8.List.Item, { c: "red", children: error.stack }, `error-${index}`)) })
492
- }
493
- );
494
- }
495
-
496
- // src/templates/ButtonTemplates/SubmitButton.tsx
497
- var import_core9 = require("@mantine/core");
498
- var import_utils7 = require("@rjsf/utils");
499
- var import_jsx_runtime8 = require("react/jsx-runtime");
500
- function SubmitButton({ uiSchema }) {
501
- const { submitText, norender, props: submitButtonProps = {} } = (0, import_utils7.getSubmitButtonOptions)(uiSchema);
502
- if (norender) {
503
- return null;
504
- }
505
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core9.Button, { type: "submit", variant: "filled", ...submitButtonProps, children: submitText });
506
- }
507
-
508
- // src/templates/ButtonTemplates/AddButton.tsx
509
- var import_utils9 = require("@rjsf/utils");
510
-
511
464
  // src/templates/ButtonTemplates/IconButton.tsx
512
- var import_core10 = require("@mantine/core");
513
- var import_utils8 = require("@rjsf/utils");
514
- var import_jsx_runtime9 = require("react/jsx-runtime");
465
+ var import_core6 = require("@mantine/core");
466
+ var import_utils6 = require("@rjsf/utils");
467
+ var import_jsx_runtime6 = require("react/jsx-runtime");
515
468
  function IconButton(props) {
516
469
  const { icon, iconType = "sm", color, onClick, uiSchema, registry, ...otherProps } = props;
517
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
518
- import_core10.ActionIcon,
470
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
471
+ import_core6.ActionIcon,
519
472
  {
520
473
  size: iconType,
521
474
  color,
@@ -529,19 +482,19 @@ function CopyButton(props) {
529
482
  const {
530
483
  registry: { translateString }
531
484
  } = props;
532
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconButton, { title: translateString(import_utils8.TranslatableString.CopyButton), variant: "subtle", ...props, icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Copy, {}) });
485
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IconButton, { title: translateString(import_utils6.TranslatableString.CopyButton), variant: "subtle", ...props, icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Copy, {}) });
533
486
  }
534
487
  function MoveDownButton(props) {
535
488
  const {
536
489
  registry: { translateString }
537
490
  } = props;
538
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
491
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
539
492
  IconButton,
540
493
  {
541
- title: translateString(import_utils8.TranslatableString.MoveDownButton),
494
+ title: translateString(import_utils6.TranslatableString.MoveDownButton),
542
495
  variant: "subtle",
543
496
  ...props,
544
- icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ChevronDown, {})
497
+ icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ChevronDown, {})
545
498
  }
546
499
  );
547
500
  }
@@ -549,13 +502,13 @@ function MoveUpButton(props) {
549
502
  const {
550
503
  registry: { translateString }
551
504
  } = props;
552
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
505
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
553
506
  IconButton,
554
507
  {
555
- title: translateString(import_utils8.TranslatableString.MoveUpButton),
508
+ title: translateString(import_utils6.TranslatableString.MoveUpButton),
556
509
  variant: "subtle",
557
510
  ...props,
558
- icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ChevronUp, {})
511
+ icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ChevronUp, {})
559
512
  }
560
513
  );
561
514
  }
@@ -563,14 +516,14 @@ function RemoveButton(props) {
563
516
  const {
564
517
  registry: { translateString }
565
518
  } = props;
566
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
519
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
567
520
  IconButton,
568
521
  {
569
- title: translateString(import_utils8.TranslatableString.RemoveButton),
522
+ title: translateString(import_utils6.TranslatableString.RemoveButton),
570
523
  variant: "subtle",
571
524
  color: "red",
572
525
  ...props,
573
- icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(X, {})
526
+ icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(X, {})
574
527
  }
575
528
  );
576
529
  }
@@ -578,16 +531,28 @@ function ClearButton(props) {
578
531
  const {
579
532
  registry: { translateString }
580
533
  } = props;
581
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconButton, { title: translateString(import_utils8.TranslatableString.ClearButton), variant: "subtle", ...props, icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(X, {}) });
534
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IconButton, { title: translateString(import_utils6.TranslatableString.ClearButton), variant: "subtle", ...props, icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(X, {}) });
582
535
  }
583
536
 
584
537
  // src/templates/ButtonTemplates/AddButton.tsx
585
- var import_jsx_runtime10 = require("react/jsx-runtime");
538
+ var import_jsx_runtime7 = require("react/jsx-runtime");
586
539
  function AddButton(props) {
587
540
  const {
588
541
  registry: { translateString }
589
542
  } = props;
590
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(IconButton, { title: translateString(import_utils9.TranslatableString.AddItemButton), variant: "subtle", ...props, icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Plus, {}) });
543
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconButton, { title: translateString(import_utils7.TranslatableString.AddItemButton), variant: "subtle", ...props, icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Plus, {}) });
544
+ }
545
+
546
+ // src/templates/ButtonTemplates/SubmitButton.tsx
547
+ var import_core7 = require("@mantine/core");
548
+ var import_utils8 = require("@rjsf/utils");
549
+ var import_jsx_runtime8 = require("react/jsx-runtime");
550
+ function SubmitButton({ uiSchema }) {
551
+ const { submitText, norender, props: submitButtonProps = {} } = (0, import_utils8.getSubmitButtonOptions)(uiSchema);
552
+ if (norender) {
553
+ return null;
554
+ }
555
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core7.Button, { type: "submit", variant: "filled", ...submitButtonProps, children: submitText });
591
556
  }
592
557
 
593
558
  // src/templates/ButtonTemplates/index.ts
@@ -604,9 +569,42 @@ function buttonTemplates() {
604
569
  }
605
570
  var ButtonTemplates_default = buttonTemplates;
606
571
 
572
+ // src/templates/DescriptionField.tsx
573
+ var import_core8 = require("@mantine/core");
574
+ var import_core9 = require("@rjsf/core");
575
+ var import_jsx_runtime9 = require("react/jsx-runtime");
576
+ function DescriptionField(props) {
577
+ const { id, description, registry, uiSchema } = props;
578
+ if (description) {
579
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Text, { id, mt: 3, mb: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core9.RichDescription, { description, registry, uiSchema }) });
580
+ }
581
+ return null;
582
+ }
583
+
584
+ // src/templates/ErrorList.tsx
585
+ var import_core10 = require("@mantine/core");
586
+ var import_utils9 = require("@rjsf/utils");
587
+ var import_jsx_runtime10 = require("react/jsx-runtime");
588
+ function ErrorList({
589
+ errors,
590
+ registry
591
+ }) {
592
+ const { translateString } = registry;
593
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
594
+ import_core10.Alert,
595
+ {
596
+ color: "red",
597
+ variant: "transparent",
598
+ title: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core10.Title, { order: 5, fw: "normal", children: translateString(import_utils9.TranslatableString.ErrorsLabel) }),
599
+ icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ExclamationCircle, {}),
600
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core10.List, { children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core10.List.Item, { c: "red", children: error.stack }, `error-${index}`)) })
601
+ }
602
+ );
603
+ }
604
+
607
605
  // src/templates/FieldErrorTemplate.tsx
608
- var import_utils10 = require("@rjsf/utils");
609
606
  var import_core11 = require("@mantine/core");
607
+ var import_utils10 = require("@rjsf/utils");
610
608
  var import_jsx_runtime11 = require("react/jsx-runtime");
611
609
  function FieldErrorTemplate({ errors, fieldPathId }) {
612
610
  if (!errors || !errors.length) {
@@ -616,10 +614,23 @@ function FieldErrorTemplate({ errors, fieldPathId }) {
616
614
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core11.Box, { id, c: "red", display: "none", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core11.List, { children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core11.List.Item, { children: error }, `field-error-${index}`)) }) });
617
615
  }
618
616
 
619
- // src/templates/FieldTemplate.tsx
617
+ // src/templates/FieldHelpTemplate.tsx
620
618
  var import_core12 = require("@mantine/core");
619
+ var import_core13 = require("@rjsf/core");
621
620
  var import_utils11 = require("@rjsf/utils");
622
621
  var import_jsx_runtime12 = require("react/jsx-runtime");
622
+ function FieldHelpTemplate(props) {
623
+ const { fieldPathId, help, uiSchema, registry } = props;
624
+ if (!help) {
625
+ return null;
626
+ }
627
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core12.Text, { id: (0, import_utils11.helpId)(fieldPathId), size: "sm", my: "xs", c: "dimmed", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core13.RichHelp, { help, registry, uiSchema }) });
628
+ }
629
+
630
+ // src/templates/FieldTemplate.tsx
631
+ var import_core14 = require("@mantine/core");
632
+ var import_utils12 = require("@rjsf/utils");
633
+ var import_jsx_runtime13 = require("react/jsx-runtime");
623
634
  function FieldTemplate(props) {
624
635
  const {
625
636
  id,
@@ -638,16 +649,16 @@ function FieldTemplate(props) {
638
649
  children,
639
650
  ...otherProps
640
651
  } = props;
641
- const uiOptions = (0, import_utils11.getUiOptions)(uiSchema);
642
- const WrapIfAdditionalTemplate2 = (0, import_utils11.getTemplate)(
652
+ const uiOptions = (0, import_utils12.getUiOptions)(uiSchema);
653
+ const WrapIfAdditionalTemplate2 = (0, import_utils12.getTemplate)(
643
654
  "WrapIfAdditionalTemplate",
644
655
  registry,
645
656
  uiOptions
646
657
  );
647
658
  if (hidden) {
648
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core12.Box, { display: "none", children });
659
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core14.Box, { display: "none", children });
649
660
  }
650
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
661
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
651
662
  WrapIfAdditionalTemplate2,
652
663
  {
653
664
  id,
@@ -669,19 +680,6 @@ function FieldTemplate(props) {
669
680
  );
670
681
  }
671
682
 
672
- // src/templates/FieldHelpTemplate.tsx
673
- var import_utils12 = require("@rjsf/utils");
674
- var import_core13 = require("@mantine/core");
675
- var import_core14 = require("@rjsf/core");
676
- var import_jsx_runtime13 = require("react/jsx-runtime");
677
- function FieldHelpTemplate(props) {
678
- const { fieldPathId, help, uiSchema, registry } = props;
679
- if (!help) {
680
- return null;
681
- }
682
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core13.Text, { id: (0, import_utils12.helpId)(fieldPathId), size: "sm", my: "xs", c: "dimmed", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core14.RichHelp, { help, registry, uiSchema }) });
683
- }
684
-
685
683
  // src/templates/GridTemplate.tsx
686
684
  var import_core15 = require("@mantine/core");
687
685
  var import_jsx_runtime14 = require("react/jsx-runtime");
@@ -696,10 +694,20 @@ function GridTemplate(props) {
696
694
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_core15.Grid, { grow: true, ...rest, children });
697
695
  }
698
696
 
699
- // src/templates/ObjectFieldTemplate.tsx
697
+ // src/templates/MultiSchemaFieldTemplate.tsx
700
698
  var import_core16 = require("@mantine/core");
701
- var import_utils13 = require("@rjsf/utils");
702
699
  var import_jsx_runtime15 = require("react/jsx-runtime");
700
+ function MultiSchemaFieldTemplate({ selector, optionSchemaField }) {
701
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_core16.Stack, { style: { marginBottom: "1rem" }, children: [
702
+ selector,
703
+ optionSchemaField
704
+ ] });
705
+ }
706
+
707
+ // src/templates/ObjectFieldTemplate.tsx
708
+ var import_core17 = require("@mantine/core");
709
+ var import_utils13 = require("@rjsf/utils");
710
+ var import_jsx_runtime16 = require("react/jsx-runtime");
703
711
  function ObjectFieldTemplate(props) {
704
712
  const {
705
713
  title,
@@ -730,8 +738,8 @@ function ObjectFieldTemplate(props) {
730
738
  const gridCols = typeof uiOptions?.gridCols === "number" && uiOptions?.gridCols || void 0;
731
739
  const gridSpacing = uiOptions?.gridSpacing;
732
740
  const gridVerticalSpacing = uiOptions?.gridVerticalSpacing;
733
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_core16.Container, { id: fieldPathId.$id, p: 0, children: [
734
- title && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
741
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_core17.Container, { id: fieldPathId.$id, p: 0, children: [
742
+ title && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
735
743
  TitleFieldTemplate,
736
744
  {
737
745
  id: (0, import_utils13.titleId)(fieldPathId),
@@ -743,7 +751,7 @@ function ObjectFieldTemplate(props) {
743
751
  optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
744
752
  }
745
753
  ),
746
- description && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
754
+ description && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
747
755
  DescriptionFieldTemplate,
748
756
  {
749
757
  id: (0, import_utils13.descriptionId)(fieldPathId),
@@ -753,8 +761,8 @@ function ObjectFieldTemplate(props) {
753
761
  registry
754
762
  }
755
763
  ),
756
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
757
- import_core16.SimpleGrid,
764
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
765
+ import_core17.SimpleGrid,
758
766
  {
759
767
  cols: gridCols,
760
768
  spacing: gridSpacing,
@@ -762,11 +770,11 @@ function ObjectFieldTemplate(props) {
762
770
  mb: "sm",
763
771
  children: [
764
772
  !showOptionalDataControlInTitle ? optionalDataControl : void 0,
765
- properties.filter((e) => !e.hidden).map((element) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core16.Box, { children: element.content }, element.name))
773
+ properties.filter((e) => !e.hidden).map((element) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core17.Box, { children: element.content }, element.name))
766
774
  ]
767
775
  }
768
776
  ),
769
- (0, import_utils13.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core16.Group, { mt: "xs", justify: "flex-end", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
777
+ (0, import_utils13.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core17.Group, { mt: "xs", justify: "flex-end", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
770
778
  AddButton2,
771
779
  {
772
780
  id: (0, import_utils13.buttonId)(fieldPathId, "add"),
@@ -781,11 +789,11 @@ function ObjectFieldTemplate(props) {
781
789
  }
782
790
 
783
791
  // src/templates/OptionalDataControlsTemplate.tsx
784
- var import_jsx_runtime16 = require("react/jsx-runtime");
792
+ var import_jsx_runtime17 = require("react/jsx-runtime");
785
793
  function OptionalDataControlsTemplate(props) {
786
794
  const { id, registry, label, onAddClick, onRemoveClick } = props;
787
795
  if (onAddClick) {
788
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
796
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
789
797
  AddButton,
790
798
  {
791
799
  id,
@@ -797,7 +805,7 @@ function OptionalDataControlsTemplate(props) {
797
805
  }
798
806
  );
799
807
  } else if (onRemoveClick) {
800
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
808
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
801
809
  RemoveButton,
802
810
  {
803
811
  id,
@@ -809,28 +817,28 @@ function OptionalDataControlsTemplate(props) {
809
817
  }
810
818
  );
811
819
  }
812
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("em", { id, children: label });
820
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("em", { id, children: label });
813
821
  }
814
822
 
815
823
  // src/templates/TitleField.tsx
816
- var import_core17 = require("@mantine/core");
817
- var import_jsx_runtime17 = require("react/jsx-runtime");
824
+ var import_core18 = require("@mantine/core");
825
+ var import_jsx_runtime18 = require("react/jsx-runtime");
818
826
  function TitleField(props) {
819
827
  const { id, title, optionalDataControl } = props;
820
- let heading = title ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core17.Title, { id, order: 3, fw: "normal", children: title }) : null;
828
+ let heading = title ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core18.Title, { id, order: 3, fw: "normal", children: title }) : null;
821
829
  if (optionalDataControl) {
822
- heading = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core17.Grid, { children: [
823
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core17.Grid.Col, { span: "auto", children: heading }),
824
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core17.Grid.Col, { span: "content", children: optionalDataControl })
830
+ heading = /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_core18.Grid, { children: [
831
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core18.Grid.Col, { span: "auto", children: heading }),
832
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core18.Grid.Col, { span: "content", children: optionalDataControl })
825
833
  ] });
826
834
  }
827
835
  return heading;
828
836
  }
829
837
 
830
838
  // src/templates/WrapIfAdditionalTemplate.tsx
839
+ var import_core19 = require("@mantine/core");
831
840
  var import_utils14 = require("@rjsf/utils");
832
- var import_core18 = require("@mantine/core");
833
- var import_jsx_runtime18 = require("react/jsx-runtime");
841
+ var import_jsx_runtime19 = require("react/jsx-runtime");
834
842
  function WrapIfAdditionalTemplate(props) {
835
843
  const {
836
844
  id,
@@ -854,17 +862,17 @@ function WrapIfAdditionalTemplate(props) {
854
862
  const keyLabel = translateString(import_utils14.TranslatableString.KeyLabel, [label]);
855
863
  const additional = import_utils14.ADDITIONAL_PROPERTY_FLAG in schema;
856
864
  if (!additional) {
857
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: classNames, style, children });
865
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: classNames, style, children });
858
866
  }
859
867
  const uiOptions = uiSchema ? uiSchema[import_utils14.UI_OPTIONS_KEY] : {};
860
868
  const buttonUiOptions = {
861
869
  ...uiSchema,
862
870
  [import_utils14.UI_OPTIONS_KEY]: { ...uiOptions, block: true }
863
871
  };
864
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: classNames, style, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_core18.Flex, { gap: "xs", align: "end", justify: "center", children: [
865
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_core18.Grid, { w: "100%", align: "center", children: [
866
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core18.Grid.Col, { span: 6, className: "form-additional", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
867
- import_core18.TextInput,
872
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: classNames, style, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_core19.Flex, { gap: "xs", align: "end", justify: "center", children: [
873
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_core19.Grid, { w: "100%", align: "center", children: [
874
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core19.Grid.Col, { span: 6, className: "form-additional", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
875
+ import_core19.TextInput,
868
876
  {
869
877
  className: "form-group",
870
878
  label: displayLabel ? keyLabel : void 0,
@@ -878,9 +886,9 @@ function WrapIfAdditionalTemplate(props) {
878
886
  },
879
887
  label
880
888
  ) }),
881
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core18.Grid.Col, { span: 6, className: "form-additional", children })
889
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core19.Grid.Col, { span: 6, className: "form-additional", children })
882
890
  ] }),
883
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
891
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
884
892
  RemoveButton2,
885
893
  {
886
894
  id: (0, import_utils14.buttonId)(id, "remove"),
@@ -895,16 +903,6 @@ function WrapIfAdditionalTemplate(props) {
895
903
  ] }) });
896
904
  }
897
905
 
898
- // src/templates/MultiSchemaFieldTemplate.tsx
899
- var import_core19 = require("@mantine/core");
900
- var import_jsx_runtime19 = require("react/jsx-runtime");
901
- function MultiSchemaFieldTemplate({ selector, optionSchemaField }) {
902
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_core19.Stack, { style: { marginBottom: "1rem" }, children: [
903
- selector,
904
- optionSchemaField
905
- ] });
906
- }
907
-
908
906
  // src/templates/index.ts
909
907
  function generateTemplates() {
910
908
  return {
@@ -932,77 +930,16 @@ var templates_default = generateTemplates();
932
930
  var import_dayjs2 = __toESM(require("dayjs"), 1);
933
931
  var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat"), 1);
934
932
 
935
- // src/widgets/DateTime/AltDateTimeWidget.tsx
936
- var import_jsx_runtime20 = require("react/jsx-runtime");
937
- function AltDateTimeWidget(props) {
938
- const { AltDateWidget: AltDateWidget2 } = props.registry.widgets;
939
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AltDateWidget2, { time: true, ...props });
940
- }
941
-
942
- // src/widgets/DateTime/AltDateWidget.tsx
943
- var import_utils15 = require("@rjsf/utils");
944
- var import_core20 = require("@mantine/core");
945
- var import_jsx_runtime21 = require("react/jsx-runtime");
946
- function AltDateWidget(props) {
947
- const { id, required, disabled, readonly, label, hideLabel, rawErrors, options, registry } = props;
948
- const { translateString } = registry;
949
- const { elements, handleChange, handleClear, handleSetNow } = (0, import_utils15.useAltDateWidgetProps)(props);
950
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
951
- !hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_core20.Input.Label, { id: (0, import_utils15.titleId)(id), required, children: label }),
952
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_core20.Flex, { gap: "xs", align: "center", wrap: "nowrap", children: [
953
- elements.map((elemProps, i) => {
954
- const elemId = `${id}_${elemProps.type}`;
955
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_core20.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
956
- import_core20.Select,
957
- {
958
- id: elemId,
959
- name: elemId,
960
- placeholder: elemProps.type,
961
- disabled: disabled || readonly,
962
- data: (0, import_utils15.dateRangeOptions)(elemProps.range[0], elemProps.range[1]).map((item) => item.value.toString()),
963
- value: !elemProps.value || elemProps.value < 0 ? null : elemProps.value.toString(),
964
- onChange: (v) => handleChange(elemProps.type, v || void 0),
965
- searchable: false,
966
- allowDeselect: false,
967
- comboboxProps: { withinPortal: false },
968
- "aria-describedby": (0, import_utils15.ariaDescribedByIds)(elemId)
969
- }
970
- ) }, i);
971
- }),
972
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_core20.Group, { wrap: "nowrap", gap: 3, children: [
973
- (options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_core20.Button, { variant: "subtle", size: "xs", onClick: handleSetNow, children: translateString(import_utils15.TranslatableString.NowLabel) }),
974
- (options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_core20.Button, { variant: "subtle", size: "xs", onClick: handleClear, children: translateString(import_utils15.TranslatableString.ClearLabel) })
975
- ] })
976
- ] }),
977
- rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_core20.Input.Error, { children: error }, `alt-date-widget-input-errors-${index}`))
978
- ] });
979
- }
980
-
981
- // src/widgets/DateTime/DateTimeInput.tsx
933
+ // src/widgets/CheckboxesWidget.tsx
982
934
  var import_react2 = require("react");
983
- var import_utils16 = require("@rjsf/utils");
984
- var import_dayjs = __toESM(require("dayjs"), 1);
985
- var import_dates = require("@mantine/dates");
986
- var import_jsx_runtime22 = require("react/jsx-runtime");
987
- var dateParser = (input, format) => {
988
- if (!input) {
989
- return null;
990
- }
991
- const d = (0, import_dayjs.default)(input, format);
992
- return d.isValid() ? d.toDate() : null;
993
- };
994
- var dateFormat = (date, format) => {
995
- if (!date) {
996
- return "";
997
- }
998
- return (0, import_dayjs.default)(date).format(format || "YYYY-MM-DD");
999
- };
1000
- function DateTimeInput(props) {
935
+ var import_core20 = require("@mantine/core");
936
+ var import_utils15 = require("@rjsf/utils");
937
+ var import_jsx_runtime20 = require("react/jsx-runtime");
938
+ function CheckboxesWidget(props) {
1001
939
  const {
1002
940
  id,
1003
- name,
941
+ htmlName,
1004
942
  value,
1005
- placeholder,
1006
943
  required,
1007
944
  disabled,
1008
945
  readonly,
@@ -1013,203 +950,40 @@ function DateTimeInput(props) {
1013
950
  options,
1014
951
  onChange,
1015
952
  onBlur,
1016
- onFocus,
1017
- valueFormat,
1018
- displayFormat
953
+ onFocus
1019
954
  } = props;
955
+ const { enumOptions, enumDisabled, inline, emptyValue } = options;
956
+ const optionValueFormat = (0, import_utils15.getOptionValueFormat)(options);
957
+ const themeProps = cleanupOptions(options);
1020
958
  const handleChange = (0, import_react2.useCallback)(
1021
959
  (nextValue) => {
1022
- onChange(dateFormat(nextValue, valueFormat));
960
+ if (!disabled && !readonly && onChange) {
961
+ onChange((0, import_utils15.enumOptionValueDecoder)(nextValue, enumOptions, optionValueFormat, emptyValue));
962
+ }
1023
963
  },
1024
- [onChange, valueFormat]
964
+ [onChange, disabled, readonly, enumOptions, emptyValue, optionValueFormat]
1025
965
  );
1026
- const handleBlur = (0, import_react2.useCallback)(() => {
1027
- if (onBlur) {
1028
- onBlur(id, value);
1029
- }
1030
- }, [onBlur, id, value]);
1031
- const handleFocus = (0, import_react2.useCallback)(() => {
1032
- if (onFocus) {
1033
- onFocus(id, value);
1034
- }
1035
- }, [onFocus, id, value]);
1036
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1037
- import_dates.DateInput,
1038
- {
1039
- id,
1040
- name,
1041
- value: dateParser(value, valueFormat),
1042
- dateParser: (v) => dateParser(v, displayFormat),
1043
- placeholder: placeholder || void 0,
1044
- required,
1045
- disabled: disabled || readonly,
1046
- autoFocus: autofocus,
1047
- label: (0, import_utils16.labelValue)(label || void 0, hideLabel, false),
1048
- onChange: handleChange,
1049
- onBlur: handleBlur,
1050
- onFocus: handleFocus,
1051
- error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
1052
- ...options,
1053
- "aria-describedby": (0, import_utils16.ariaDescribedByIds)(id),
1054
- popoverProps: { withinPortal: false },
1055
- classNames: typeof options?.classNames === "object" ? options.classNames : void 0,
1056
- valueFormat: displayFormat
1057
- }
966
+ const handleBlur = (0, import_react2.useCallback)(
967
+ ({ target }) => {
968
+ if (onBlur) {
969
+ onBlur(id, (0, import_utils15.enumOptionValueDecoder)(target.value, enumOptions, optionValueFormat, emptyValue));
970
+ }
971
+ },
972
+ [onBlur, id, enumOptions, emptyValue, optionValueFormat]
1058
973
  );
1059
- }
1060
-
1061
- // src/widgets/DateTime/DateWidget.tsx
1062
- var import_jsx_runtime23 = require("react/jsx-runtime");
1063
- function DateWidget(props) {
1064
- const { valueFormat = "YYYY-MM-DD", displayFormat, ...otherOptions } = props.options;
1065
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1066
- DateTimeInput,
1067
- {
1068
- ...props,
1069
- options: otherOptions,
1070
- valueFormat,
1071
- displayFormat: displayFormat || valueFormat
1072
- }
1073
- );
1074
- }
1075
-
1076
- // src/widgets/DateTime/DateTimeWidget.tsx
1077
- var import_jsx_runtime24 = require("react/jsx-runtime");
1078
- function DateTimeWidget(props) {
1079
- const { valueFormat = "YYYY-MM-DD HH:mm:ss", displayFormat, ...otherOptions } = props.options;
1080
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1081
- DateTimeInput,
1082
- {
1083
- ...props,
1084
- options: otherOptions,
1085
- valueFormat,
1086
- displayFormat: displayFormat || valueFormat
1087
- }
1088
- );
1089
- }
1090
-
1091
- // src/widgets/DateTime/TimeWidget.tsx
1092
- var import_react3 = require("react");
1093
- var import_utils17 = require("@rjsf/utils");
1094
- var import_dates2 = require("@mantine/dates");
1095
- var import_jsx_runtime25 = require("react/jsx-runtime");
1096
- function TimeWidget(props) {
1097
- const {
1098
- id,
1099
- name,
1100
- value,
1101
- placeholder,
1102
- required,
1103
- disabled,
1104
- readonly,
1105
- autofocus,
1106
- label,
1107
- hideLabel,
1108
- rawErrors,
1109
- options,
1110
- onChange,
1111
- onBlur,
1112
- onFocus
1113
- } = props;
1114
- const emptyValue = options.emptyValue || "";
1115
- const handleChange = (0, import_react3.useCallback)(
1116
- (e) => {
1117
- onChange(e.target.value === "" ? emptyValue : e.target.value);
1118
- },
1119
- [onChange, emptyValue]
1120
- );
1121
- const handleBlur = (0, import_react3.useCallback)(
1122
- ({ target }) => {
1123
- if (onBlur) {
1124
- onBlur(id, target && target.value);
1125
- }
1126
- },
1127
- [onBlur, id]
1128
- );
1129
- const handleFocus = (0, import_react3.useCallback)(
974
+ const handleFocus = (0, import_react2.useCallback)(
1130
975
  ({ target }) => {
1131
976
  if (onFocus) {
1132
- onFocus(id, target && target.value);
1133
- }
1134
- },
1135
- [onFocus, id]
1136
- );
1137
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1138
- import_dates2.TimeInput,
1139
- {
1140
- id,
1141
- name,
1142
- value: value || "",
1143
- placeholder: placeholder || void 0,
1144
- required,
1145
- disabled: disabled || readonly,
1146
- autoFocus: autofocus,
1147
- label: (0, import_utils17.labelValue)(label || void 0, hideLabel, false),
1148
- onChange: handleChange,
1149
- onBlur: handleBlur,
1150
- onFocus: handleFocus,
1151
- error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
1152
- ...options,
1153
- "aria-describedby": (0, import_utils17.ariaDescribedByIds)(id),
1154
- classNames: typeof options?.classNames === "object" ? options.classNames : void 0
1155
- }
1156
- );
1157
- }
1158
-
1159
- // src/widgets/CheckboxesWidget.tsx
1160
- var import_react4 = require("react");
1161
- var import_utils18 = require("@rjsf/utils");
1162
- var import_core21 = require("@mantine/core");
1163
- var import_jsx_runtime26 = require("react/jsx-runtime");
1164
- function CheckboxesWidget(props) {
1165
- const {
1166
- id,
1167
- htmlName,
1168
- value,
1169
- required,
1170
- disabled,
1171
- readonly,
1172
- autofocus,
1173
- label,
1174
- hideLabel,
1175
- rawErrors,
1176
- options,
1177
- onChange,
1178
- onBlur,
1179
- onFocus
1180
- } = props;
1181
- const { enumOptions, enumDisabled, inline, emptyValue } = options;
1182
- const optionValueFormat = (0, import_utils18.getOptionValueFormat)(options);
1183
- const themeProps = cleanupOptions(options);
1184
- const handleChange = (0, import_react4.useCallback)(
1185
- (nextValue) => {
1186
- if (!disabled && !readonly && onChange) {
1187
- onChange((0, import_utils18.enumOptionValueDecoder)(nextValue, enumOptions, optionValueFormat, emptyValue));
1188
- }
1189
- },
1190
- [onChange, disabled, readonly, enumOptions, emptyValue, optionValueFormat]
1191
- );
1192
- const handleBlur = (0, import_react4.useCallback)(
1193
- ({ target }) => {
1194
- if (onBlur) {
1195
- onBlur(id, (0, import_utils18.enumOptionValueDecoder)(target.value, enumOptions, optionValueFormat, emptyValue));
1196
- }
1197
- },
1198
- [onBlur, id, enumOptions, emptyValue, optionValueFormat]
1199
- );
1200
- const handleFocus = (0, import_react4.useCallback)(
1201
- ({ target }) => {
1202
- if (onFocus) {
1203
- onFocus(id, (0, import_utils18.enumOptionValueDecoder)(target.value, enumOptions, optionValueFormat, emptyValue));
977
+ onFocus(id, (0, import_utils15.enumOptionValueDecoder)(target.value, enumOptions, optionValueFormat, emptyValue));
1204
978
  }
1205
979
  },
1206
980
  [onFocus, id, enumOptions, emptyValue, optionValueFormat]
1207
981
  );
1208
- const selectedIndexes = (0, import_utils18.enumOptionsIndexForValue)(value, enumOptions, true);
1209
- return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
1210
- !hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_core21.Input.Label, { id: (0, import_utils18.titleId)(id), required, children: label }),
1211
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1212
- import_core21.Checkbox.Group,
982
+ const selectedIndexes = (0, import_utils15.enumOptionsIndexForValue)(value, enumOptions, true);
983
+ return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
984
+ !hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_core20.Input.Label, { id: (0, import_utils15.titleId)(id), required, children: label }),
985
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
986
+ import_core20.Checkbox.Group,
1213
987
  {
1214
988
  id,
1215
989
  value: selectedIndexes,
@@ -1217,14 +991,14 @@ function CheckboxesWidget(props) {
1217
991
  required,
1218
992
  readOnly: disabled || readonly,
1219
993
  error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
1220
- "aria-describedby": (0, import_utils18.ariaDescribedByIds)(id),
994
+ "aria-describedby": (0, import_utils15.ariaDescribedByIds)(id),
1221
995
  ...themeProps,
1222
- children: Array.isArray(enumOptions) ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_core21.Flex, { mt: "xs", direction: inline ? "row" : "column", gap: "xs", wrap: "wrap", children: enumOptions.map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1223
- import_core21.Checkbox,
996
+ children: Array.isArray(enumOptions) ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_core20.Flex, { mt: "xs", direction: inline ? "row" : "column", gap: "xs", wrap: "wrap", children: enumOptions.map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
997
+ import_core20.Checkbox,
1224
998
  {
1225
- id: (0, import_utils18.optionId)(id, i),
999
+ id: (0, import_utils15.optionId)(id, i),
1226
1000
  name: htmlName || id,
1227
- value: (0, import_utils18.enumOptionValueEncoder)(option.value, i, optionValueFormat),
1001
+ value: (0, import_utils15.enumOptionValueEncoder)(option.value, i, optionValueFormat),
1228
1002
  label: option.label,
1229
1003
  disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1,
1230
1004
  autoFocus: i === 0 && autofocus,
@@ -1239,10 +1013,10 @@ function CheckboxesWidget(props) {
1239
1013
  }
1240
1014
 
1241
1015
  // src/widgets/CheckboxWidget.tsx
1242
- var import_react5 = require("react");
1243
- var import_utils20 = require("@rjsf/utils");
1244
- var import_core22 = require("@mantine/core");
1245
- var import_jsx_runtime27 = require("react/jsx-runtime");
1016
+ var import_react3 = require("react");
1017
+ var import_core21 = require("@mantine/core");
1018
+ var import_utils17 = require("@rjsf/utils");
1019
+ var import_jsx_runtime21 = require("react/jsx-runtime");
1246
1020
  function CheckboxWidget(props) {
1247
1021
  const {
1248
1022
  id,
@@ -1264,12 +1038,12 @@ function CheckboxWidget(props) {
1264
1038
  registry,
1265
1039
  uiSchema
1266
1040
  } = props;
1267
- const DescriptionFieldTemplate = (0, import_utils20.getTemplate)(
1041
+ const DescriptionFieldTemplate = (0, import_utils17.getTemplate)(
1268
1042
  "DescriptionFieldTemplate",
1269
1043
  registry,
1270
1044
  options
1271
1045
  );
1272
- const handleCheckboxChange = (0, import_react5.useCallback)(
1046
+ const handleCheckboxChange = (0, import_react3.useCallback)(
1273
1047
  (e) => {
1274
1048
  if (!disabled && !readonly && onChange) {
1275
1049
  onChange(e.currentTarget.checked);
@@ -1277,7 +1051,7 @@ function CheckboxWidget(props) {
1277
1051
  },
1278
1052
  [onChange, disabled, readonly]
1279
1053
  );
1280
- const handleBlur = (0, import_react5.useCallback)(
1054
+ const handleBlur = (0, import_react3.useCallback)(
1281
1055
  ({ target }) => {
1282
1056
  if (onBlur) {
1283
1057
  onBlur(id, target.checked);
@@ -1285,7 +1059,7 @@ function CheckboxWidget(props) {
1285
1059
  },
1286
1060
  [onBlur, id]
1287
1061
  );
1288
- const handleFocus = (0, import_react5.useCallback)(
1062
+ const handleFocus = (0, import_react3.useCallback)(
1289
1063
  ({ target }) => {
1290
1064
  if (onFocus) {
1291
1065
  onFocus(id, target.checked);
@@ -1294,23 +1068,23 @@ function CheckboxWidget(props) {
1294
1068
  [onFocus, id]
1295
1069
  );
1296
1070
  const description = options.description || schema.description;
1297
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
1298
- !hideLabel && !!description && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
1071
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
1072
+ !hideLabel && !!description && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1299
1073
  DescriptionFieldTemplate,
1300
1074
  {
1301
- id: (0, import_utils20.descriptionId)(id),
1075
+ id: (0, import_utils17.descriptionId)(id),
1302
1076
  description,
1303
1077
  schema,
1304
1078
  uiSchema,
1305
1079
  registry
1306
1080
  }
1307
1081
  ),
1308
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
1309
- import_core22.Checkbox,
1082
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1083
+ import_core21.Checkbox,
1310
1084
  {
1311
1085
  id,
1312
1086
  name: htmlName || name,
1313
- label: (0, import_utils20.labelValue)(label || void 0, hideLabel, false),
1087
+ label: (0, import_utils17.labelValue)(label || void 0, hideLabel, false),
1314
1088
  disabled: disabled || readonly,
1315
1089
  required,
1316
1090
  autoFocus: autofocus,
@@ -1319,17 +1093,17 @@ function CheckboxWidget(props) {
1319
1093
  onBlur: handleBlur,
1320
1094
  onFocus: handleFocus,
1321
1095
  error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
1322
- "aria-describedby": (0, import_utils20.ariaDescribedByIds)(id)
1096
+ "aria-describedby": (0, import_utils17.ariaDescribedByIds)(id)
1323
1097
  }
1324
1098
  )
1325
1099
  ] });
1326
1100
  }
1327
1101
 
1328
1102
  // src/widgets/ColorWidget.tsx
1329
- var import_react6 = require("react");
1330
- var import_utils21 = require("@rjsf/utils");
1331
- var import_core23 = require("@mantine/core");
1332
- var import_jsx_runtime28 = require("react/jsx-runtime");
1103
+ var import_react4 = require("react");
1104
+ var import_core22 = require("@mantine/core");
1105
+ var import_utils18 = require("@rjsf/utils");
1106
+ var import_jsx_runtime22 = require("react/jsx-runtime");
1333
1107
  function ColorWidget(props) {
1334
1108
  const {
1335
1109
  id,
@@ -1349,12 +1123,236 @@ function ColorWidget(props) {
1349
1123
  onFocus
1350
1124
  } = props;
1351
1125
  const themeProps = cleanupOptions(options);
1352
- const handleChange = (0, import_react6.useCallback)(
1126
+ const handleChange = (0, import_react4.useCallback)(
1353
1127
  (nextValue) => {
1354
1128
  onChange(nextValue);
1355
1129
  },
1356
1130
  [onChange]
1357
1131
  );
1132
+ const handleBlur = (0, import_react4.useCallback)(
1133
+ ({ target }) => {
1134
+ if (onBlur) {
1135
+ onBlur(id, target && target.value);
1136
+ }
1137
+ },
1138
+ [onBlur, id]
1139
+ );
1140
+ const handleFocus = (0, import_react4.useCallback)(
1141
+ ({ target }) => {
1142
+ if (onFocus) {
1143
+ onFocus(id, target && target.value);
1144
+ }
1145
+ },
1146
+ [onFocus, id]
1147
+ );
1148
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1149
+ import_core22.ColorInput,
1150
+ {
1151
+ id,
1152
+ name,
1153
+ value: value || "",
1154
+ placeholder: placeholder || void 0,
1155
+ required,
1156
+ disabled: disabled || readonly,
1157
+ autoFocus: autofocus,
1158
+ label: (0, import_utils18.labelValue)(label || void 0, hideLabel, false),
1159
+ onChange: handleChange,
1160
+ onBlur: handleBlur,
1161
+ onFocus: handleFocus,
1162
+ error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
1163
+ ...themeProps,
1164
+ "aria-describedby": (0, import_utils18.ariaDescribedByIds)(id),
1165
+ popoverProps: { withinPortal: false }
1166
+ }
1167
+ );
1168
+ }
1169
+
1170
+ // src/widgets/DateTime/AltDateTimeWidget.tsx
1171
+ var import_jsx_runtime23 = require("react/jsx-runtime");
1172
+ function AltDateTimeWidget(props) {
1173
+ const { AltDateWidget: AltDateWidget2 } = props.registry.widgets;
1174
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(AltDateWidget2, { time: true, ...props });
1175
+ }
1176
+
1177
+ // src/widgets/DateTime/AltDateWidget.tsx
1178
+ var import_core23 = require("@mantine/core");
1179
+ var import_utils20 = require("@rjsf/utils");
1180
+ var import_jsx_runtime24 = require("react/jsx-runtime");
1181
+ function AltDateWidget(props) {
1182
+ const { id, required, disabled, readonly, label, hideLabel, rawErrors, options, registry } = props;
1183
+ const { translateString } = registry;
1184
+ const { elements, handleChange, handleClear, handleSetNow } = (0, import_utils20.useAltDateWidgetProps)(props);
1185
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
1186
+ !hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_core23.Input.Label, { id: (0, import_utils20.titleId)(id), required, children: label }),
1187
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_core23.Flex, { gap: "xs", align: "center", wrap: "nowrap", children: [
1188
+ elements.map((elemProps, i) => {
1189
+ const elemId = `${id}_${elemProps.type}`;
1190
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_core23.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1191
+ import_core23.Select,
1192
+ {
1193
+ id: elemId,
1194
+ name: elemId,
1195
+ placeholder: elemProps.type,
1196
+ disabled: disabled || readonly,
1197
+ data: (0, import_utils20.dateRangeOptions)(elemProps.range[0], elemProps.range[1]).map((item) => item.value.toString()),
1198
+ value: !elemProps.value || elemProps.value < 0 ? null : elemProps.value.toString(),
1199
+ onChange: (v) => handleChange(elemProps.type, v || void 0),
1200
+ searchable: false,
1201
+ allowDeselect: false,
1202
+ comboboxProps: { withinPortal: false },
1203
+ "aria-describedby": (0, import_utils20.ariaDescribedByIds)(elemId)
1204
+ }
1205
+ ) }, i);
1206
+ }),
1207
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_core23.Group, { wrap: "nowrap", gap: 3, children: [
1208
+ (options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_core23.Button, { variant: "subtle", size: "xs", onClick: handleSetNow, children: translateString(import_utils20.TranslatableString.NowLabel) }),
1209
+ (options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_core23.Button, { variant: "subtle", size: "xs", onClick: handleClear, children: translateString(import_utils20.TranslatableString.ClearLabel) })
1210
+ ] })
1211
+ ] }),
1212
+ rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_core23.Input.Error, { children: error }, `alt-date-widget-input-errors-${index}`))
1213
+ ] });
1214
+ }
1215
+
1216
+ // src/widgets/DateTime/DateTimeInput.tsx
1217
+ var import_react5 = require("react");
1218
+ var import_dates = require("@mantine/dates");
1219
+ var import_utils21 = require("@rjsf/utils");
1220
+ var import_dayjs = __toESM(require("dayjs"), 1);
1221
+ var import_jsx_runtime25 = require("react/jsx-runtime");
1222
+ var dateParser = (input, format) => {
1223
+ if (!input) {
1224
+ return null;
1225
+ }
1226
+ const d = (0, import_dayjs.default)(input, format);
1227
+ return d.isValid() ? d.toDate() : null;
1228
+ };
1229
+ var dateFormat = (date, format) => {
1230
+ if (!date) {
1231
+ return "";
1232
+ }
1233
+ return (0, import_dayjs.default)(date).format(format || "YYYY-MM-DD");
1234
+ };
1235
+ function DateTimeInput(props) {
1236
+ const {
1237
+ id,
1238
+ name,
1239
+ value,
1240
+ placeholder,
1241
+ required,
1242
+ disabled,
1243
+ readonly,
1244
+ autofocus,
1245
+ label,
1246
+ hideLabel,
1247
+ rawErrors,
1248
+ options,
1249
+ onChange,
1250
+ onBlur,
1251
+ onFocus,
1252
+ valueFormat,
1253
+ displayFormat
1254
+ } = props;
1255
+ const handleChange = (0, import_react5.useCallback)(
1256
+ (nextValue) => {
1257
+ onChange(dateFormat(nextValue, valueFormat));
1258
+ },
1259
+ [onChange, valueFormat]
1260
+ );
1261
+ const handleBlur = (0, import_react5.useCallback)(() => {
1262
+ if (onBlur) {
1263
+ onBlur(id, value);
1264
+ }
1265
+ }, [onBlur, id, value]);
1266
+ const handleFocus = (0, import_react5.useCallback)(() => {
1267
+ if (onFocus) {
1268
+ onFocus(id, value);
1269
+ }
1270
+ }, [onFocus, id, value]);
1271
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1272
+ import_dates.DateInput,
1273
+ {
1274
+ id,
1275
+ name,
1276
+ value: dateParser(value, valueFormat),
1277
+ dateParser: (v) => dateParser(v, displayFormat),
1278
+ placeholder: placeholder || void 0,
1279
+ required,
1280
+ disabled: disabled || readonly,
1281
+ autoFocus: autofocus,
1282
+ label: (0, import_utils21.labelValue)(label || void 0, hideLabel, false),
1283
+ onChange: handleChange,
1284
+ onBlur: handleBlur,
1285
+ onFocus: handleFocus,
1286
+ error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
1287
+ ...options,
1288
+ "aria-describedby": (0, import_utils21.ariaDescribedByIds)(id),
1289
+ popoverProps: { withinPortal: false },
1290
+ classNames: typeof options?.classNames === "object" ? options.classNames : void 0,
1291
+ valueFormat: displayFormat
1292
+ }
1293
+ );
1294
+ }
1295
+
1296
+ // src/widgets/DateTime/DateWidget.tsx
1297
+ var import_jsx_runtime26 = require("react/jsx-runtime");
1298
+ function DateWidget(props) {
1299
+ const { valueFormat = "YYYY-MM-DD", displayFormat, ...otherOptions } = props.options;
1300
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1301
+ DateTimeInput,
1302
+ {
1303
+ ...props,
1304
+ options: otherOptions,
1305
+ valueFormat,
1306
+ displayFormat: displayFormat || valueFormat
1307
+ }
1308
+ );
1309
+ }
1310
+
1311
+ // src/widgets/DateTime/DateTimeWidget.tsx
1312
+ var import_jsx_runtime27 = require("react/jsx-runtime");
1313
+ function DateTimeWidget(props) {
1314
+ const { valueFormat = "YYYY-MM-DD HH:mm:ss", displayFormat, ...otherOptions } = props.options;
1315
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
1316
+ DateTimeInput,
1317
+ {
1318
+ ...props,
1319
+ options: otherOptions,
1320
+ valueFormat,
1321
+ displayFormat: displayFormat || valueFormat
1322
+ }
1323
+ );
1324
+ }
1325
+
1326
+ // src/widgets/DateTime/TimeWidget.tsx
1327
+ var import_react6 = require("react");
1328
+ var import_dates2 = require("@mantine/dates");
1329
+ var import_utils22 = require("@rjsf/utils");
1330
+ var import_jsx_runtime28 = require("react/jsx-runtime");
1331
+ function TimeWidget(props) {
1332
+ const {
1333
+ id,
1334
+ name,
1335
+ value,
1336
+ placeholder,
1337
+ required,
1338
+ disabled,
1339
+ readonly,
1340
+ autofocus,
1341
+ label,
1342
+ hideLabel,
1343
+ rawErrors,
1344
+ options,
1345
+ onChange,
1346
+ onBlur,
1347
+ onFocus
1348
+ } = props;
1349
+ const emptyValue = options.emptyValue || "";
1350
+ const handleChange = (0, import_react6.useCallback)(
1351
+ (e) => {
1352
+ onChange(e.target.value === "" ? emptyValue : e.target.value);
1353
+ },
1354
+ [onChange, emptyValue]
1355
+ );
1358
1356
  const handleBlur = (0, import_react6.useCallback)(
1359
1357
  ({ target }) => {
1360
1358
  if (onBlur) {
@@ -1372,7 +1370,7 @@ function ColorWidget(props) {
1372
1370
  [onFocus, id]
1373
1371
  );
1374
1372
  return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1375
- import_core23.ColorInput,
1373
+ import_dates2.TimeInput,
1376
1374
  {
1377
1375
  id,
1378
1376
  name,
@@ -1381,22 +1379,22 @@ function ColorWidget(props) {
1381
1379
  required,
1382
1380
  disabled: disabled || readonly,
1383
1381
  autoFocus: autofocus,
1384
- label: (0, import_utils21.labelValue)(label || void 0, hideLabel, false),
1382
+ label: (0, import_utils22.labelValue)(label || void 0, hideLabel, false),
1385
1383
  onChange: handleChange,
1386
1384
  onBlur: handleBlur,
1387
1385
  onFocus: handleFocus,
1388
1386
  error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
1389
- ...themeProps,
1390
- "aria-describedby": (0, import_utils21.ariaDescribedByIds)(id),
1391
- popoverProps: { withinPortal: false }
1387
+ ...options,
1388
+ "aria-describedby": (0, import_utils22.ariaDescribedByIds)(id),
1389
+ classNames: typeof options?.classNames === "object" ? options.classNames : void 0
1392
1390
  }
1393
1391
  );
1394
1392
  }
1395
1393
 
1396
1394
  // src/widgets/FileWidget.tsx
1397
1395
  var import_react7 = require("react");
1398
- var import_utils23 = require("@rjsf/utils");
1399
1396
  var import_core24 = require("@mantine/core");
1397
+ var import_utils23 = require("@rjsf/utils");
1400
1398
  var import_jsx_runtime29 = require("react/jsx-runtime");
1401
1399
  function FileWidget(props) {
1402
1400
  const {
@@ -1420,7 +1418,7 @@ function FileWidget(props) {
1420
1418
  const handleOnChange = (0, import_react7.useCallback)(
1421
1419
  (files) => {
1422
1420
  if (typeof files === "object") {
1423
- handleChange(files);
1421
+ void handleChange(files);
1424
1422
  }
1425
1423
  },
1426
1424
  [handleChange]
@@ -1454,8 +1452,8 @@ function FileWidget(props) {
1454
1452
 
1455
1453
  // src/widgets/PasswordWidget.tsx
1456
1454
  var import_react8 = require("react");
1457
- var import_utils25 = require("@rjsf/utils");
1458
1455
  var import_core25 = require("@mantine/core");
1456
+ var import_utils25 = require("@rjsf/utils");
1459
1457
  var import_jsx_runtime30 = require("react/jsx-runtime");
1460
1458
  function PasswordWidget(props) {
1461
1459
  const {
@@ -1522,8 +1520,8 @@ function PasswordWidget(props) {
1522
1520
 
1523
1521
  // src/widgets/RadioWidget.tsx
1524
1522
  var import_react9 = require("react");
1525
- var import_utils27 = require("@rjsf/utils");
1526
1523
  var import_core26 = require("@mantine/core");
1524
+ var import_utils27 = require("@rjsf/utils");
1527
1525
  var import_jsx_runtime31 = require("react/jsx-runtime");
1528
1526
  function RadioWidget(props) {
1529
1527
  const {
@@ -1602,8 +1600,8 @@ function RadioWidget(props) {
1602
1600
 
1603
1601
  // src/widgets/RangeWidget.tsx
1604
1602
  var import_react10 = require("react");
1605
- var import_utils29 = require("@rjsf/utils");
1606
1603
  var import_core27 = require("@mantine/core");
1604
+ var import_utils29 = require("@rjsf/utils");
1607
1605
  var import_jsx_runtime32 = require("react/jsx-runtime");
1608
1606
  function RangeWidget(props) {
1609
1607
  const {
@@ -1670,8 +1668,8 @@ function RangeWidget(props) {
1670
1668
 
1671
1669
  // src/widgets/SelectWidget.tsx
1672
1670
  var import_react11 = require("react");
1673
- var import_utils31 = require("@rjsf/utils");
1674
1671
  var import_core28 = require("@mantine/core");
1672
+ var import_utils31 = require("@rjsf/utils");
1675
1673
  var import_jsx_runtime33 = require("react/jsx-runtime");
1676
1674
  function SelectWidget(props) {
1677
1675
  const {
@@ -1765,8 +1763,8 @@ function SelectWidget(props) {
1765
1763
 
1766
1764
  // src/widgets/TextareaWidget.tsx
1767
1765
  var import_react12 = require("react");
1768
- var import_utils33 = require("@rjsf/utils");
1769
1766
  var import_core29 = require("@mantine/core");
1767
+ var import_utils33 = require("@rjsf/utils");
1770
1768
  var import_jsx_runtime34 = require("react/jsx-runtime");
1771
1769
  function TextareaWidget(props) {
1772
1770
  const {