@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.
- package/dist/index.cjs +438 -440
- package/dist/index.cjs.map +4 -4
- package/dist/mantine.esm.js +418 -420
- package/dist/mantine.esm.js.map +4 -4
- package/dist/mantine.umd.js +245 -245
- package/lib/templates/ArrayFieldItemTemplate.js +1 -1
- package/lib/templates/ArrayFieldItemTemplate.js.map +1 -1
- package/lib/templates/ArrayFieldTemplate.js +1 -1
- package/lib/templates/ArrayFieldTemplate.js.map +1 -1
- package/lib/templates/ArrayFieldTitleTemplate.js +1 -1
- package/lib/templates/ArrayFieldTitleTemplate.js.map +1 -1
- package/lib/templates/BaseInputTemplate.js +1 -1
- package/lib/templates/BaseInputTemplate.js.map +1 -1
- package/lib/templates/ButtonTemplates/AddButton.js +1 -1
- package/lib/templates/ButtonTemplates/AddButton.js.map +1 -1
- package/lib/templates/ButtonTemplates/index.js +1 -1
- package/lib/templates/ButtonTemplates/index.js.map +1 -1
- package/lib/templates/DescriptionField.js +1 -1
- package/lib/templates/DescriptionField.js.map +1 -1
- package/lib/templates/ErrorList.js +1 -1
- package/lib/templates/ErrorList.js.map +1 -1
- package/lib/templates/FieldErrorTemplate.js +1 -1
- package/lib/templates/FieldErrorTemplate.js.map +1 -1
- package/lib/templates/FieldHelpTemplate.js +1 -1
- package/lib/templates/FieldHelpTemplate.js.map +1 -1
- package/lib/templates/TitleField.js.map +1 -1
- package/lib/templates/WrapIfAdditionalTemplate.js +1 -1
- package/lib/templates/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/templates/index.js +3 -3
- package/lib/templates/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/widgets/CheckboxWidget.js +1 -1
- package/lib/widgets/CheckboxWidget.js.map +1 -1
- package/lib/widgets/CheckboxesWidget.js +1 -1
- package/lib/widgets/CheckboxesWidget.js.map +1 -1
- package/lib/widgets/ColorWidget.js +1 -1
- package/lib/widgets/ColorWidget.js.map +1 -1
- package/lib/widgets/DateTime/AltDateWidget.js +1 -1
- package/lib/widgets/DateTime/AltDateWidget.js.map +1 -1
- package/lib/widgets/DateTime/DateTimeInput.js +1 -1
- package/lib/widgets/DateTime/DateTimeInput.js.map +1 -1
- package/lib/widgets/DateTime/TimeWidget.js +1 -1
- package/lib/widgets/DateTime/TimeWidget.js.map +1 -1
- package/lib/widgets/FileWidget.js +3 -2
- package/lib/widgets/FileWidget.js.map +1 -1
- package/lib/widgets/PasswordWidget.js +1 -1
- package/lib/widgets/PasswordWidget.js.map +1 -1
- package/lib/widgets/RadioWidget.js +1 -1
- package/lib/widgets/RadioWidget.js.map +1 -1
- package/lib/widgets/RangeWidget.js +1 -1
- package/lib/widgets/RangeWidget.js.map +1 -1
- package/lib/widgets/SelectWidget.js +1 -1
- package/lib/widgets/SelectWidget.js.map +1 -1
- package/lib/widgets/TextareaWidget.js +1 -1
- package/lib/widgets/TextareaWidget.js.map +1 -1
- package/lib/widgets/index.js +1 -1
- package/lib/widgets/index.js.map +1 -1
- package/package.json +13 -13
- package/src/templates/ArrayFieldItemTemplate.tsx +1 -1
- package/src/templates/ArrayFieldTemplate.tsx +1 -1
- package/src/templates/ArrayFieldTitleTemplate.tsx +1 -1
- package/src/templates/BaseInputTemplate.tsx +2 -2
- package/src/templates/ButtonTemplates/AddButton.tsx +1 -1
- package/src/templates/ButtonTemplates/index.ts +2 -1
- package/src/templates/DescriptionField.tsx +2 -2
- package/src/templates/ErrorList.tsx +1 -1
- package/src/templates/FieldErrorTemplate.tsx +1 -1
- package/src/templates/FieldHelpTemplate.tsx +1 -1
- package/src/templates/TitleField.tsx +1 -1
- package/src/templates/WrapIfAdditionalTemplate.tsx +1 -1
- package/src/templates/index.ts +3 -3
- package/src/tsconfig.json +0 -1
- package/src/widgets/CheckboxWidget.tsx +1 -1
- package/src/widgets/CheckboxesWidget.tsx +1 -1
- package/src/widgets/ColorWidget.tsx +1 -1
- package/src/widgets/DateTime/AltDateWidget.tsx +1 -1
- package/src/widgets/DateTime/DateTimeInput.tsx +1 -1
- package/src/widgets/DateTime/TimeWidget.tsx +1 -1
- package/src/widgets/FileWidget.tsx +3 -2
- package/src/widgets/PasswordWidget.tsx +1 -1
- package/src/widgets/RadioWidget.tsx +1 -1
- package/src/widgets/RangeWidget.tsx +1 -1
- package/src/widgets/SelectWidget.tsx +1 -1
- package/src/widgets/TextareaWidget.tsx +1 -1
- package/src/widgets/index.ts +1 -1
package/dist/mantine.esm.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import { withTheme } from "@rjsf/core";
|
|
3
3
|
|
|
4
4
|
// src/templates/ArrayFieldItemTemplate.tsx
|
|
5
|
+
import { Box, Flex, Group } from "@mantine/core";
|
|
5
6
|
import {
|
|
6
7
|
getTemplate,
|
|
7
8
|
getUiOptions
|
|
8
9
|
} from "@rjsf/utils";
|
|
9
|
-
import { Box, Flex, Group } from "@mantine/core";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
function ArrayFieldItemTemplate(props) {
|
|
12
12
|
const { buttonsProps, className, hasToolbar, index, uiSchema, registry, children } = props;
|
|
@@ -23,12 +23,12 @@ function ArrayFieldItemTemplate(props) {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
// src/templates/ArrayFieldTemplate.tsx
|
|
26
|
+
import { Fieldset, Box as Box2, Group as Group2 } from "@mantine/core";
|
|
26
27
|
import {
|
|
27
28
|
getTemplate as getTemplate2,
|
|
28
29
|
getUiOptions as getUiOptions2,
|
|
29
30
|
buttonId
|
|
30
31
|
} from "@rjsf/utils";
|
|
31
|
-
import { Fieldset, Box as Box2, Group as Group2 } from "@mantine/core";
|
|
32
32
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
33
33
|
function ArrayFieldTemplate(props) {
|
|
34
34
|
const {
|
|
@@ -104,11 +104,11 @@ function ArrayFieldTemplate(props) {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
// src/templates/ArrayFieldTitleTemplate.tsx
|
|
107
|
+
import { Grid, Title } from "@mantine/core";
|
|
107
108
|
import {
|
|
108
109
|
getUiOptions as getUiOptions3,
|
|
109
110
|
titleId
|
|
110
111
|
} from "@rjsf/utils";
|
|
111
|
-
import { Grid, Title } from "@mantine/core";
|
|
112
112
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
113
113
|
function ArrayFieldTitleTemplate(props) {
|
|
114
114
|
const { fieldPathId, title, uiSchema, registry, optionalDataControl } = props;
|
|
@@ -129,14 +129,14 @@ function ArrayFieldTitleTemplate(props) {
|
|
|
129
129
|
|
|
130
130
|
// src/templates/BaseInputTemplate.tsx
|
|
131
131
|
import { useCallback } from "react";
|
|
132
|
+
import { TextInput, NumberInput } from "@mantine/core";
|
|
133
|
+
import { SchemaExamples } from "@rjsf/core";
|
|
132
134
|
import {
|
|
133
135
|
ariaDescribedByIds,
|
|
134
136
|
examplesId,
|
|
135
137
|
getInputProps,
|
|
136
138
|
labelValue
|
|
137
139
|
} from "@rjsf/utils";
|
|
138
|
-
import { TextInput, NumberInput } from "@mantine/core";
|
|
139
|
-
import { SchemaExamples } from "@rjsf/core";
|
|
140
140
|
|
|
141
141
|
// src/utils.ts
|
|
142
142
|
var uiOptionsKeys = [
|
|
@@ -284,24 +284,11 @@ function BaseInputTemplate(props) {
|
|
|
284
284
|
] });
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
-
// src/templates/
|
|
288
|
-
import {
|
|
289
|
-
import { Text } from "@mantine/core";
|
|
290
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
291
|
-
function DescriptionField(props) {
|
|
292
|
-
const { id, description, registry, uiSchema } = props;
|
|
293
|
-
if (description) {
|
|
294
|
-
return /* @__PURE__ */ jsx5(Text, { id, mt: 3, mb: "sm", children: /* @__PURE__ */ jsx5(RichDescription, { description, registry, uiSchema }) });
|
|
295
|
-
}
|
|
296
|
-
return null;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
// src/templates/ErrorList.tsx
|
|
300
|
-
import { TranslatableString } from "@rjsf/utils";
|
|
301
|
-
import { Alert, Title as Title2, List } from "@mantine/core";
|
|
287
|
+
// src/templates/ButtonTemplates/AddButton.tsx
|
|
288
|
+
import { TranslatableString as TranslatableString2 } from "@rjsf/utils";
|
|
302
289
|
|
|
303
290
|
// src/templates/icons.tsx
|
|
304
|
-
import { jsx as
|
|
291
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
305
292
|
function Plus({ size, style, ...others }) {
|
|
306
293
|
return /* @__PURE__ */ jsxs5(
|
|
307
294
|
"svg",
|
|
@@ -319,9 +306,9 @@ function Plus({ size, style, ...others }) {
|
|
|
319
306
|
style: { width: size, height: size, ...style },
|
|
320
307
|
...others,
|
|
321
308
|
children: [
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
-
/* @__PURE__ */
|
|
324
|
-
/* @__PURE__ */
|
|
309
|
+
/* @__PURE__ */ jsx5("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
|
|
310
|
+
/* @__PURE__ */ jsx5("path", { d: "M12 5l0 14" }),
|
|
311
|
+
/* @__PURE__ */ jsx5("path", { d: "M5 12l14 0" })
|
|
325
312
|
]
|
|
326
313
|
}
|
|
327
314
|
);
|
|
@@ -343,9 +330,9 @@ function Copy({ size, style, ...others }) {
|
|
|
343
330
|
style: { width: size, height: size, ...style },
|
|
344
331
|
...others,
|
|
345
332
|
children: [
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
-
/* @__PURE__ */
|
|
348
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ jsx5("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
|
|
334
|
+
/* @__PURE__ */ jsx5("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" }),
|
|
335
|
+
/* @__PURE__ */ jsx5("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" })
|
|
349
336
|
]
|
|
350
337
|
}
|
|
351
338
|
);
|
|
@@ -367,8 +354,8 @@ function ChevronDown({ size, style, ...others }) {
|
|
|
367
354
|
style: { width: size, height: size, ...style },
|
|
368
355
|
...others,
|
|
369
356
|
children: [
|
|
370
|
-
/* @__PURE__ */
|
|
371
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ jsx5("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
|
|
358
|
+
/* @__PURE__ */ jsx5("path", { d: "M6 9l6 6l6 -6" })
|
|
372
359
|
]
|
|
373
360
|
}
|
|
374
361
|
);
|
|
@@ -390,8 +377,8 @@ function ChevronUp({ size, style, ...others }) {
|
|
|
390
377
|
style: { width: size, height: size, ...style },
|
|
391
378
|
...others,
|
|
392
379
|
children: [
|
|
393
|
-
/* @__PURE__ */
|
|
394
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ jsx5("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
|
|
381
|
+
/* @__PURE__ */ jsx5("path", { d: "M6 15l6 -6l6 6" })
|
|
395
382
|
]
|
|
396
383
|
}
|
|
397
384
|
);
|
|
@@ -413,9 +400,9 @@ function X({ size, style, ...others }) {
|
|
|
413
400
|
style: { width: size, height: size, ...style },
|
|
414
401
|
...others,
|
|
415
402
|
children: [
|
|
416
|
-
/* @__PURE__ */
|
|
417
|
-
/* @__PURE__ */
|
|
418
|
-
/* @__PURE__ */
|
|
403
|
+
/* @__PURE__ */ jsx5("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
|
|
404
|
+
/* @__PURE__ */ jsx5("path", { d: "M18 6l-12 12" }),
|
|
405
|
+
/* @__PURE__ */ jsx5("path", { d: "M6 6l12 12" })
|
|
419
406
|
]
|
|
420
407
|
}
|
|
421
408
|
);
|
|
@@ -437,55 +424,21 @@ function ExclamationCircle({ size, style, ...others }) {
|
|
|
437
424
|
style: { width: size, height: size, ...style },
|
|
438
425
|
...others,
|
|
439
426
|
children: [
|
|
440
|
-
/* @__PURE__ */
|
|
441
|
-
/* @__PURE__ */
|
|
442
|
-
/* @__PURE__ */
|
|
427
|
+
/* @__PURE__ */ jsx5("path", { d: "M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" }),
|
|
428
|
+
/* @__PURE__ */ jsx5("path", { d: "M12 9v4" }),
|
|
429
|
+
/* @__PURE__ */ jsx5("path", { d: "M12 16v.01" })
|
|
443
430
|
]
|
|
444
431
|
}
|
|
445
432
|
);
|
|
446
433
|
}
|
|
447
434
|
|
|
448
|
-
// src/templates/ErrorList.tsx
|
|
449
|
-
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
450
|
-
function ErrorList({
|
|
451
|
-
errors,
|
|
452
|
-
registry
|
|
453
|
-
}) {
|
|
454
|
-
const { translateString } = registry;
|
|
455
|
-
return /* @__PURE__ */ jsx7(
|
|
456
|
-
Alert,
|
|
457
|
-
{
|
|
458
|
-
color: "red",
|
|
459
|
-
variant: "transparent",
|
|
460
|
-
title: /* @__PURE__ */ jsx7(Title2, { order: 5, fw: "normal", children: translateString(TranslatableString.ErrorsLabel) }),
|
|
461
|
-
icon: /* @__PURE__ */ jsx7(ExclamationCircle, {}),
|
|
462
|
-
children: /* @__PURE__ */ jsx7(List, { children: errors.map((error, index) => /* @__PURE__ */ jsx7(List.Item, { c: "red", children: error.stack }, `error-${index}`)) })
|
|
463
|
-
}
|
|
464
|
-
);
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
// src/templates/ButtonTemplates/SubmitButton.tsx
|
|
468
|
-
import { Button } from "@mantine/core";
|
|
469
|
-
import { getSubmitButtonOptions } from "@rjsf/utils";
|
|
470
|
-
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
471
|
-
function SubmitButton({ uiSchema }) {
|
|
472
|
-
const { submitText, norender, props: submitButtonProps = {} } = getSubmitButtonOptions(uiSchema);
|
|
473
|
-
if (norender) {
|
|
474
|
-
return null;
|
|
475
|
-
}
|
|
476
|
-
return /* @__PURE__ */ jsx8(Button, { type: "submit", variant: "filled", ...submitButtonProps, children: submitText });
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
// src/templates/ButtonTemplates/AddButton.tsx
|
|
480
|
-
import { TranslatableString as TranslatableString3 } from "@rjsf/utils";
|
|
481
|
-
|
|
482
435
|
// src/templates/ButtonTemplates/IconButton.tsx
|
|
483
436
|
import { ActionIcon } from "@mantine/core";
|
|
484
|
-
import { TranslatableString
|
|
485
|
-
import { jsx as
|
|
437
|
+
import { TranslatableString } from "@rjsf/utils";
|
|
438
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
486
439
|
function IconButton(props) {
|
|
487
440
|
const { icon, iconType = "sm", color, onClick, uiSchema, registry, ...otherProps } = props;
|
|
488
|
-
return /* @__PURE__ */
|
|
441
|
+
return /* @__PURE__ */ jsx6(
|
|
489
442
|
ActionIcon,
|
|
490
443
|
{
|
|
491
444
|
size: iconType,
|
|
@@ -500,19 +453,19 @@ function CopyButton(props) {
|
|
|
500
453
|
const {
|
|
501
454
|
registry: { translateString }
|
|
502
455
|
} = props;
|
|
503
|
-
return /* @__PURE__ */
|
|
456
|
+
return /* @__PURE__ */ jsx6(IconButton, { title: translateString(TranslatableString.CopyButton), variant: "subtle", ...props, icon: /* @__PURE__ */ jsx6(Copy, {}) });
|
|
504
457
|
}
|
|
505
458
|
function MoveDownButton(props) {
|
|
506
459
|
const {
|
|
507
460
|
registry: { translateString }
|
|
508
461
|
} = props;
|
|
509
|
-
return /* @__PURE__ */
|
|
462
|
+
return /* @__PURE__ */ jsx6(
|
|
510
463
|
IconButton,
|
|
511
464
|
{
|
|
512
|
-
title: translateString(
|
|
465
|
+
title: translateString(TranslatableString.MoveDownButton),
|
|
513
466
|
variant: "subtle",
|
|
514
467
|
...props,
|
|
515
|
-
icon: /* @__PURE__ */
|
|
468
|
+
icon: /* @__PURE__ */ jsx6(ChevronDown, {})
|
|
516
469
|
}
|
|
517
470
|
);
|
|
518
471
|
}
|
|
@@ -520,13 +473,13 @@ function MoveUpButton(props) {
|
|
|
520
473
|
const {
|
|
521
474
|
registry: { translateString }
|
|
522
475
|
} = props;
|
|
523
|
-
return /* @__PURE__ */
|
|
476
|
+
return /* @__PURE__ */ jsx6(
|
|
524
477
|
IconButton,
|
|
525
478
|
{
|
|
526
|
-
title: translateString(
|
|
479
|
+
title: translateString(TranslatableString.MoveUpButton),
|
|
527
480
|
variant: "subtle",
|
|
528
481
|
...props,
|
|
529
|
-
icon: /* @__PURE__ */
|
|
482
|
+
icon: /* @__PURE__ */ jsx6(ChevronUp, {})
|
|
530
483
|
}
|
|
531
484
|
);
|
|
532
485
|
}
|
|
@@ -534,14 +487,14 @@ function RemoveButton(props) {
|
|
|
534
487
|
const {
|
|
535
488
|
registry: { translateString }
|
|
536
489
|
} = props;
|
|
537
|
-
return /* @__PURE__ */
|
|
490
|
+
return /* @__PURE__ */ jsx6(
|
|
538
491
|
IconButton,
|
|
539
492
|
{
|
|
540
|
-
title: translateString(
|
|
493
|
+
title: translateString(TranslatableString.RemoveButton),
|
|
541
494
|
variant: "subtle",
|
|
542
495
|
color: "red",
|
|
543
496
|
...props,
|
|
544
|
-
icon: /* @__PURE__ */
|
|
497
|
+
icon: /* @__PURE__ */ jsx6(X, {})
|
|
545
498
|
}
|
|
546
499
|
);
|
|
547
500
|
}
|
|
@@ -549,16 +502,28 @@ function ClearButton(props) {
|
|
|
549
502
|
const {
|
|
550
503
|
registry: { translateString }
|
|
551
504
|
} = props;
|
|
552
|
-
return /* @__PURE__ */
|
|
505
|
+
return /* @__PURE__ */ jsx6(IconButton, { title: translateString(TranslatableString.ClearButton), variant: "subtle", ...props, icon: /* @__PURE__ */ jsx6(X, {}) });
|
|
553
506
|
}
|
|
554
507
|
|
|
555
508
|
// src/templates/ButtonTemplates/AddButton.tsx
|
|
556
|
-
import { jsx as
|
|
509
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
557
510
|
function AddButton(props) {
|
|
558
511
|
const {
|
|
559
512
|
registry: { translateString }
|
|
560
513
|
} = props;
|
|
561
|
-
return /* @__PURE__ */
|
|
514
|
+
return /* @__PURE__ */ jsx7(IconButton, { title: translateString(TranslatableString2.AddItemButton), variant: "subtle", ...props, icon: /* @__PURE__ */ jsx7(Plus, {}) });
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
// src/templates/ButtonTemplates/SubmitButton.tsx
|
|
518
|
+
import { Button } from "@mantine/core";
|
|
519
|
+
import { getSubmitButtonOptions } from "@rjsf/utils";
|
|
520
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
521
|
+
function SubmitButton({ uiSchema }) {
|
|
522
|
+
const { submitText, norender, props: submitButtonProps = {} } = getSubmitButtonOptions(uiSchema);
|
|
523
|
+
if (norender) {
|
|
524
|
+
return null;
|
|
525
|
+
}
|
|
526
|
+
return /* @__PURE__ */ jsx8(Button, { type: "submit", variant: "filled", ...submitButtonProps, children: submitText });
|
|
562
527
|
}
|
|
563
528
|
|
|
564
529
|
// src/templates/ButtonTemplates/index.ts
|
|
@@ -575,9 +540,42 @@ function buttonTemplates() {
|
|
|
575
540
|
}
|
|
576
541
|
var ButtonTemplates_default = buttonTemplates;
|
|
577
542
|
|
|
543
|
+
// src/templates/DescriptionField.tsx
|
|
544
|
+
import { Text } from "@mantine/core";
|
|
545
|
+
import { RichDescription } from "@rjsf/core";
|
|
546
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
547
|
+
function DescriptionField(props) {
|
|
548
|
+
const { id, description, registry, uiSchema } = props;
|
|
549
|
+
if (description) {
|
|
550
|
+
return /* @__PURE__ */ jsx9(Text, { id, mt: 3, mb: "sm", children: /* @__PURE__ */ jsx9(RichDescription, { description, registry, uiSchema }) });
|
|
551
|
+
}
|
|
552
|
+
return null;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
// src/templates/ErrorList.tsx
|
|
556
|
+
import { Alert, Title as Title2, List } from "@mantine/core";
|
|
557
|
+
import { TranslatableString as TranslatableString3 } from "@rjsf/utils";
|
|
558
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
559
|
+
function ErrorList({
|
|
560
|
+
errors,
|
|
561
|
+
registry
|
|
562
|
+
}) {
|
|
563
|
+
const { translateString } = registry;
|
|
564
|
+
return /* @__PURE__ */ jsx10(
|
|
565
|
+
Alert,
|
|
566
|
+
{
|
|
567
|
+
color: "red",
|
|
568
|
+
variant: "transparent",
|
|
569
|
+
title: /* @__PURE__ */ jsx10(Title2, { order: 5, fw: "normal", children: translateString(TranslatableString3.ErrorsLabel) }),
|
|
570
|
+
icon: /* @__PURE__ */ jsx10(ExclamationCircle, {}),
|
|
571
|
+
children: /* @__PURE__ */ jsx10(List, { children: errors.map((error, index) => /* @__PURE__ */ jsx10(List.Item, { c: "red", children: error.stack }, `error-${index}`)) })
|
|
572
|
+
}
|
|
573
|
+
);
|
|
574
|
+
}
|
|
575
|
+
|
|
578
576
|
// src/templates/FieldErrorTemplate.tsx
|
|
579
|
-
import { errorId } from "@rjsf/utils";
|
|
580
577
|
import { Box as Box3, List as List2 } from "@mantine/core";
|
|
578
|
+
import { errorId } from "@rjsf/utils";
|
|
581
579
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
582
580
|
function FieldErrorTemplate({ errors, fieldPathId }) {
|
|
583
581
|
if (!errors || !errors.length) {
|
|
@@ -587,13 +585,26 @@ function FieldErrorTemplate({ errors, fieldPathId }) {
|
|
|
587
585
|
return /* @__PURE__ */ jsx11(Box3, { id, c: "red", display: "none", children: /* @__PURE__ */ jsx11(List2, { children: errors.map((error, index) => /* @__PURE__ */ jsx11(List2.Item, { children: error }, `field-error-${index}`)) }) });
|
|
588
586
|
}
|
|
589
587
|
|
|
588
|
+
// src/templates/FieldHelpTemplate.tsx
|
|
589
|
+
import { Text as Text2 } from "@mantine/core";
|
|
590
|
+
import { RichHelp } from "@rjsf/core";
|
|
591
|
+
import { helpId } from "@rjsf/utils";
|
|
592
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
593
|
+
function FieldHelpTemplate(props) {
|
|
594
|
+
const { fieldPathId, help, uiSchema, registry } = props;
|
|
595
|
+
if (!help) {
|
|
596
|
+
return null;
|
|
597
|
+
}
|
|
598
|
+
return /* @__PURE__ */ jsx12(Text2, { id: helpId(fieldPathId), size: "sm", my: "xs", c: "dimmed", children: /* @__PURE__ */ jsx12(RichHelp, { help, registry, uiSchema }) });
|
|
599
|
+
}
|
|
600
|
+
|
|
590
601
|
// src/templates/FieldTemplate.tsx
|
|
591
602
|
import { Box as Box4 } from "@mantine/core";
|
|
592
603
|
import {
|
|
593
604
|
getTemplate as getTemplate3,
|
|
594
605
|
getUiOptions as getUiOptions4
|
|
595
606
|
} from "@rjsf/utils";
|
|
596
|
-
import { jsx as
|
|
607
|
+
import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
597
608
|
function FieldTemplate(props) {
|
|
598
609
|
const {
|
|
599
610
|
id,
|
|
@@ -619,7 +630,7 @@ function FieldTemplate(props) {
|
|
|
619
630
|
uiOptions
|
|
620
631
|
);
|
|
621
632
|
if (hidden) {
|
|
622
|
-
return /* @__PURE__ */
|
|
633
|
+
return /* @__PURE__ */ jsx13(Box4, { display: "none", children });
|
|
623
634
|
}
|
|
624
635
|
return /* @__PURE__ */ jsxs6(
|
|
625
636
|
WrapIfAdditionalTemplate2,
|
|
@@ -643,19 +654,6 @@ function FieldTemplate(props) {
|
|
|
643
654
|
);
|
|
644
655
|
}
|
|
645
656
|
|
|
646
|
-
// src/templates/FieldHelpTemplate.tsx
|
|
647
|
-
import { helpId } from "@rjsf/utils";
|
|
648
|
-
import { Text as Text2 } from "@mantine/core";
|
|
649
|
-
import { RichHelp } from "@rjsf/core";
|
|
650
|
-
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
651
|
-
function FieldHelpTemplate(props) {
|
|
652
|
-
const { fieldPathId, help, uiSchema, registry } = props;
|
|
653
|
-
if (!help) {
|
|
654
|
-
return null;
|
|
655
|
-
}
|
|
656
|
-
return /* @__PURE__ */ jsx13(Text2, { id: helpId(fieldPathId), size: "sm", my: "xs", c: "dimmed", children: /* @__PURE__ */ jsx13(RichHelp, { help, registry, uiSchema }) });
|
|
657
|
-
}
|
|
658
|
-
|
|
659
657
|
// src/templates/GridTemplate.tsx
|
|
660
658
|
import { Container, Grid as Grid2 } from "@mantine/core";
|
|
661
659
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
@@ -670,6 +668,16 @@ function GridTemplate(props) {
|
|
|
670
668
|
return /* @__PURE__ */ jsx14(Grid2, { grow: true, ...rest, children });
|
|
671
669
|
}
|
|
672
670
|
|
|
671
|
+
// src/templates/MultiSchemaFieldTemplate.tsx
|
|
672
|
+
import { Stack } from "@mantine/core";
|
|
673
|
+
import { jsxs as jsxs7 } from "react/jsx-runtime";
|
|
674
|
+
function MultiSchemaFieldTemplate({ selector, optionSchemaField }) {
|
|
675
|
+
return /* @__PURE__ */ jsxs7(Stack, { style: { marginBottom: "1rem" }, children: [
|
|
676
|
+
selector,
|
|
677
|
+
optionSchemaField
|
|
678
|
+
] });
|
|
679
|
+
}
|
|
680
|
+
|
|
673
681
|
// src/templates/ObjectFieldTemplate.tsx
|
|
674
682
|
import { Box as Box5, Container as Container2, Group as Group3, SimpleGrid } from "@mantine/core";
|
|
675
683
|
import {
|
|
@@ -680,7 +688,7 @@ import {
|
|
|
680
688
|
getUiOptions as getUiOptions5,
|
|
681
689
|
titleId as titleId2
|
|
682
690
|
} from "@rjsf/utils";
|
|
683
|
-
import { jsx as jsx15, jsxs as
|
|
691
|
+
import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
684
692
|
function ObjectFieldTemplate(props) {
|
|
685
693
|
const {
|
|
686
694
|
title,
|
|
@@ -711,7 +719,7 @@ function ObjectFieldTemplate(props) {
|
|
|
711
719
|
const gridCols = typeof uiOptions?.gridCols === "number" && uiOptions?.gridCols || void 0;
|
|
712
720
|
const gridSpacing = uiOptions?.gridSpacing;
|
|
713
721
|
const gridVerticalSpacing = uiOptions?.gridVerticalSpacing;
|
|
714
|
-
return /* @__PURE__ */
|
|
722
|
+
return /* @__PURE__ */ jsxs8(Container2, { id: fieldPathId.$id, p: 0, children: [
|
|
715
723
|
title && /* @__PURE__ */ jsx15(
|
|
716
724
|
TitleFieldTemplate,
|
|
717
725
|
{
|
|
@@ -734,7 +742,7 @@ function ObjectFieldTemplate(props) {
|
|
|
734
742
|
registry
|
|
735
743
|
}
|
|
736
744
|
),
|
|
737
|
-
/* @__PURE__ */
|
|
745
|
+
/* @__PURE__ */ jsxs8(
|
|
738
746
|
SimpleGrid,
|
|
739
747
|
{
|
|
740
748
|
cols: gridCols,
|
|
@@ -795,12 +803,12 @@ function OptionalDataControlsTemplate(props) {
|
|
|
795
803
|
|
|
796
804
|
// src/templates/TitleField.tsx
|
|
797
805
|
import { Grid as Grid3, Title as Title3 } from "@mantine/core";
|
|
798
|
-
import { jsx as jsx17, jsxs as
|
|
806
|
+
import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
799
807
|
function TitleField(props) {
|
|
800
808
|
const { id, title, optionalDataControl } = props;
|
|
801
809
|
let heading = title ? /* @__PURE__ */ jsx17(Title3, { id, order: 3, fw: "normal", children: title }) : null;
|
|
802
810
|
if (optionalDataControl) {
|
|
803
|
-
heading = /* @__PURE__ */
|
|
811
|
+
heading = /* @__PURE__ */ jsxs9(Grid3, { children: [
|
|
804
812
|
/* @__PURE__ */ jsx17(Grid3.Col, { span: "auto", children: heading }),
|
|
805
813
|
/* @__PURE__ */ jsx17(Grid3.Col, { span: "content", children: optionalDataControl })
|
|
806
814
|
] });
|
|
@@ -809,14 +817,14 @@ function TitleField(props) {
|
|
|
809
817
|
}
|
|
810
818
|
|
|
811
819
|
// src/templates/WrapIfAdditionalTemplate.tsx
|
|
820
|
+
import { Flex as Flex2, Grid as Grid4, TextInput as TextInput2 } from "@mantine/core";
|
|
812
821
|
import {
|
|
813
822
|
ADDITIONAL_PROPERTY_FLAG,
|
|
814
823
|
UI_OPTIONS_KEY,
|
|
815
824
|
buttonId as buttonId3,
|
|
816
825
|
TranslatableString as TranslatableString4
|
|
817
826
|
} from "@rjsf/utils";
|
|
818
|
-
import {
|
|
819
|
-
import { jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
827
|
+
import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
820
828
|
function WrapIfAdditionalTemplate(props) {
|
|
821
829
|
const {
|
|
822
830
|
id,
|
|
@@ -847,8 +855,8 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
847
855
|
...uiSchema,
|
|
848
856
|
[UI_OPTIONS_KEY]: { ...uiOptions, block: true }
|
|
849
857
|
};
|
|
850
|
-
return /* @__PURE__ */ jsx18("div", { className: classNames, style, children: /* @__PURE__ */
|
|
851
|
-
/* @__PURE__ */
|
|
858
|
+
return /* @__PURE__ */ jsx18("div", { className: classNames, style, children: /* @__PURE__ */ jsxs10(Flex2, { gap: "xs", align: "end", justify: "center", children: [
|
|
859
|
+
/* @__PURE__ */ jsxs10(Grid4, { w: "100%", align: "center", children: [
|
|
852
860
|
/* @__PURE__ */ jsx18(Grid4.Col, { span: 6, className: "form-additional", children: /* @__PURE__ */ jsx18(
|
|
853
861
|
TextInput2,
|
|
854
862
|
{
|
|
@@ -881,16 +889,6 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
881
889
|
] }) });
|
|
882
890
|
}
|
|
883
891
|
|
|
884
|
-
// src/templates/MultiSchemaFieldTemplate.tsx
|
|
885
|
-
import { Stack } from "@mantine/core";
|
|
886
|
-
import { jsxs as jsxs10 } from "react/jsx-runtime";
|
|
887
|
-
function MultiSchemaFieldTemplate({ selector, optionSchemaField }) {
|
|
888
|
-
return /* @__PURE__ */ jsxs10(Stack, { style: { marginBottom: "1rem" }, children: [
|
|
889
|
-
selector,
|
|
890
|
-
optionSchemaField
|
|
891
|
-
] });
|
|
892
|
-
}
|
|
893
|
-
|
|
894
892
|
// src/templates/index.ts
|
|
895
893
|
function generateTemplates() {
|
|
896
894
|
return {
|
|
@@ -918,86 +916,24 @@ var templates_default = generateTemplates();
|
|
|
918
916
|
import dayjs2 from "dayjs";
|
|
919
917
|
import customParseFormat from "dayjs/plugin/customParseFormat";
|
|
920
918
|
|
|
921
|
-
// src/widgets/
|
|
922
|
-
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
923
|
-
function AltDateTimeWidget(props) {
|
|
924
|
-
const { AltDateWidget: AltDateWidget2 } = props.registry.widgets;
|
|
925
|
-
return /* @__PURE__ */ jsx19(AltDateWidget2, { time: true, ...props });
|
|
926
|
-
}
|
|
927
|
-
|
|
928
|
-
// src/widgets/DateTime/AltDateWidget.tsx
|
|
929
|
-
import {
|
|
930
|
-
ariaDescribedByIds as ariaDescribedByIds2,
|
|
931
|
-
dateRangeOptions,
|
|
932
|
-
titleId as titleId3,
|
|
933
|
-
TranslatableString as TranslatableString5,
|
|
934
|
-
useAltDateWidgetProps
|
|
935
|
-
} from "@rjsf/utils";
|
|
936
|
-
import { Flex as Flex3, Box as Box6, Group as Group4, Button as Button2, Select, Input } from "@mantine/core";
|
|
937
|
-
import { Fragment as Fragment2, jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
938
|
-
function AltDateWidget(props) {
|
|
939
|
-
const { id, required, disabled, readonly, label, hideLabel, rawErrors, options, registry } = props;
|
|
940
|
-
const { translateString } = registry;
|
|
941
|
-
const { elements, handleChange, handleClear, handleSetNow } = useAltDateWidgetProps(props);
|
|
942
|
-
return /* @__PURE__ */ jsxs11(Fragment2, { children: [
|
|
943
|
-
!hideLabel && !!label && /* @__PURE__ */ jsx20(Input.Label, { id: titleId3(id), required, children: label }),
|
|
944
|
-
/* @__PURE__ */ jsxs11(Flex3, { gap: "xs", align: "center", wrap: "nowrap", children: [
|
|
945
|
-
elements.map((elemProps, i) => {
|
|
946
|
-
const elemId = `${id}_${elemProps.type}`;
|
|
947
|
-
return /* @__PURE__ */ jsx20(Box6, { children: /* @__PURE__ */ jsx20(
|
|
948
|
-
Select,
|
|
949
|
-
{
|
|
950
|
-
id: elemId,
|
|
951
|
-
name: elemId,
|
|
952
|
-
placeholder: elemProps.type,
|
|
953
|
-
disabled: disabled || readonly,
|
|
954
|
-
data: dateRangeOptions(elemProps.range[0], elemProps.range[1]).map((item) => item.value.toString()),
|
|
955
|
-
value: !elemProps.value || elemProps.value < 0 ? null : elemProps.value.toString(),
|
|
956
|
-
onChange: (v) => handleChange(elemProps.type, v || void 0),
|
|
957
|
-
searchable: false,
|
|
958
|
-
allowDeselect: false,
|
|
959
|
-
comboboxProps: { withinPortal: false },
|
|
960
|
-
"aria-describedby": ariaDescribedByIds2(elemId)
|
|
961
|
-
}
|
|
962
|
-
) }, i);
|
|
963
|
-
}),
|
|
964
|
-
/* @__PURE__ */ jsxs11(Group4, { wrap: "nowrap", gap: 3, children: [
|
|
965
|
-
(options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /* @__PURE__ */ jsx20(Button2, { variant: "subtle", size: "xs", onClick: handleSetNow, children: translateString(TranslatableString5.NowLabel) }),
|
|
966
|
-
(options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /* @__PURE__ */ jsx20(Button2, { variant: "subtle", size: "xs", onClick: handleClear, children: translateString(TranslatableString5.ClearLabel) })
|
|
967
|
-
] })
|
|
968
|
-
] }),
|
|
969
|
-
rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => /* @__PURE__ */ jsx20(Input.Error, { children: error }, `alt-date-widget-input-errors-${index}`))
|
|
970
|
-
] });
|
|
971
|
-
}
|
|
972
|
-
|
|
973
|
-
// src/widgets/DateTime/DateTimeInput.tsx
|
|
919
|
+
// src/widgets/CheckboxesWidget.tsx
|
|
974
920
|
import { useCallback as useCallback2 } from "react";
|
|
921
|
+
import { Checkbox, Flex as Flex3, Input } from "@mantine/core";
|
|
975
922
|
import {
|
|
976
|
-
ariaDescribedByIds as
|
|
977
|
-
|
|
923
|
+
ariaDescribedByIds as ariaDescribedByIds2,
|
|
924
|
+
enumOptionValueDecoder,
|
|
925
|
+
enumOptionValueEncoder,
|
|
926
|
+
enumOptionsIndexForValue,
|
|
927
|
+
getOptionValueFormat,
|
|
928
|
+
optionId,
|
|
929
|
+
titleId as titleId3
|
|
978
930
|
} from "@rjsf/utils";
|
|
979
|
-
import
|
|
980
|
-
|
|
981
|
-
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
982
|
-
var dateParser = (input, format) => {
|
|
983
|
-
if (!input) {
|
|
984
|
-
return null;
|
|
985
|
-
}
|
|
986
|
-
const d = dayjs(input, format);
|
|
987
|
-
return d.isValid() ? d.toDate() : null;
|
|
988
|
-
};
|
|
989
|
-
var dateFormat = (date, format) => {
|
|
990
|
-
if (!date) {
|
|
991
|
-
return "";
|
|
992
|
-
}
|
|
993
|
-
return dayjs(date).format(format || "YYYY-MM-DD");
|
|
994
|
-
};
|
|
995
|
-
function DateTimeInput(props) {
|
|
931
|
+
import { Fragment as Fragment2, jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
932
|
+
function CheckboxesWidget(props) {
|
|
996
933
|
const {
|
|
997
934
|
id,
|
|
998
|
-
|
|
935
|
+
htmlName,
|
|
999
936
|
value,
|
|
1000
|
-
placeholder,
|
|
1001
937
|
required,
|
|
1002
938
|
disabled,
|
|
1003
939
|
readonly,
|
|
@@ -1008,202 +944,28 @@ function DateTimeInput(props) {
|
|
|
1008
944
|
options,
|
|
1009
945
|
onChange,
|
|
1010
946
|
onBlur,
|
|
1011
|
-
onFocus
|
|
1012
|
-
valueFormat,
|
|
1013
|
-
displayFormat
|
|
947
|
+
onFocus
|
|
1014
948
|
} = props;
|
|
949
|
+
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
950
|
+
const optionValueFormat = getOptionValueFormat(options);
|
|
951
|
+
const themeProps = cleanupOptions(options);
|
|
1015
952
|
const handleChange = useCallback2(
|
|
1016
953
|
(nextValue) => {
|
|
1017
|
-
|
|
954
|
+
if (!disabled && !readonly && onChange) {
|
|
955
|
+
onChange(enumOptionValueDecoder(nextValue, enumOptions, optionValueFormat, emptyValue));
|
|
956
|
+
}
|
|
1018
957
|
},
|
|
1019
|
-
[onChange,
|
|
958
|
+
[onChange, disabled, readonly, enumOptions, emptyValue, optionValueFormat]
|
|
1020
959
|
);
|
|
1021
|
-
const handleBlur = useCallback2(
|
|
1022
|
-
|
|
1023
|
-
onBlur
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
onFocus(id, value);
|
|
1029
|
-
}
|
|
1030
|
-
}, [onFocus, id, value]);
|
|
1031
|
-
return /* @__PURE__ */ jsx21(
|
|
1032
|
-
DateInput,
|
|
1033
|
-
{
|
|
1034
|
-
id,
|
|
1035
|
-
name,
|
|
1036
|
-
value: dateParser(value, valueFormat),
|
|
1037
|
-
dateParser: (v) => dateParser(v, displayFormat),
|
|
1038
|
-
placeholder: placeholder || void 0,
|
|
1039
|
-
required,
|
|
1040
|
-
disabled: disabled || readonly,
|
|
1041
|
-
autoFocus: autofocus,
|
|
1042
|
-
label: labelValue2(label || void 0, hideLabel, false),
|
|
1043
|
-
onChange: handleChange,
|
|
1044
|
-
onBlur: handleBlur,
|
|
1045
|
-
onFocus: handleFocus,
|
|
1046
|
-
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1047
|
-
...options,
|
|
1048
|
-
"aria-describedby": ariaDescribedByIds3(id),
|
|
1049
|
-
popoverProps: { withinPortal: false },
|
|
1050
|
-
classNames: typeof options?.classNames === "object" ? options.classNames : void 0,
|
|
1051
|
-
valueFormat: displayFormat
|
|
1052
|
-
}
|
|
960
|
+
const handleBlur = useCallback2(
|
|
961
|
+
({ target }) => {
|
|
962
|
+
if (onBlur) {
|
|
963
|
+
onBlur(id, enumOptionValueDecoder(target.value, enumOptions, optionValueFormat, emptyValue));
|
|
964
|
+
}
|
|
965
|
+
},
|
|
966
|
+
[onBlur, id, enumOptions, emptyValue, optionValueFormat]
|
|
1053
967
|
);
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
// src/widgets/DateTime/DateWidget.tsx
|
|
1057
|
-
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1058
|
-
function DateWidget(props) {
|
|
1059
|
-
const { valueFormat = "YYYY-MM-DD", displayFormat, ...otherOptions } = props.options;
|
|
1060
|
-
return /* @__PURE__ */ jsx22(
|
|
1061
|
-
DateTimeInput,
|
|
1062
|
-
{
|
|
1063
|
-
...props,
|
|
1064
|
-
options: otherOptions,
|
|
1065
|
-
valueFormat,
|
|
1066
|
-
displayFormat: displayFormat || valueFormat
|
|
1067
|
-
}
|
|
1068
|
-
);
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
|
-
// src/widgets/DateTime/DateTimeWidget.tsx
|
|
1072
|
-
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1073
|
-
function DateTimeWidget(props) {
|
|
1074
|
-
const { valueFormat = "YYYY-MM-DD HH:mm:ss", displayFormat, ...otherOptions } = props.options;
|
|
1075
|
-
return /* @__PURE__ */ jsx23(
|
|
1076
|
-
DateTimeInput,
|
|
1077
|
-
{
|
|
1078
|
-
...props,
|
|
1079
|
-
options: otherOptions,
|
|
1080
|
-
valueFormat,
|
|
1081
|
-
displayFormat: displayFormat || valueFormat
|
|
1082
|
-
}
|
|
1083
|
-
);
|
|
1084
|
-
}
|
|
1085
|
-
|
|
1086
|
-
// src/widgets/DateTime/TimeWidget.tsx
|
|
1087
|
-
import { useCallback as useCallback3 } from "react";
|
|
1088
|
-
import {
|
|
1089
|
-
labelValue as labelValue3,
|
|
1090
|
-
ariaDescribedByIds as ariaDescribedByIds4
|
|
1091
|
-
} from "@rjsf/utils";
|
|
1092
|
-
import { TimeInput } from "@mantine/dates";
|
|
1093
|
-
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1094
|
-
function TimeWidget(props) {
|
|
1095
|
-
const {
|
|
1096
|
-
id,
|
|
1097
|
-
name,
|
|
1098
|
-
value,
|
|
1099
|
-
placeholder,
|
|
1100
|
-
required,
|
|
1101
|
-
disabled,
|
|
1102
|
-
readonly,
|
|
1103
|
-
autofocus,
|
|
1104
|
-
label,
|
|
1105
|
-
hideLabel,
|
|
1106
|
-
rawErrors,
|
|
1107
|
-
options,
|
|
1108
|
-
onChange,
|
|
1109
|
-
onBlur,
|
|
1110
|
-
onFocus
|
|
1111
|
-
} = props;
|
|
1112
|
-
const emptyValue = options.emptyValue || "";
|
|
1113
|
-
const handleChange = useCallback3(
|
|
1114
|
-
(e) => {
|
|
1115
|
-
onChange(e.target.value === "" ? emptyValue : e.target.value);
|
|
1116
|
-
},
|
|
1117
|
-
[onChange, emptyValue]
|
|
1118
|
-
);
|
|
1119
|
-
const handleBlur = useCallback3(
|
|
1120
|
-
({ target }) => {
|
|
1121
|
-
if (onBlur) {
|
|
1122
|
-
onBlur(id, target && target.value);
|
|
1123
|
-
}
|
|
1124
|
-
},
|
|
1125
|
-
[onBlur, id]
|
|
1126
|
-
);
|
|
1127
|
-
const handleFocus = useCallback3(
|
|
1128
|
-
({ target }) => {
|
|
1129
|
-
if (onFocus) {
|
|
1130
|
-
onFocus(id, target && target.value);
|
|
1131
|
-
}
|
|
1132
|
-
},
|
|
1133
|
-
[onFocus, id]
|
|
1134
|
-
);
|
|
1135
|
-
return /* @__PURE__ */ jsx24(
|
|
1136
|
-
TimeInput,
|
|
1137
|
-
{
|
|
1138
|
-
id,
|
|
1139
|
-
name,
|
|
1140
|
-
value: value || "",
|
|
1141
|
-
placeholder: placeholder || void 0,
|
|
1142
|
-
required,
|
|
1143
|
-
disabled: disabled || readonly,
|
|
1144
|
-
autoFocus: autofocus,
|
|
1145
|
-
label: labelValue3(label || void 0, hideLabel, false),
|
|
1146
|
-
onChange: handleChange,
|
|
1147
|
-
onBlur: handleBlur,
|
|
1148
|
-
onFocus: handleFocus,
|
|
1149
|
-
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1150
|
-
...options,
|
|
1151
|
-
"aria-describedby": ariaDescribedByIds4(id),
|
|
1152
|
-
classNames: typeof options?.classNames === "object" ? options.classNames : void 0
|
|
1153
|
-
}
|
|
1154
|
-
);
|
|
1155
|
-
}
|
|
1156
|
-
|
|
1157
|
-
// src/widgets/CheckboxesWidget.tsx
|
|
1158
|
-
import { useCallback as useCallback4 } from "react";
|
|
1159
|
-
import {
|
|
1160
|
-
ariaDescribedByIds as ariaDescribedByIds5,
|
|
1161
|
-
enumOptionValueDecoder,
|
|
1162
|
-
enumOptionValueEncoder,
|
|
1163
|
-
enumOptionsIndexForValue,
|
|
1164
|
-
getOptionValueFormat,
|
|
1165
|
-
optionId,
|
|
1166
|
-
titleId as titleId4
|
|
1167
|
-
} from "@rjsf/utils";
|
|
1168
|
-
import { Checkbox, Flex as Flex4, Input as Input2 } from "@mantine/core";
|
|
1169
|
-
import { Fragment as Fragment3, jsx as jsx25, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1170
|
-
function CheckboxesWidget(props) {
|
|
1171
|
-
const {
|
|
1172
|
-
id,
|
|
1173
|
-
htmlName,
|
|
1174
|
-
value,
|
|
1175
|
-
required,
|
|
1176
|
-
disabled,
|
|
1177
|
-
readonly,
|
|
1178
|
-
autofocus,
|
|
1179
|
-
label,
|
|
1180
|
-
hideLabel,
|
|
1181
|
-
rawErrors,
|
|
1182
|
-
options,
|
|
1183
|
-
onChange,
|
|
1184
|
-
onBlur,
|
|
1185
|
-
onFocus
|
|
1186
|
-
} = props;
|
|
1187
|
-
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
1188
|
-
const optionValueFormat = getOptionValueFormat(options);
|
|
1189
|
-
const themeProps = cleanupOptions(options);
|
|
1190
|
-
const handleChange = useCallback4(
|
|
1191
|
-
(nextValue) => {
|
|
1192
|
-
if (!disabled && !readonly && onChange) {
|
|
1193
|
-
onChange(enumOptionValueDecoder(nextValue, enumOptions, optionValueFormat, emptyValue));
|
|
1194
|
-
}
|
|
1195
|
-
},
|
|
1196
|
-
[onChange, disabled, readonly, enumOptions, emptyValue, optionValueFormat]
|
|
1197
|
-
);
|
|
1198
|
-
const handleBlur = useCallback4(
|
|
1199
|
-
({ target }) => {
|
|
1200
|
-
if (onBlur) {
|
|
1201
|
-
onBlur(id, enumOptionValueDecoder(target.value, enumOptions, optionValueFormat, emptyValue));
|
|
1202
|
-
}
|
|
1203
|
-
},
|
|
1204
|
-
[onBlur, id, enumOptions, emptyValue, optionValueFormat]
|
|
1205
|
-
);
|
|
1206
|
-
const handleFocus = useCallback4(
|
|
968
|
+
const handleFocus = useCallback2(
|
|
1207
969
|
({ target }) => {
|
|
1208
970
|
if (onFocus) {
|
|
1209
971
|
onFocus(id, enumOptionValueDecoder(target.value, enumOptions, optionValueFormat, emptyValue));
|
|
@@ -1212,9 +974,9 @@ function CheckboxesWidget(props) {
|
|
|
1212
974
|
[onFocus, id, enumOptions, emptyValue, optionValueFormat]
|
|
1213
975
|
);
|
|
1214
976
|
const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, true);
|
|
1215
|
-
return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */
|
|
1216
|
-
!hideLabel && !!label && /* @__PURE__ */
|
|
1217
|
-
/* @__PURE__ */
|
|
977
|
+
return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */ jsxs11(Fragment2, { children: [
|
|
978
|
+
!hideLabel && !!label && /* @__PURE__ */ jsx19(Input.Label, { id: titleId3(id), required, children: label }),
|
|
979
|
+
/* @__PURE__ */ jsx19(
|
|
1218
980
|
Checkbox.Group,
|
|
1219
981
|
{
|
|
1220
982
|
id,
|
|
@@ -1223,9 +985,9 @@ function CheckboxesWidget(props) {
|
|
|
1223
985
|
required,
|
|
1224
986
|
readOnly: disabled || readonly,
|
|
1225
987
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1226
|
-
"aria-describedby":
|
|
988
|
+
"aria-describedby": ariaDescribedByIds2(id),
|
|
1227
989
|
...themeProps,
|
|
1228
|
-
children: Array.isArray(enumOptions) ? /* @__PURE__ */
|
|
990
|
+
children: Array.isArray(enumOptions) ? /* @__PURE__ */ jsx19(Flex3, { mt: "xs", direction: inline ? "row" : "column", gap: "xs", wrap: "wrap", children: enumOptions.map((option, i) => /* @__PURE__ */ jsx19(
|
|
1229
991
|
Checkbox,
|
|
1230
992
|
{
|
|
1231
993
|
id: optionId(id, i),
|
|
@@ -1245,15 +1007,15 @@ function CheckboxesWidget(props) {
|
|
|
1245
1007
|
}
|
|
1246
1008
|
|
|
1247
1009
|
// src/widgets/CheckboxWidget.tsx
|
|
1248
|
-
import { useCallback as
|
|
1010
|
+
import { useCallback as useCallback3 } from "react";
|
|
1011
|
+
import { Checkbox as Checkbox2 } from "@mantine/core";
|
|
1249
1012
|
import {
|
|
1250
1013
|
descriptionId as descriptionId2,
|
|
1251
1014
|
getTemplate as getTemplate5,
|
|
1252
|
-
labelValue as
|
|
1253
|
-
ariaDescribedByIds as
|
|
1015
|
+
labelValue as labelValue2,
|
|
1016
|
+
ariaDescribedByIds as ariaDescribedByIds3
|
|
1254
1017
|
} from "@rjsf/utils";
|
|
1255
|
-
import {
|
|
1256
|
-
import { Fragment as Fragment4, jsx as jsx26, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1018
|
+
import { Fragment as Fragment3, jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1257
1019
|
function CheckboxWidget(props) {
|
|
1258
1020
|
const {
|
|
1259
1021
|
id,
|
|
@@ -1280,7 +1042,7 @@ function CheckboxWidget(props) {
|
|
|
1280
1042
|
registry,
|
|
1281
1043
|
options
|
|
1282
1044
|
);
|
|
1283
|
-
const handleCheckboxChange =
|
|
1045
|
+
const handleCheckboxChange = useCallback3(
|
|
1284
1046
|
(e) => {
|
|
1285
1047
|
if (!disabled && !readonly && onChange) {
|
|
1286
1048
|
onChange(e.currentTarget.checked);
|
|
@@ -1288,7 +1050,7 @@ function CheckboxWidget(props) {
|
|
|
1288
1050
|
},
|
|
1289
1051
|
[onChange, disabled, readonly]
|
|
1290
1052
|
);
|
|
1291
|
-
const handleBlur =
|
|
1053
|
+
const handleBlur = useCallback3(
|
|
1292
1054
|
({ target }) => {
|
|
1293
1055
|
if (onBlur) {
|
|
1294
1056
|
onBlur(id, target.checked);
|
|
@@ -1296,7 +1058,7 @@ function CheckboxWidget(props) {
|
|
|
1296
1058
|
},
|
|
1297
1059
|
[onBlur, id]
|
|
1298
1060
|
);
|
|
1299
|
-
const handleFocus =
|
|
1061
|
+
const handleFocus = useCallback3(
|
|
1300
1062
|
({ target }) => {
|
|
1301
1063
|
if (onFocus) {
|
|
1302
1064
|
onFocus(id, target.checked);
|
|
@@ -1305,8 +1067,8 @@ function CheckboxWidget(props) {
|
|
|
1305
1067
|
[onFocus, id]
|
|
1306
1068
|
);
|
|
1307
1069
|
const description = options.description || schema.description;
|
|
1308
|
-
return /* @__PURE__ */
|
|
1309
|
-
!hideLabel && !!description && /* @__PURE__ */
|
|
1070
|
+
return /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
1071
|
+
!hideLabel && !!description && /* @__PURE__ */ jsx20(
|
|
1310
1072
|
DescriptionFieldTemplate,
|
|
1311
1073
|
{
|
|
1312
1074
|
id: descriptionId2(id),
|
|
@@ -1316,12 +1078,12 @@ function CheckboxWidget(props) {
|
|
|
1316
1078
|
registry
|
|
1317
1079
|
}
|
|
1318
1080
|
),
|
|
1319
|
-
/* @__PURE__ */
|
|
1081
|
+
/* @__PURE__ */ jsx20(
|
|
1320
1082
|
Checkbox2,
|
|
1321
1083
|
{
|
|
1322
1084
|
id,
|
|
1323
1085
|
name: htmlName || name,
|
|
1324
|
-
label:
|
|
1086
|
+
label: labelValue2(label || void 0, hideLabel, false),
|
|
1325
1087
|
disabled: disabled || readonly,
|
|
1326
1088
|
required,
|
|
1327
1089
|
autoFocus: autofocus,
|
|
@@ -1330,20 +1092,20 @@ function CheckboxWidget(props) {
|
|
|
1330
1092
|
onBlur: handleBlur,
|
|
1331
1093
|
onFocus: handleFocus,
|
|
1332
1094
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1333
|
-
"aria-describedby":
|
|
1095
|
+
"aria-describedby": ariaDescribedByIds3(id)
|
|
1334
1096
|
}
|
|
1335
1097
|
)
|
|
1336
1098
|
] });
|
|
1337
1099
|
}
|
|
1338
1100
|
|
|
1339
1101
|
// src/widgets/ColorWidget.tsx
|
|
1340
|
-
import { useCallback as
|
|
1102
|
+
import { useCallback as useCallback4 } from "react";
|
|
1103
|
+
import { ColorInput } from "@mantine/core";
|
|
1341
1104
|
import {
|
|
1342
|
-
labelValue as
|
|
1343
|
-
ariaDescribedByIds as
|
|
1105
|
+
labelValue as labelValue3,
|
|
1106
|
+
ariaDescribedByIds as ariaDescribedByIds4
|
|
1344
1107
|
} from "@rjsf/utils";
|
|
1345
|
-
import {
|
|
1346
|
-
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1108
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1347
1109
|
function ColorWidget(props) {
|
|
1348
1110
|
const {
|
|
1349
1111
|
id,
|
|
@@ -1363,12 +1125,248 @@ function ColorWidget(props) {
|
|
|
1363
1125
|
onFocus
|
|
1364
1126
|
} = props;
|
|
1365
1127
|
const themeProps = cleanupOptions(options);
|
|
1366
|
-
const handleChange =
|
|
1128
|
+
const handleChange = useCallback4(
|
|
1367
1129
|
(nextValue) => {
|
|
1368
1130
|
onChange(nextValue);
|
|
1369
1131
|
},
|
|
1370
1132
|
[onChange]
|
|
1371
1133
|
);
|
|
1134
|
+
const handleBlur = useCallback4(
|
|
1135
|
+
({ target }) => {
|
|
1136
|
+
if (onBlur) {
|
|
1137
|
+
onBlur(id, target && target.value);
|
|
1138
|
+
}
|
|
1139
|
+
},
|
|
1140
|
+
[onBlur, id]
|
|
1141
|
+
);
|
|
1142
|
+
const handleFocus = useCallback4(
|
|
1143
|
+
({ target }) => {
|
|
1144
|
+
if (onFocus) {
|
|
1145
|
+
onFocus(id, target && target.value);
|
|
1146
|
+
}
|
|
1147
|
+
},
|
|
1148
|
+
[onFocus, id]
|
|
1149
|
+
);
|
|
1150
|
+
return /* @__PURE__ */ jsx21(
|
|
1151
|
+
ColorInput,
|
|
1152
|
+
{
|
|
1153
|
+
id,
|
|
1154
|
+
name,
|
|
1155
|
+
value: value || "",
|
|
1156
|
+
placeholder: placeholder || void 0,
|
|
1157
|
+
required,
|
|
1158
|
+
disabled: disabled || readonly,
|
|
1159
|
+
autoFocus: autofocus,
|
|
1160
|
+
label: labelValue3(label || void 0, hideLabel, false),
|
|
1161
|
+
onChange: handleChange,
|
|
1162
|
+
onBlur: handleBlur,
|
|
1163
|
+
onFocus: handleFocus,
|
|
1164
|
+
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1165
|
+
...themeProps,
|
|
1166
|
+
"aria-describedby": ariaDescribedByIds4(id),
|
|
1167
|
+
popoverProps: { withinPortal: false }
|
|
1168
|
+
}
|
|
1169
|
+
);
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
// src/widgets/DateTime/AltDateTimeWidget.tsx
|
|
1173
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1174
|
+
function AltDateTimeWidget(props) {
|
|
1175
|
+
const { AltDateWidget: AltDateWidget2 } = props.registry.widgets;
|
|
1176
|
+
return /* @__PURE__ */ jsx22(AltDateWidget2, { time: true, ...props });
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
// src/widgets/DateTime/AltDateWidget.tsx
|
|
1180
|
+
import { Flex as Flex4, Box as Box6, Group as Group4, Button as Button2, Select, Input as Input2 } from "@mantine/core";
|
|
1181
|
+
import {
|
|
1182
|
+
ariaDescribedByIds as ariaDescribedByIds5,
|
|
1183
|
+
dateRangeOptions,
|
|
1184
|
+
titleId as titleId4,
|
|
1185
|
+
TranslatableString as TranslatableString5,
|
|
1186
|
+
useAltDateWidgetProps
|
|
1187
|
+
} from "@rjsf/utils";
|
|
1188
|
+
import { Fragment as Fragment4, jsx as jsx23, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1189
|
+
function AltDateWidget(props) {
|
|
1190
|
+
const { id, required, disabled, readonly, label, hideLabel, rawErrors, options, registry } = props;
|
|
1191
|
+
const { translateString } = registry;
|
|
1192
|
+
const { elements, handleChange, handleClear, handleSetNow } = useAltDateWidgetProps(props);
|
|
1193
|
+
return /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
1194
|
+
!hideLabel && !!label && /* @__PURE__ */ jsx23(Input2.Label, { id: titleId4(id), required, children: label }),
|
|
1195
|
+
/* @__PURE__ */ jsxs13(Flex4, { gap: "xs", align: "center", wrap: "nowrap", children: [
|
|
1196
|
+
elements.map((elemProps, i) => {
|
|
1197
|
+
const elemId = `${id}_${elemProps.type}`;
|
|
1198
|
+
return /* @__PURE__ */ jsx23(Box6, { children: /* @__PURE__ */ jsx23(
|
|
1199
|
+
Select,
|
|
1200
|
+
{
|
|
1201
|
+
id: elemId,
|
|
1202
|
+
name: elemId,
|
|
1203
|
+
placeholder: elemProps.type,
|
|
1204
|
+
disabled: disabled || readonly,
|
|
1205
|
+
data: dateRangeOptions(elemProps.range[0], elemProps.range[1]).map((item) => item.value.toString()),
|
|
1206
|
+
value: !elemProps.value || elemProps.value < 0 ? null : elemProps.value.toString(),
|
|
1207
|
+
onChange: (v) => handleChange(elemProps.type, v || void 0),
|
|
1208
|
+
searchable: false,
|
|
1209
|
+
allowDeselect: false,
|
|
1210
|
+
comboboxProps: { withinPortal: false },
|
|
1211
|
+
"aria-describedby": ariaDescribedByIds5(elemId)
|
|
1212
|
+
}
|
|
1213
|
+
) }, i);
|
|
1214
|
+
}),
|
|
1215
|
+
/* @__PURE__ */ jsxs13(Group4, { wrap: "nowrap", gap: 3, children: [
|
|
1216
|
+
(options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /* @__PURE__ */ jsx23(Button2, { variant: "subtle", size: "xs", onClick: handleSetNow, children: translateString(TranslatableString5.NowLabel) }),
|
|
1217
|
+
(options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /* @__PURE__ */ jsx23(Button2, { variant: "subtle", size: "xs", onClick: handleClear, children: translateString(TranslatableString5.ClearLabel) })
|
|
1218
|
+
] })
|
|
1219
|
+
] }),
|
|
1220
|
+
rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => /* @__PURE__ */ jsx23(Input2.Error, { children: error }, `alt-date-widget-input-errors-${index}`))
|
|
1221
|
+
] });
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
// src/widgets/DateTime/DateTimeInput.tsx
|
|
1225
|
+
import { useCallback as useCallback5 } from "react";
|
|
1226
|
+
import { DateInput } from "@mantine/dates";
|
|
1227
|
+
import {
|
|
1228
|
+
ariaDescribedByIds as ariaDescribedByIds6,
|
|
1229
|
+
labelValue as labelValue4
|
|
1230
|
+
} from "@rjsf/utils";
|
|
1231
|
+
import dayjs from "dayjs";
|
|
1232
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1233
|
+
var dateParser = (input, format) => {
|
|
1234
|
+
if (!input) {
|
|
1235
|
+
return null;
|
|
1236
|
+
}
|
|
1237
|
+
const d = dayjs(input, format);
|
|
1238
|
+
return d.isValid() ? d.toDate() : null;
|
|
1239
|
+
};
|
|
1240
|
+
var dateFormat = (date, format) => {
|
|
1241
|
+
if (!date) {
|
|
1242
|
+
return "";
|
|
1243
|
+
}
|
|
1244
|
+
return dayjs(date).format(format || "YYYY-MM-DD");
|
|
1245
|
+
};
|
|
1246
|
+
function DateTimeInput(props) {
|
|
1247
|
+
const {
|
|
1248
|
+
id,
|
|
1249
|
+
name,
|
|
1250
|
+
value,
|
|
1251
|
+
placeholder,
|
|
1252
|
+
required,
|
|
1253
|
+
disabled,
|
|
1254
|
+
readonly,
|
|
1255
|
+
autofocus,
|
|
1256
|
+
label,
|
|
1257
|
+
hideLabel,
|
|
1258
|
+
rawErrors,
|
|
1259
|
+
options,
|
|
1260
|
+
onChange,
|
|
1261
|
+
onBlur,
|
|
1262
|
+
onFocus,
|
|
1263
|
+
valueFormat,
|
|
1264
|
+
displayFormat
|
|
1265
|
+
} = props;
|
|
1266
|
+
const handleChange = useCallback5(
|
|
1267
|
+
(nextValue) => {
|
|
1268
|
+
onChange(dateFormat(nextValue, valueFormat));
|
|
1269
|
+
},
|
|
1270
|
+
[onChange, valueFormat]
|
|
1271
|
+
);
|
|
1272
|
+
const handleBlur = useCallback5(() => {
|
|
1273
|
+
if (onBlur) {
|
|
1274
|
+
onBlur(id, value);
|
|
1275
|
+
}
|
|
1276
|
+
}, [onBlur, id, value]);
|
|
1277
|
+
const handleFocus = useCallback5(() => {
|
|
1278
|
+
if (onFocus) {
|
|
1279
|
+
onFocus(id, value);
|
|
1280
|
+
}
|
|
1281
|
+
}, [onFocus, id, value]);
|
|
1282
|
+
return /* @__PURE__ */ jsx24(
|
|
1283
|
+
DateInput,
|
|
1284
|
+
{
|
|
1285
|
+
id,
|
|
1286
|
+
name,
|
|
1287
|
+
value: dateParser(value, valueFormat),
|
|
1288
|
+
dateParser: (v) => dateParser(v, displayFormat),
|
|
1289
|
+
placeholder: placeholder || void 0,
|
|
1290
|
+
required,
|
|
1291
|
+
disabled: disabled || readonly,
|
|
1292
|
+
autoFocus: autofocus,
|
|
1293
|
+
label: labelValue4(label || void 0, hideLabel, false),
|
|
1294
|
+
onChange: handleChange,
|
|
1295
|
+
onBlur: handleBlur,
|
|
1296
|
+
onFocus: handleFocus,
|
|
1297
|
+
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1298
|
+
...options,
|
|
1299
|
+
"aria-describedby": ariaDescribedByIds6(id),
|
|
1300
|
+
popoverProps: { withinPortal: false },
|
|
1301
|
+
classNames: typeof options?.classNames === "object" ? options.classNames : void 0,
|
|
1302
|
+
valueFormat: displayFormat
|
|
1303
|
+
}
|
|
1304
|
+
);
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
// src/widgets/DateTime/DateWidget.tsx
|
|
1308
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1309
|
+
function DateWidget(props) {
|
|
1310
|
+
const { valueFormat = "YYYY-MM-DD", displayFormat, ...otherOptions } = props.options;
|
|
1311
|
+
return /* @__PURE__ */ jsx25(
|
|
1312
|
+
DateTimeInput,
|
|
1313
|
+
{
|
|
1314
|
+
...props,
|
|
1315
|
+
options: otherOptions,
|
|
1316
|
+
valueFormat,
|
|
1317
|
+
displayFormat: displayFormat || valueFormat
|
|
1318
|
+
}
|
|
1319
|
+
);
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
// src/widgets/DateTime/DateTimeWidget.tsx
|
|
1323
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1324
|
+
function DateTimeWidget(props) {
|
|
1325
|
+
const { valueFormat = "YYYY-MM-DD HH:mm:ss", displayFormat, ...otherOptions } = props.options;
|
|
1326
|
+
return /* @__PURE__ */ jsx26(
|
|
1327
|
+
DateTimeInput,
|
|
1328
|
+
{
|
|
1329
|
+
...props,
|
|
1330
|
+
options: otherOptions,
|
|
1331
|
+
valueFormat,
|
|
1332
|
+
displayFormat: displayFormat || valueFormat
|
|
1333
|
+
}
|
|
1334
|
+
);
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
// src/widgets/DateTime/TimeWidget.tsx
|
|
1338
|
+
import { useCallback as useCallback6 } from "react";
|
|
1339
|
+
import { TimeInput } from "@mantine/dates";
|
|
1340
|
+
import {
|
|
1341
|
+
labelValue as labelValue5,
|
|
1342
|
+
ariaDescribedByIds as ariaDescribedByIds7
|
|
1343
|
+
} from "@rjsf/utils";
|
|
1344
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1345
|
+
function TimeWidget(props) {
|
|
1346
|
+
const {
|
|
1347
|
+
id,
|
|
1348
|
+
name,
|
|
1349
|
+
value,
|
|
1350
|
+
placeholder,
|
|
1351
|
+
required,
|
|
1352
|
+
disabled,
|
|
1353
|
+
readonly,
|
|
1354
|
+
autofocus,
|
|
1355
|
+
label,
|
|
1356
|
+
hideLabel,
|
|
1357
|
+
rawErrors,
|
|
1358
|
+
options,
|
|
1359
|
+
onChange,
|
|
1360
|
+
onBlur,
|
|
1361
|
+
onFocus
|
|
1362
|
+
} = props;
|
|
1363
|
+
const emptyValue = options.emptyValue || "";
|
|
1364
|
+
const handleChange = useCallback6(
|
|
1365
|
+
(e) => {
|
|
1366
|
+
onChange(e.target.value === "" ? emptyValue : e.target.value);
|
|
1367
|
+
},
|
|
1368
|
+
[onChange, emptyValue]
|
|
1369
|
+
);
|
|
1372
1370
|
const handleBlur = useCallback6(
|
|
1373
1371
|
({ target }) => {
|
|
1374
1372
|
if (onBlur) {
|
|
@@ -1386,7 +1384,7 @@ function ColorWidget(props) {
|
|
|
1386
1384
|
[onFocus, id]
|
|
1387
1385
|
);
|
|
1388
1386
|
return /* @__PURE__ */ jsx27(
|
|
1389
|
-
|
|
1387
|
+
TimeInput,
|
|
1390
1388
|
{
|
|
1391
1389
|
id,
|
|
1392
1390
|
name,
|
|
@@ -1400,21 +1398,21 @@ function ColorWidget(props) {
|
|
|
1400
1398
|
onBlur: handleBlur,
|
|
1401
1399
|
onFocus: handleFocus,
|
|
1402
1400
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1403
|
-
...
|
|
1401
|
+
...options,
|
|
1404
1402
|
"aria-describedby": ariaDescribedByIds7(id),
|
|
1405
|
-
|
|
1403
|
+
classNames: typeof options?.classNames === "object" ? options.classNames : void 0
|
|
1406
1404
|
}
|
|
1407
1405
|
);
|
|
1408
1406
|
}
|
|
1409
1407
|
|
|
1410
1408
|
// src/widgets/FileWidget.tsx
|
|
1411
1409
|
import { useCallback as useCallback7 } from "react";
|
|
1410
|
+
import { FileInput, Pill } from "@mantine/core";
|
|
1412
1411
|
import {
|
|
1413
1412
|
ariaDescribedByIds as ariaDescribedByIds8,
|
|
1414
1413
|
labelValue as labelValue6,
|
|
1415
1414
|
useFileWidgetProps
|
|
1416
1415
|
} from "@rjsf/utils";
|
|
1417
|
-
import { FileInput, Pill } from "@mantine/core";
|
|
1418
1416
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1419
1417
|
function FileWidget(props) {
|
|
1420
1418
|
const {
|
|
@@ -1438,7 +1436,7 @@ function FileWidget(props) {
|
|
|
1438
1436
|
const handleOnChange = useCallback7(
|
|
1439
1437
|
(files) => {
|
|
1440
1438
|
if (typeof files === "object") {
|
|
1441
|
-
handleChange(files);
|
|
1439
|
+
void handleChange(files);
|
|
1442
1440
|
}
|
|
1443
1441
|
},
|
|
1444
1442
|
[handleChange]
|
|
@@ -1472,11 +1470,11 @@ function FileWidget(props) {
|
|
|
1472
1470
|
|
|
1473
1471
|
// src/widgets/PasswordWidget.tsx
|
|
1474
1472
|
import { useCallback as useCallback8 } from "react";
|
|
1473
|
+
import { PasswordInput } from "@mantine/core";
|
|
1475
1474
|
import {
|
|
1476
1475
|
ariaDescribedByIds as ariaDescribedByIds9,
|
|
1477
1476
|
labelValue as labelValue7
|
|
1478
1477
|
} from "@rjsf/utils";
|
|
1479
|
-
import { PasswordInput } from "@mantine/core";
|
|
1480
1478
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1481
1479
|
function PasswordWidget(props) {
|
|
1482
1480
|
const {
|
|
@@ -1543,6 +1541,7 @@ function PasswordWidget(props) {
|
|
|
1543
1541
|
|
|
1544
1542
|
// src/widgets/RadioWidget.tsx
|
|
1545
1543
|
import { useCallback as useCallback9 } from "react";
|
|
1544
|
+
import { Radio, Flex as Flex5 } from "@mantine/core";
|
|
1546
1545
|
import {
|
|
1547
1546
|
ariaDescribedByIds as ariaDescribedByIds10,
|
|
1548
1547
|
enumOptionValueDecoder as enumOptionValueDecoder2,
|
|
@@ -1551,7 +1550,6 @@ import {
|
|
|
1551
1550
|
getOptionValueFormat as getOptionValueFormat2,
|
|
1552
1551
|
optionId as optionId2
|
|
1553
1552
|
} from "@rjsf/utils";
|
|
1554
|
-
import { Radio, Flex as Flex5 } from "@mantine/core";
|
|
1555
1553
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1556
1554
|
function RadioWidget(props) {
|
|
1557
1555
|
const {
|
|
@@ -1630,12 +1628,12 @@ function RadioWidget(props) {
|
|
|
1630
1628
|
|
|
1631
1629
|
// src/widgets/RangeWidget.tsx
|
|
1632
1630
|
import { useCallback as useCallback10 } from "react";
|
|
1631
|
+
import { Slider, Input as Input3 } from "@mantine/core";
|
|
1633
1632
|
import {
|
|
1634
1633
|
ariaDescribedByIds as ariaDescribedByIds11,
|
|
1635
1634
|
rangeSpec,
|
|
1636
1635
|
titleId as titleId5
|
|
1637
1636
|
} from "@rjsf/utils";
|
|
1638
|
-
import { Slider, Input as Input3 } from "@mantine/core";
|
|
1639
1637
|
import { Fragment as Fragment5, jsx as jsx31, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1640
1638
|
function RangeWidget(props) {
|
|
1641
1639
|
const {
|
|
@@ -1702,6 +1700,7 @@ function RangeWidget(props) {
|
|
|
1702
1700
|
|
|
1703
1701
|
// src/widgets/SelectWidget.tsx
|
|
1704
1702
|
import { useCallback as useCallback11, useMemo } from "react";
|
|
1703
|
+
import { Select as Select2, MultiSelect } from "@mantine/core";
|
|
1705
1704
|
import {
|
|
1706
1705
|
ariaDescribedByIds as ariaDescribedByIds12,
|
|
1707
1706
|
enumOptionSelectedValue,
|
|
@@ -1710,7 +1709,6 @@ import {
|
|
|
1710
1709
|
getOptionValueFormat as getOptionValueFormat3,
|
|
1711
1710
|
labelValue as labelValue8
|
|
1712
1711
|
} from "@rjsf/utils";
|
|
1713
|
-
import { Select as Select2, MultiSelect } from "@mantine/core";
|
|
1714
1712
|
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1715
1713
|
function SelectWidget(props) {
|
|
1716
1714
|
const {
|
|
@@ -1804,11 +1802,11 @@ function SelectWidget(props) {
|
|
|
1804
1802
|
|
|
1805
1803
|
// src/widgets/TextareaWidget.tsx
|
|
1806
1804
|
import { useCallback as useCallback12 } from "react";
|
|
1805
|
+
import { Textarea } from "@mantine/core";
|
|
1807
1806
|
import {
|
|
1808
1807
|
labelValue as labelValue9,
|
|
1809
1808
|
ariaDescribedByIds as ariaDescribedByIds13
|
|
1810
1809
|
} from "@rjsf/utils";
|
|
1811
|
-
import { Textarea } from "@mantine/core";
|
|
1812
1810
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1813
1811
|
function TextareaWidget(props) {
|
|
1814
1812
|
const {
|