@rjsf/chakra-ui 6.0.0-beta.8 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/dist/chakra-ui.esm.js +269 -269
- package/dist/chakra-ui.esm.js.map +4 -4
- package/dist/chakra-ui.umd.js +143 -146
- package/dist/{index.js → index.cjs} +263 -260
- package/dist/index.cjs.map +7 -0
- package/lib/AltDateTimeWidget/AltDateTimeWidget.d.ts +1 -1
- package/lib/AltDateTimeWidget/AltDateTimeWidget.js +2 -2
- package/lib/AltDateTimeWidget/AltDateTimeWidget.js.map +1 -1
- package/lib/AltDateWidget/AltDateWidget.d.ts +1 -1
- package/lib/AltDateWidget/AltDateWidget.js +8 -49
- package/lib/AltDateWidget/AltDateWidget.js.map +1 -1
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +2 -2
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +3 -4
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
- package/lib/BaseInputTemplate/BaseInputTemplate.js +2 -2
- package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
- package/lib/CheckboxWidget/CheckboxWidget.js +4 -4
- package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.js +2 -2
- package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
- package/lib/ErrorList/ErrorList.js +3 -4
- package/lib/ErrorList/ErrorList.js.map +1 -1
- package/lib/FieldErrorTemplate/FieldErrorTemplate.d.ts +1 -1
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js +6 -6
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -1
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js +2 -2
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -1
- package/lib/FieldTemplate/FieldTemplate.js +2 -2
- package/lib/FieldTemplate/FieldTemplate.js.map +1 -1
- package/lib/IconButton/ChakraIconButton.d.ts +4 -2
- package/lib/IconButton/ChakraIconButton.js.map +1 -1
- package/lib/IconButton/IconButton.d.ts +6 -5
- package/lib/IconButton/IconButton.js.map +1 -1
- package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.d.ts +2 -0
- package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.js +7 -0
- package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.js.map +1 -0
- package/lib/MultiSchemaFieldTemplate/index.d.ts +2 -0
- package/lib/MultiSchemaFieldTemplate/index.js +3 -0
- package/lib/MultiSchemaFieldTemplate/index.js.map +1 -0
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +3 -2
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.d.ts +10 -0
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js +22 -0
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js.map +1 -0
- package/lib/OptionalDataControlsTemplate/index.d.ts +2 -0
- package/lib/OptionalDataControlsTemplate/index.js +3 -0
- package/lib/OptionalDataControlsTemplate/index.js.map +1 -0
- package/lib/RadioWidget/RadioWidget.d.ts +1 -1
- package/lib/RadioWidget/RadioWidget.js +2 -2
- package/lib/RadioWidget/RadioWidget.js.map +1 -1
- package/lib/RangeWidget/RangeWidget.js.map +1 -1
- package/lib/SelectNativeWidget/NativeSelectWidget.js.map +1 -1
- package/lib/SelectWidget/SelectWidget.js +6 -7
- package/lib/SelectWidget/SelectWidget.js.map +1 -1
- package/lib/Templates/Templates.js +4 -0
- package/lib/Templates/Templates.js.map +1 -1
- package/lib/TextareaWidget/TextareaWidget.d.ts +1 -1
- package/lib/TextareaWidget/TextareaWidget.js +2 -2
- package/lib/TextareaWidget/TextareaWidget.js.map +1 -1
- package/lib/TitleField/TitleField.d.ts +1 -1
- package/lib/TitleField/TitleField.js +7 -3
- package/lib/TitleField/TitleField.js.map +1 -1
- package/lib/UpDownWidget/UpDownWidget.js.map +1 -1
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +2 -3
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/components/ui/alert.d.ts +1 -3
- package/lib/components/ui/alert.js +2 -2
- package/lib/components/ui/alert.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +21 -22
- package/src/AltDateTimeWidget/AltDateTimeWidget.tsx +2 -2
- package/src/AltDateWidget/AltDateWidget.tsx +13 -88
- package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +2 -2
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +23 -17
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +5 -4
- package/src/CheckboxWidget/CheckboxWidget.tsx +6 -5
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +3 -2
- package/src/ErrorList/ErrorList.tsx +4 -16
- package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +10 -14
- package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +2 -2
- package/src/FieldTemplate/FieldTemplate.tsx +7 -5
- package/src/IconButton/ChakraIconButton.tsx +9 -3
- package/src/IconButton/IconButton.tsx +7 -7
- package/src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx +19 -0
- package/src/MultiSchemaFieldTemplate/index.ts +2 -0
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +12 -8
- package/src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx +47 -0
- package/src/OptionalDataControlsTemplate/index.ts +2 -0
- package/src/RadioWidget/RadioWidget.tsx +3 -2
- package/src/RangeWidget/RangeWidget.tsx +1 -1
- package/src/SelectNativeWidget/NativeSelectWidget.tsx +1 -1
- package/src/SelectWidget/SelectWidget.tsx +8 -14
- package/src/Templates/Templates.ts +4 -0
- package/src/TextareaWidget/TextareaWidget.tsx +3 -2
- package/src/TitleField/TitleField.tsx +13 -2
- package/src/UpDownWidget/UpDownWidget.tsx +1 -1
- package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +5 -8
- package/src/components/ui/alert.tsx +3 -5
- package/dist/index.js.map +0 -7
package/dist/chakra-ui.esm.js
CHANGED
|
@@ -47,23 +47,32 @@ import {
|
|
|
47
47
|
} from "@rjsf/utils";
|
|
48
48
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
49
49
|
function ArrayFieldTemplate(props) {
|
|
50
|
-
const {
|
|
50
|
+
const {
|
|
51
|
+
canAdd,
|
|
52
|
+
disabled,
|
|
53
|
+
fieldPathId,
|
|
54
|
+
uiSchema,
|
|
55
|
+
items,
|
|
56
|
+
optionalDataControl,
|
|
57
|
+
onAddClick,
|
|
58
|
+
readonly,
|
|
59
|
+
registry,
|
|
60
|
+
required,
|
|
61
|
+
schema,
|
|
62
|
+
title
|
|
63
|
+
} = props;
|
|
51
64
|
const uiOptions = getUiOptions2(uiSchema);
|
|
52
65
|
const ArrayFieldDescriptionTemplate = getTemplate2(
|
|
53
66
|
"ArrayFieldDescriptionTemplate",
|
|
54
67
|
registry,
|
|
55
68
|
uiOptions
|
|
56
69
|
);
|
|
57
|
-
const ArrayFieldItemTemplate2 = getTemplate2(
|
|
58
|
-
"ArrayFieldItemTemplate",
|
|
59
|
-
registry,
|
|
60
|
-
uiOptions
|
|
61
|
-
);
|
|
62
70
|
const ArrayFieldTitleTemplate = getTemplate2(
|
|
63
71
|
"ArrayFieldTitleTemplate",
|
|
64
72
|
registry,
|
|
65
73
|
uiOptions
|
|
66
74
|
);
|
|
75
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
67
76
|
const {
|
|
68
77
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
69
78
|
} = registry.templates;
|
|
@@ -71,18 +80,19 @@ function ArrayFieldTemplate(props) {
|
|
|
71
80
|
/* @__PURE__ */ jsx3(
|
|
72
81
|
ArrayFieldTitleTemplate,
|
|
73
82
|
{
|
|
74
|
-
|
|
83
|
+
fieldPathId,
|
|
75
84
|
title: uiOptions.title || title,
|
|
76
85
|
schema,
|
|
77
86
|
uiSchema,
|
|
78
87
|
required,
|
|
79
|
-
registry
|
|
88
|
+
registry,
|
|
89
|
+
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
80
90
|
}
|
|
81
91
|
),
|
|
82
92
|
/* @__PURE__ */ jsx3(
|
|
83
93
|
ArrayFieldDescriptionTemplate,
|
|
84
94
|
{
|
|
85
|
-
|
|
95
|
+
fieldPathId,
|
|
86
96
|
description: uiOptions.description || schema.description,
|
|
87
97
|
schema,
|
|
88
98
|
uiSchema,
|
|
@@ -90,11 +100,14 @@ function ArrayFieldTemplate(props) {
|
|
|
90
100
|
}
|
|
91
101
|
),
|
|
92
102
|
/* @__PURE__ */ jsxs3(Grid, { children: [
|
|
93
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ jsxs3(GridItem, { children: [
|
|
104
|
+
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
105
|
+
items
|
|
106
|
+
] }),
|
|
94
107
|
canAdd && /* @__PURE__ */ jsx3(GridItem, { justifySelf: "flex-end", children: /* @__PURE__ */ jsx3(Box2, { mt: 2, children: /* @__PURE__ */ jsx3(
|
|
95
108
|
AddButton2,
|
|
96
109
|
{
|
|
97
|
-
id: buttonId(
|
|
110
|
+
id: buttonId(fieldPathId, "add"),
|
|
98
111
|
className: "rjsf-array-item-add",
|
|
99
112
|
onClick: onAddClick,
|
|
100
113
|
disabled: disabled || readonly,
|
|
@@ -102,7 +115,7 @@ function ArrayFieldTemplate(props) {
|
|
|
102
115
|
registry
|
|
103
116
|
}
|
|
104
117
|
) }) })
|
|
105
|
-
] }, `array-item-list-${
|
|
118
|
+
] }, `array-item-list-${fieldPathId.$id}`)
|
|
106
119
|
] });
|
|
107
120
|
}
|
|
108
121
|
|
|
@@ -151,6 +164,7 @@ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
|
151
164
|
function BaseInputTemplate(props) {
|
|
152
165
|
const {
|
|
153
166
|
id,
|
|
167
|
+
htmlName,
|
|
154
168
|
type,
|
|
155
169
|
value,
|
|
156
170
|
label,
|
|
@@ -189,7 +203,7 @@ function BaseInputTemplate(props) {
|
|
|
189
203
|
Input,
|
|
190
204
|
{
|
|
191
205
|
id,
|
|
192
|
-
name: id,
|
|
206
|
+
name: htmlName || id,
|
|
193
207
|
value: value || value === 0 ? value : "",
|
|
194
208
|
onChange: onChangeOverride || _onChange,
|
|
195
209
|
onBlur: _onBlur,
|
|
@@ -222,8 +236,7 @@ function DescriptionField({ description, id, registry, uiSchema }) {
|
|
|
222
236
|
|
|
223
237
|
// src/ErrorList/ErrorList.tsx
|
|
224
238
|
import { TranslatableString as TranslatableString2 } from "@rjsf/utils";
|
|
225
|
-
import {
|
|
226
|
-
import { TriangleAlert } from "lucide-react";
|
|
239
|
+
import { ListItem, ListRoot } from "@chakra-ui/react";
|
|
227
240
|
|
|
228
241
|
// src/components/ui/alert.tsx
|
|
229
242
|
import { forwardRef as forwardRef3 } from "react";
|
|
@@ -241,9 +254,9 @@ var CloseButton = forwardRef2(function CloseButton2(props, ref) {
|
|
|
241
254
|
// src/components/ui/alert.tsx
|
|
242
255
|
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
243
256
|
var Alert = forwardRef3(function Alert2(props, ref) {
|
|
244
|
-
const { title, children,
|
|
257
|
+
const { title, children, closable, onClose, startElement, endElement, ...rest } = props;
|
|
245
258
|
return /* @__PURE__ */ jsxs6(ChakraAlert.Root, { ref, ...rest, children: [
|
|
246
|
-
startElement || /* @__PURE__ */ jsx8(ChakraAlert.Indicator, {
|
|
259
|
+
startElement || /* @__PURE__ */ jsx8(ChakraAlert.Indicator, {}),
|
|
247
260
|
children ? /* @__PURE__ */ jsxs6(ChakraAlert.Content, { children: [
|
|
248
261
|
/* @__PURE__ */ jsx8(ChakraAlert.Title, { children: title }),
|
|
249
262
|
/* @__PURE__ */ jsx8(ChakraAlert.Description, { children })
|
|
@@ -254,26 +267,13 @@ var Alert = forwardRef3(function Alert2(props, ref) {
|
|
|
254
267
|
});
|
|
255
268
|
|
|
256
269
|
// src/ErrorList/ErrorList.tsx
|
|
257
|
-
import { jsx as jsx9
|
|
270
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
258
271
|
function ErrorList({
|
|
259
272
|
errors,
|
|
260
273
|
registry
|
|
261
274
|
}) {
|
|
262
275
|
const { translateString } = registry;
|
|
263
|
-
return /* @__PURE__ */ jsx9(
|
|
264
|
-
Alert,
|
|
265
|
-
{
|
|
266
|
-
flexDirection: "column",
|
|
267
|
-
alignItems: "flex-start",
|
|
268
|
-
gap: 3,
|
|
269
|
-
status: "error",
|
|
270
|
-
title: translateString(TranslatableString2.ErrorsLabel),
|
|
271
|
-
children: /* @__PURE__ */ jsx9(ListRoot, { children: errors.map((error, i) => /* @__PURE__ */ jsxs7(ListItem, { children: [
|
|
272
|
-
/* @__PURE__ */ jsx9(ListIndicator, { asChild: true, color: "red.500", children: /* @__PURE__ */ jsx9(TriangleAlert, {}) }),
|
|
273
|
-
error.stack
|
|
274
|
-
] }, i)) })
|
|
275
|
-
}
|
|
276
|
-
);
|
|
276
|
+
return /* @__PURE__ */ jsx9(Alert, { status: "error", title: translateString(TranslatableString2.ErrorsLabel), mb: 3, children: /* @__PURE__ */ jsx9(ListRoot, { listStylePosition: "inside", children: errors.map((error, i) => /* @__PURE__ */ jsx9(ListItem, { children: error.stack }, i)) }) });
|
|
277
277
|
}
|
|
278
278
|
|
|
279
279
|
// src/IconButton/ChakraIconButton.tsx
|
|
@@ -339,39 +339,39 @@ function RemoveButton(props) {
|
|
|
339
339
|
|
|
340
340
|
// src/FieldErrorTemplate/FieldErrorTemplate.tsx
|
|
341
341
|
import { errorId } from "@rjsf/utils";
|
|
342
|
-
import {
|
|
342
|
+
import { Fieldset } from "@chakra-ui/react";
|
|
343
343
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
344
344
|
function FieldErrorTemplate(props) {
|
|
345
|
-
const { errors = [],
|
|
345
|
+
const { errors = [], fieldPathId } = props;
|
|
346
346
|
if (errors.length === 0) {
|
|
347
347
|
return null;
|
|
348
348
|
}
|
|
349
|
-
const id = errorId(
|
|
350
|
-
return
|
|
351
|
-
return /* @__PURE__ */ jsx12(
|
|
352
|
-
})
|
|
349
|
+
const id = errorId(fieldPathId);
|
|
350
|
+
return errors.map((error, i) => {
|
|
351
|
+
return /* @__PURE__ */ jsx12(Fieldset.ErrorText, { mt: 0, id, children: error }, i);
|
|
352
|
+
});
|
|
353
353
|
}
|
|
354
354
|
|
|
355
355
|
// src/FieldHelpTemplate/FieldHelpTemplate.tsx
|
|
356
|
-
import { Text as
|
|
356
|
+
import { Text as Text2 } from "@chakra-ui/react";
|
|
357
357
|
import { helpId } from "@rjsf/utils";
|
|
358
358
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
359
359
|
function FieldHelpTemplate(props) {
|
|
360
|
-
const {
|
|
360
|
+
const { fieldPathId, help } = props;
|
|
361
361
|
if (!help) {
|
|
362
362
|
return null;
|
|
363
363
|
}
|
|
364
|
-
const id = helpId(
|
|
365
|
-
return /* @__PURE__ */ jsx13(
|
|
364
|
+
const id = helpId(fieldPathId);
|
|
365
|
+
return /* @__PURE__ */ jsx13(Text2, { id, children: help });
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
// src/FieldTemplate/FieldTemplate.tsx
|
|
369
|
-
import { Fieldset } from "@chakra-ui/react";
|
|
369
|
+
import { Fieldset as Fieldset2 } from "@chakra-ui/react";
|
|
370
370
|
import {
|
|
371
371
|
getTemplate as getTemplate3,
|
|
372
372
|
getUiOptions as getUiOptions3
|
|
373
373
|
} from "@rjsf/utils";
|
|
374
|
-
import { jsx as jsx14, jsxs as
|
|
374
|
+
import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
375
375
|
function FieldTemplate(props) {
|
|
376
376
|
const {
|
|
377
377
|
id,
|
|
@@ -382,8 +382,9 @@ function FieldTemplate(props) {
|
|
|
382
382
|
displayLabel,
|
|
383
383
|
hidden,
|
|
384
384
|
label,
|
|
385
|
-
|
|
386
|
-
|
|
385
|
+
onKeyRename,
|
|
386
|
+
onKeyRenameBlur,
|
|
387
|
+
onRemoveProperty,
|
|
387
388
|
readonly,
|
|
388
389
|
registry,
|
|
389
390
|
required,
|
|
@@ -412,18 +413,19 @@ function FieldTemplate(props) {
|
|
|
412
413
|
disabled,
|
|
413
414
|
id,
|
|
414
415
|
label,
|
|
415
|
-
|
|
416
|
-
|
|
416
|
+
onKeyRename,
|
|
417
|
+
onKeyRenameBlur,
|
|
418
|
+
onRemoveProperty,
|
|
417
419
|
readonly,
|
|
418
420
|
required,
|
|
419
421
|
schema,
|
|
420
422
|
uiSchema,
|
|
421
423
|
registry,
|
|
422
|
-
children: /* @__PURE__ */
|
|
423
|
-
displayLabel && rawDescription ? /* @__PURE__ */ jsx14(
|
|
424
|
+
children: /* @__PURE__ */ jsxs7(Fieldset2.Root, { disabled, invalid: rawErrors && rawErrors.length > 0, children: [
|
|
425
|
+
displayLabel && rawDescription ? /* @__PURE__ */ jsx14(Fieldset2.Legend, { mt: 2, children: description }) : null,
|
|
424
426
|
help,
|
|
425
|
-
/* @__PURE__ */ jsx14(
|
|
426
|
-
errors
|
|
427
|
+
/* @__PURE__ */ jsx14(Fieldset2.Content, { children }),
|
|
428
|
+
errors
|
|
427
429
|
] })
|
|
428
430
|
}
|
|
429
431
|
);
|
|
@@ -440,6 +442,17 @@ function GridTemplate(props) {
|
|
|
440
442
|
return /* @__PURE__ */ jsx15(Grid2, { ...rest, children });
|
|
441
443
|
}
|
|
442
444
|
|
|
445
|
+
// src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx
|
|
446
|
+
import { Box as Box3, Card } from "@chakra-ui/react";
|
|
447
|
+
import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
448
|
+
function MultiSchemaFieldTemplate(props) {
|
|
449
|
+
const { optionSchemaField, selector } = props;
|
|
450
|
+
return /* @__PURE__ */ jsx16(Card.Root, { mb: 2, children: /* @__PURE__ */ jsxs8(Card.Body, { pb: 2, children: [
|
|
451
|
+
/* @__PURE__ */ jsx16(Box3, { mb: 4, children: selector }),
|
|
452
|
+
optionSchemaField
|
|
453
|
+
] }) });
|
|
454
|
+
}
|
|
455
|
+
|
|
443
456
|
// src/ObjectFieldTemplate/ObjectFieldTemplate.tsx
|
|
444
457
|
import { Grid as Grid3, GridItem as GridItem3 } from "@chakra-ui/react";
|
|
445
458
|
import {
|
|
@@ -450,7 +463,7 @@ import {
|
|
|
450
463
|
getUiOptions as getUiOptions4,
|
|
451
464
|
titleId
|
|
452
465
|
} from "@rjsf/utils";
|
|
453
|
-
import { Fragment, jsx as
|
|
466
|
+
import { Fragment, jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
454
467
|
function ObjectFieldTemplate(props) {
|
|
455
468
|
const {
|
|
456
469
|
description,
|
|
@@ -460,10 +473,11 @@ function ObjectFieldTemplate(props) {
|
|
|
460
473
|
disabled,
|
|
461
474
|
readonly,
|
|
462
475
|
uiSchema,
|
|
463
|
-
|
|
476
|
+
fieldPathId,
|
|
464
477
|
schema,
|
|
465
478
|
formData,
|
|
466
|
-
|
|
479
|
+
optionalDataControl,
|
|
480
|
+
onAddProperty,
|
|
467
481
|
registry
|
|
468
482
|
} = props;
|
|
469
483
|
const uiOptions = getUiOptions4(uiSchema);
|
|
@@ -473,41 +487,44 @@ function ObjectFieldTemplate(props) {
|
|
|
473
487
|
registry,
|
|
474
488
|
uiOptions
|
|
475
489
|
);
|
|
490
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
476
491
|
const {
|
|
477
492
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
478
493
|
} = registry.templates;
|
|
479
494
|
return /* @__PURE__ */ jsxs9(Fragment, { children: [
|
|
480
|
-
title && /* @__PURE__ */
|
|
495
|
+
title && /* @__PURE__ */ jsx17(
|
|
481
496
|
TitleFieldTemplate,
|
|
482
497
|
{
|
|
483
|
-
id: titleId(
|
|
498
|
+
id: titleId(fieldPathId),
|
|
484
499
|
title,
|
|
485
500
|
required,
|
|
486
501
|
schema,
|
|
487
502
|
uiSchema,
|
|
488
|
-
registry
|
|
503
|
+
registry,
|
|
504
|
+
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
489
505
|
}
|
|
490
506
|
),
|
|
491
|
-
description && /* @__PURE__ */
|
|
507
|
+
description && /* @__PURE__ */ jsx17(
|
|
492
508
|
DescriptionFieldTemplate,
|
|
493
509
|
{
|
|
494
|
-
id: descriptionId(
|
|
510
|
+
id: descriptionId(fieldPathId),
|
|
495
511
|
description,
|
|
496
512
|
schema,
|
|
497
513
|
uiSchema,
|
|
498
514
|
registry
|
|
499
515
|
}
|
|
500
516
|
),
|
|
501
|
-
/* @__PURE__ */ jsxs9(Grid3, { gap: description ? 2 :
|
|
517
|
+
/* @__PURE__ */ jsxs9(Grid3, { gap: description ? 2 : 4, mb: 4, children: [
|
|
518
|
+
!showOptionalDataControlInTitle ? /* @__PURE__ */ jsx17(GridItem3, { children: optionalDataControl }) : void 0,
|
|
502
519
|
properties.map(
|
|
503
|
-
(element, index) => element.hidden ? element.content : /* @__PURE__ */
|
|
520
|
+
(element, index) => element.hidden ? element.content : /* @__PURE__ */ jsx17(GridItem3, { children: element.content }, `${fieldPathId.$id}-${element.name}-${index}`)
|
|
504
521
|
),
|
|
505
|
-
canExpand(schema, uiSchema, formData) && /* @__PURE__ */
|
|
522
|
+
canExpand(schema, uiSchema, formData) && /* @__PURE__ */ jsx17(GridItem3, { justifySelf: "flex-end", children: /* @__PURE__ */ jsx17(
|
|
506
523
|
AddButton2,
|
|
507
524
|
{
|
|
508
|
-
id: buttonId2(
|
|
525
|
+
id: buttonId2(fieldPathId, "add"),
|
|
509
526
|
className: "rjsf-object-property-expand",
|
|
510
|
-
onClick:
|
|
527
|
+
onClick: onAddProperty,
|
|
511
528
|
disabled: disabled || readonly,
|
|
512
529
|
uiSchema,
|
|
513
530
|
registry
|
|
@@ -517,28 +534,73 @@ function ObjectFieldTemplate(props) {
|
|
|
517
534
|
] });
|
|
518
535
|
}
|
|
519
536
|
|
|
537
|
+
// src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx
|
|
538
|
+
import { PlusIcon as PlusIcon2 } from "lucide-react";
|
|
539
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
540
|
+
function OptionalDataControlsTemplate(props) {
|
|
541
|
+
const { id, registry, label, onAddClick, onRemoveClick } = props;
|
|
542
|
+
if (onAddClick) {
|
|
543
|
+
return /* @__PURE__ */ jsx18(
|
|
544
|
+
ChakraIconButton_default,
|
|
545
|
+
{
|
|
546
|
+
id,
|
|
547
|
+
registry,
|
|
548
|
+
className: "rjsf-add-optional-data btn-sm",
|
|
549
|
+
onClick: onAddClick,
|
|
550
|
+
title: label,
|
|
551
|
+
icon: /* @__PURE__ */ jsx18(PlusIcon2, {}),
|
|
552
|
+
size: "xs",
|
|
553
|
+
variant: "subtle"
|
|
554
|
+
}
|
|
555
|
+
);
|
|
556
|
+
} else if (onRemoveClick) {
|
|
557
|
+
return /* @__PURE__ */ jsx18(
|
|
558
|
+
RemoveButton,
|
|
559
|
+
{
|
|
560
|
+
id,
|
|
561
|
+
registry,
|
|
562
|
+
className: "rjsf-remove-optional-data btn-sm",
|
|
563
|
+
onClick: onRemoveClick,
|
|
564
|
+
title: label,
|
|
565
|
+
size: "xs",
|
|
566
|
+
variant: "subtle"
|
|
567
|
+
}
|
|
568
|
+
);
|
|
569
|
+
}
|
|
570
|
+
return /* @__PURE__ */ jsx18("em", { id, children: label });
|
|
571
|
+
}
|
|
572
|
+
|
|
520
573
|
// src/SubmitButton/SubmitButton.tsx
|
|
521
|
-
import { Box as
|
|
574
|
+
import { Box as Box4, Button as Button2 } from "@chakra-ui/react";
|
|
522
575
|
import { getSubmitButtonOptions } from "@rjsf/utils";
|
|
523
|
-
import { jsx as
|
|
576
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
524
577
|
function SubmitButton({ uiSchema }) {
|
|
525
578
|
const { submitText, norender, props: submitButtonProps } = getSubmitButtonOptions(uiSchema);
|
|
526
579
|
if (norender) {
|
|
527
580
|
return null;
|
|
528
581
|
}
|
|
529
|
-
return /* @__PURE__ */
|
|
582
|
+
return /* @__PURE__ */ jsx19(Box4, { marginTop: 3, children: /* @__PURE__ */ jsx19(Button2, { type: "submit", variant: "solid", ...submitButtonProps, children: submitText }) });
|
|
530
583
|
}
|
|
531
584
|
|
|
532
585
|
// src/TitleField/TitleField.tsx
|
|
533
|
-
import { Box as
|
|
534
|
-
import { jsx as
|
|
586
|
+
import { Box as Box5, Flex, Heading, Separator, Spacer } from "@chakra-ui/react";
|
|
587
|
+
import { jsx as jsx20, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
535
588
|
function TitleField({
|
|
536
589
|
id,
|
|
537
|
-
title
|
|
590
|
+
title,
|
|
591
|
+
optionalDataControl
|
|
538
592
|
}) {
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
/* @__PURE__ */
|
|
593
|
+
let heading = /* @__PURE__ */ jsx20(Heading, { as: "h5", children: title });
|
|
594
|
+
if (optionalDataControl) {
|
|
595
|
+
heading = /* @__PURE__ */ jsxs10(Flex, { children: [
|
|
596
|
+
heading,
|
|
597
|
+
/* @__PURE__ */ jsx20(Spacer, {}),
|
|
598
|
+
optionalDataControl
|
|
599
|
+
] });
|
|
600
|
+
}
|
|
601
|
+
return /* @__PURE__ */ jsxs10(Box5, { id, mt: 1, mb: 4, children: [
|
|
602
|
+
heading,
|
|
603
|
+
/* @__PURE__ */ jsx20(Separator, {})
|
|
542
604
|
] });
|
|
543
605
|
}
|
|
544
606
|
|
|
@@ -549,7 +611,7 @@ import {
|
|
|
549
611
|
TranslatableString as TranslatableString4
|
|
550
612
|
} from "@rjsf/utils";
|
|
551
613
|
import { Grid as Grid4, GridItem as GridItem4, Input as Input2 } from "@chakra-ui/react";
|
|
552
|
-
import { jsx as
|
|
614
|
+
import { jsx as jsx21, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
553
615
|
function WrapIfAdditionalTemplate(props) {
|
|
554
616
|
const {
|
|
555
617
|
children,
|
|
@@ -558,8 +620,8 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
558
620
|
disabled,
|
|
559
621
|
id,
|
|
560
622
|
label,
|
|
561
|
-
|
|
562
|
-
|
|
623
|
+
onRemoveProperty,
|
|
624
|
+
onKeyRenameBlur,
|
|
563
625
|
readonly,
|
|
564
626
|
registry,
|
|
565
627
|
required,
|
|
@@ -571,30 +633,29 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
571
633
|
const keyLabel = translateString(TranslatableString4.KeyLabel, [label]);
|
|
572
634
|
const additional = ADDITIONAL_PROPERTY_FLAG in schema;
|
|
573
635
|
if (!additional) {
|
|
574
|
-
return /* @__PURE__ */
|
|
636
|
+
return /* @__PURE__ */ jsx21("div", { className: classNames, style, children });
|
|
575
637
|
}
|
|
576
|
-
const handleBlur = ({ target }) => onKeyChange(target.value);
|
|
577
638
|
return /* @__PURE__ */ jsxs11(Grid4, { className: classNames, style, alignItems: "center", gap: 2, children: [
|
|
578
|
-
/* @__PURE__ */
|
|
639
|
+
/* @__PURE__ */ jsx21(GridItem4, { children: /* @__PURE__ */ jsx21(Field, { required, label: keyLabel, children: /* @__PURE__ */ jsx21(
|
|
579
640
|
Input2,
|
|
580
641
|
{
|
|
581
642
|
defaultValue: label,
|
|
582
643
|
disabled: disabled || readonly,
|
|
583
644
|
id: `${id}-key`,
|
|
584
645
|
name: `${id}-key`,
|
|
585
|
-
onBlur: !readonly ?
|
|
646
|
+
onBlur: !readonly ? onKeyRenameBlur : void 0,
|
|
586
647
|
type: "text",
|
|
587
648
|
mb: 1
|
|
588
649
|
}
|
|
589
650
|
) }) }),
|
|
590
|
-
/* @__PURE__ */
|
|
591
|
-
/* @__PURE__ */
|
|
651
|
+
/* @__PURE__ */ jsx21(GridItem4, { children }),
|
|
652
|
+
/* @__PURE__ */ jsx21(GridItem4, { children: /* @__PURE__ */ jsx21(
|
|
592
653
|
RemoveButton2,
|
|
593
654
|
{
|
|
594
655
|
id: buttonId3(id, "remove"),
|
|
595
656
|
className: "rjsf-object-property-remove",
|
|
596
657
|
disabled: disabled || readonly,
|
|
597
|
-
onClick:
|
|
658
|
+
onClick: onRemoveProperty,
|
|
598
659
|
uiSchema,
|
|
599
660
|
registry
|
|
600
661
|
}
|
|
@@ -622,7 +683,9 @@ function generateTemplates() {
|
|
|
622
683
|
FieldHelpTemplate,
|
|
623
684
|
FieldTemplate,
|
|
624
685
|
GridTemplate,
|
|
686
|
+
MultiSchemaFieldTemplate,
|
|
625
687
|
ObjectFieldTemplate,
|
|
688
|
+
OptionalDataControlsTemplate,
|
|
626
689
|
TitleFieldTemplate: TitleField,
|
|
627
690
|
WrapIfAdditionalTemplate
|
|
628
691
|
};
|
|
@@ -630,103 +693,42 @@ function generateTemplates() {
|
|
|
630
693
|
var Templates_default = generateTemplates();
|
|
631
694
|
|
|
632
695
|
// src/AltDateWidget/AltDateWidget.tsx
|
|
633
|
-
import { Box as
|
|
696
|
+
import { Box as Box6, Button as Button3, FieldsetRoot } from "@chakra-ui/react";
|
|
634
697
|
import {
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
parseDateString,
|
|
639
|
-
toDateString,
|
|
640
|
-
TranslatableString as TranslatableString5
|
|
698
|
+
DateElement,
|
|
699
|
+
TranslatableString as TranslatableString5,
|
|
700
|
+
useAltDateWidgetProps
|
|
641
701
|
} from "@rjsf/utils";
|
|
642
|
-
import {
|
|
643
|
-
import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
644
|
-
function DateElement(props) {
|
|
645
|
-
const { SelectWidget: SelectWidget2 } = props.registry.widgets;
|
|
646
|
-
const value = props.value ? props.value : void 0;
|
|
647
|
-
return /* @__PURE__ */ jsx20(
|
|
648
|
-
SelectWidget2,
|
|
649
|
-
{
|
|
650
|
-
...props,
|
|
651
|
-
label: "",
|
|
652
|
-
className: "form-control",
|
|
653
|
-
onChange: (elemValue) => props.select(props.type, elemValue),
|
|
654
|
-
options: {
|
|
655
|
-
enumOptions: dateRangeOptions(props.range[0], props.range[1])
|
|
656
|
-
},
|
|
657
|
-
placeholder: props.type,
|
|
658
|
-
schema: { type: "integer" },
|
|
659
|
-
value,
|
|
660
|
-
"aria-describedby": ariaDescribedByIds2(props.name)
|
|
661
|
-
}
|
|
662
|
-
);
|
|
663
|
-
}
|
|
664
|
-
var readyForChange = (state) => {
|
|
665
|
-
return Object.keys(state).every((key) => typeof state[key] !== "undefined" && state[key] !== -1);
|
|
666
|
-
};
|
|
702
|
+
import { jsx as jsx22, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
667
703
|
function AltDateWidget(props) {
|
|
668
|
-
const { autofocus, disabled, id, onBlur,
|
|
704
|
+
const { autofocus, disabled, id, onBlur, onFocus, options, readonly, registry } = props;
|
|
669
705
|
const { translateString } = registry;
|
|
670
|
-
const
|
|
671
|
-
useEffect(() => {
|
|
672
|
-
setState(parseDateString(value, showTime));
|
|
673
|
-
}, [showTime, value]);
|
|
674
|
-
const handleChange = (property, nextValue) => {
|
|
675
|
-
const nextState = {
|
|
676
|
-
...state,
|
|
677
|
-
[property]: typeof nextValue === "undefined" ? -1 : nextValue
|
|
678
|
-
};
|
|
679
|
-
if (readyForChange(nextState)) {
|
|
680
|
-
onChange(toDateString(nextState, showTime));
|
|
681
|
-
} else {
|
|
682
|
-
setState(nextState);
|
|
683
|
-
}
|
|
684
|
-
};
|
|
685
|
-
const handleNow = (event) => {
|
|
686
|
-
event.preventDefault();
|
|
687
|
-
if (disabled || readonly) {
|
|
688
|
-
return;
|
|
689
|
-
}
|
|
690
|
-
const nextState = parseDateString((/* @__PURE__ */ new Date()).toJSON(), showTime);
|
|
691
|
-
onChange(toDateString(nextState, showTime));
|
|
692
|
-
};
|
|
693
|
-
const handleClear = (event) => {
|
|
694
|
-
event.preventDefault();
|
|
695
|
-
if (disabled || readonly) {
|
|
696
|
-
return;
|
|
697
|
-
}
|
|
698
|
-
onChange(void 0);
|
|
699
|
-
};
|
|
706
|
+
const { elements, handleChange, handleClear, handleSetNow } = useAltDateWidgetProps(props);
|
|
700
707
|
const chakraProps = getChakra({ uiSchema: props.uiSchema });
|
|
701
708
|
return /* @__PURE__ */ jsxs12(FieldsetRoot, { ...chakraProps, children: [
|
|
702
|
-
/* @__PURE__ */
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
options.yearsRange,
|
|
706
|
-
options.format
|
|
707
|
-
).map((elemProps, i) => {
|
|
708
|
-
const elemId = id + "_" + elemProps.type;
|
|
709
|
-
return /* @__PURE__ */ jsx20(Box5, { mr: "2", mb: "2", children: /* @__PURE__ */ jsx20(
|
|
709
|
+
/* @__PURE__ */ jsx22(Box6, { display: "flex", flexWrap: "wrap", alignItems: "center", children: elements.map((elemProps, i) => {
|
|
710
|
+
const elemId = `${id}_${elemProps.type}`;
|
|
711
|
+
return /* @__PURE__ */ jsx22(Box6, { mr: "2", mb: "2", width: "20", children: /* @__PURE__ */ jsx22(
|
|
710
712
|
DateElement,
|
|
711
713
|
{
|
|
712
714
|
...props,
|
|
713
715
|
...elemProps,
|
|
714
716
|
autofocus: autofocus && i === 0,
|
|
715
717
|
disabled,
|
|
716
|
-
|
|
718
|
+
rootId: id,
|
|
717
719
|
name: id,
|
|
718
720
|
onBlur,
|
|
719
721
|
onFocus,
|
|
720
722
|
readonly,
|
|
721
723
|
registry,
|
|
722
724
|
select: handleChange,
|
|
723
|
-
value: elemProps.value < 0 ? "" : elemProps.value
|
|
725
|
+
value: elemProps.value && elemProps.value < 0 ? "" : elemProps.value
|
|
724
726
|
}
|
|
725
727
|
) }, elemId);
|
|
726
728
|
}) }),
|
|
727
|
-
/* @__PURE__ */ jsxs12(
|
|
728
|
-
!options.hideNowButton && /* @__PURE__ */
|
|
729
|
-
!options.hideClearButton && /* @__PURE__ */
|
|
729
|
+
/* @__PURE__ */ jsxs12(Box6, { display: "flex", children: [
|
|
730
|
+
!options.hideNowButton && /* @__PURE__ */ jsx22(Button3, { onClick: handleSetNow, mr: "2", children: translateString(TranslatableString5.NowLabel) }),
|
|
731
|
+
!options.hideClearButton && /* @__PURE__ */ jsx22(Button3, { onClick: handleClear, children: translateString(TranslatableString5.ClearLabel) })
|
|
730
732
|
] })
|
|
731
733
|
] });
|
|
732
734
|
}
|
|
@@ -734,7 +736,7 @@ AltDateWidget.defaultProps = {
|
|
|
734
736
|
autofocus: false,
|
|
735
737
|
disabled: false,
|
|
736
738
|
readonly: false,
|
|
737
|
-
|
|
739
|
+
time: false,
|
|
738
740
|
options: {
|
|
739
741
|
yearsRange: [1900, (/* @__PURE__ */ new Date()).getFullYear() + 2]
|
|
740
742
|
}
|
|
@@ -742,21 +744,21 @@ AltDateWidget.defaultProps = {
|
|
|
742
744
|
var AltDateWidget_default = AltDateWidget;
|
|
743
745
|
|
|
744
746
|
// src/AltDateTimeWidget/AltDateTimeWidget.tsx
|
|
745
|
-
import { jsx as
|
|
747
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
746
748
|
function AltDateTimeWidget(props) {
|
|
747
749
|
const { AltDateWidget: AltDateWidget2 } = props.registry.widgets;
|
|
748
|
-
return /* @__PURE__ */
|
|
750
|
+
return /* @__PURE__ */ jsx23(AltDateWidget2, { ...props, time: true });
|
|
749
751
|
}
|
|
750
752
|
AltDateTimeWidget.defaultProps = {
|
|
751
753
|
...AltDateWidget_default.defaultProps,
|
|
752
|
-
|
|
754
|
+
time: true
|
|
753
755
|
};
|
|
754
756
|
var AltDateTimeWidget_default = AltDateTimeWidget;
|
|
755
757
|
|
|
756
758
|
// src/CheckboxWidget/CheckboxWidget.tsx
|
|
757
|
-
import { Text as
|
|
759
|
+
import { Text as Text3 } from "@chakra-ui/react";
|
|
758
760
|
import {
|
|
759
|
-
ariaDescribedByIds as
|
|
761
|
+
ariaDescribedByIds as ariaDescribedByIds2,
|
|
760
762
|
descriptionId as descriptionId2,
|
|
761
763
|
getTemplate as getTemplate5,
|
|
762
764
|
labelValue as labelValue2,
|
|
@@ -766,21 +768,22 @@ import {
|
|
|
766
768
|
// src/components/ui/checkbox.tsx
|
|
767
769
|
import { forwardRef as forwardRef4 } from "react";
|
|
768
770
|
import { Checkbox as ChakraCheckbox } from "@chakra-ui/react";
|
|
769
|
-
import { jsx as
|
|
771
|
+
import { jsx as jsx24, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
770
772
|
var Checkbox = forwardRef4(function Checkbox2(props, ref) {
|
|
771
773
|
const { icon, children, inputProps, rootRef, ...rest } = props;
|
|
772
774
|
return /* @__PURE__ */ jsxs13(ChakraCheckbox.Root, { ref: rootRef, ...rest, children: [
|
|
773
|
-
/* @__PURE__ */
|
|
774
|
-
/* @__PURE__ */
|
|
775
|
-
children != null && /* @__PURE__ */
|
|
775
|
+
/* @__PURE__ */ jsx24(ChakraCheckbox.HiddenInput, { ref, ...inputProps }),
|
|
776
|
+
/* @__PURE__ */ jsx24(ChakraCheckbox.Control, { children: icon || /* @__PURE__ */ jsx24(ChakraCheckbox.Indicator, {}) }),
|
|
777
|
+
children != null && /* @__PURE__ */ jsx24(ChakraCheckbox.Label, { children })
|
|
776
778
|
] });
|
|
777
779
|
});
|
|
778
780
|
|
|
779
781
|
// src/CheckboxWidget/CheckboxWidget.tsx
|
|
780
|
-
import { jsx as
|
|
782
|
+
import { jsx as jsx25, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
781
783
|
function CheckboxWidget(props) {
|
|
782
784
|
const {
|
|
783
785
|
id,
|
|
786
|
+
htmlName,
|
|
784
787
|
value,
|
|
785
788
|
disabled,
|
|
786
789
|
readonly,
|
|
@@ -802,11 +805,11 @@ function CheckboxWidget(props) {
|
|
|
802
805
|
);
|
|
803
806
|
const description = options.description || schema.description;
|
|
804
807
|
const _onChange = ({ checked }) => onChange(checked);
|
|
805
|
-
const _onBlur = ({ target }) => onBlur(id, target && target.
|
|
806
|
-
const _onFocus = ({ target }) => onFocus(id, target && target.
|
|
808
|
+
const _onBlur = ({ target }) => onBlur(id, target && target.checked);
|
|
809
|
+
const _onFocus = ({ target }) => onFocus(id, target && target.checked);
|
|
807
810
|
const chakraProps = getChakra({ uiSchema });
|
|
808
811
|
return /* @__PURE__ */ jsxs14(Field, { mb: 1, required, ...chakraProps, children: [
|
|
809
|
-
!hideLabel && description && /* @__PURE__ */
|
|
812
|
+
!hideLabel && description && /* @__PURE__ */ jsx25(
|
|
810
813
|
DescriptionFieldTemplate,
|
|
811
814
|
{
|
|
812
815
|
id: descriptionId2(id),
|
|
@@ -816,36 +819,37 @@ function CheckboxWidget(props) {
|
|
|
816
819
|
registry
|
|
817
820
|
}
|
|
818
821
|
),
|
|
819
|
-
/* @__PURE__ */
|
|
822
|
+
/* @__PURE__ */ jsx25(
|
|
820
823
|
Checkbox,
|
|
821
824
|
{
|
|
822
825
|
id,
|
|
823
|
-
name: id,
|
|
826
|
+
name: htmlName || id,
|
|
824
827
|
checked: typeof value === "undefined" ? false : value,
|
|
825
828
|
disabled: disabled || readonly,
|
|
826
829
|
onCheckedChange: _onChange,
|
|
827
830
|
onBlur: _onBlur,
|
|
828
831
|
onFocus: _onFocus,
|
|
829
|
-
"aria-describedby":
|
|
830
|
-
children: labelValue2(/* @__PURE__ */
|
|
832
|
+
"aria-describedby": ariaDescribedByIds2(id),
|
|
833
|
+
children: labelValue2(/* @__PURE__ */ jsx25(Text3, { children: label }), hideLabel || !label)
|
|
831
834
|
}
|
|
832
835
|
)
|
|
833
836
|
] });
|
|
834
837
|
}
|
|
835
838
|
|
|
836
839
|
// src/CheckboxesWidget/CheckboxesWidget.tsx
|
|
837
|
-
import { CheckboxGroup, FieldsetRoot as FieldsetRoot2, Stack, Text as
|
|
840
|
+
import { CheckboxGroup, FieldsetRoot as FieldsetRoot2, Stack, Text as Text4 } from "@chakra-ui/react";
|
|
838
841
|
import {
|
|
839
|
-
ariaDescribedByIds as
|
|
842
|
+
ariaDescribedByIds as ariaDescribedByIds3,
|
|
840
843
|
enumOptionsIndexForValue,
|
|
841
844
|
enumOptionsValueForIndex,
|
|
842
845
|
labelValue as labelValue3,
|
|
843
846
|
optionId
|
|
844
847
|
} from "@rjsf/utils";
|
|
845
|
-
import { jsx as
|
|
848
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
846
849
|
function CheckboxesWidget(props) {
|
|
847
850
|
const {
|
|
848
851
|
id,
|
|
852
|
+
htmlName,
|
|
849
853
|
disabled,
|
|
850
854
|
options,
|
|
851
855
|
value,
|
|
@@ -865,34 +869,34 @@ function CheckboxesWidget(props) {
|
|
|
865
869
|
const row = options ? options.inline : false;
|
|
866
870
|
const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, true);
|
|
867
871
|
const chakraProps = getChakra({ uiSchema });
|
|
868
|
-
return /* @__PURE__ */
|
|
872
|
+
return /* @__PURE__ */ jsx26(
|
|
869
873
|
FieldsetRoot2,
|
|
870
874
|
{
|
|
871
875
|
mb: 1,
|
|
872
876
|
disabled: disabled || readonly,
|
|
873
877
|
invalid: rawErrors && rawErrors.length > 0,
|
|
874
878
|
...chakraProps,
|
|
875
|
-
children: /* @__PURE__ */
|
|
879
|
+
children: /* @__PURE__ */ jsx26(
|
|
876
880
|
CheckboxGroup,
|
|
877
881
|
{
|
|
878
882
|
onValueChange: (option) => onChange(enumOptionsValueForIndex(option, enumOptions, emptyValue)),
|
|
879
883
|
value: selectedIndexes,
|
|
880
|
-
"aria-describedby":
|
|
884
|
+
"aria-describedby": ariaDescribedByIds3(id),
|
|
881
885
|
readOnly: readonly,
|
|
882
886
|
required,
|
|
883
887
|
label: labelValue3(label, hideLabel || !label),
|
|
884
|
-
children: /* @__PURE__ */
|
|
888
|
+
children: /* @__PURE__ */ jsx26(Stack, { direction: row ? "row" : "column", children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
885
889
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
886
|
-
return /* @__PURE__ */
|
|
890
|
+
return /* @__PURE__ */ jsx26(
|
|
887
891
|
Checkbox,
|
|
888
892
|
{
|
|
889
893
|
id: optionId(id, index),
|
|
890
|
-
name: id,
|
|
894
|
+
name: htmlName || id,
|
|
891
895
|
value: String(index),
|
|
892
896
|
disabled: disabled || itemDisabled || readonly,
|
|
893
897
|
onBlur: _onBlur,
|
|
894
898
|
onFocus: _onFocus,
|
|
895
|
-
children: option.label && /* @__PURE__ */
|
|
899
|
+
children: option.label && /* @__PURE__ */ jsx26(Text4, { children: option.label })
|
|
896
900
|
},
|
|
897
901
|
index
|
|
898
902
|
);
|
|
@@ -906,7 +910,7 @@ function CheckboxesWidget(props) {
|
|
|
906
910
|
// src/RadioWidget/RadioWidget.tsx
|
|
907
911
|
import { Stack as Stack2 } from "@chakra-ui/react";
|
|
908
912
|
import {
|
|
909
|
-
ariaDescribedByIds as
|
|
913
|
+
ariaDescribedByIds as ariaDescribedByIds4,
|
|
910
914
|
enumOptionsIndexForValue as enumOptionsIndexForValue2,
|
|
911
915
|
enumOptionsValueForIndex as enumOptionsValueForIndex2,
|
|
912
916
|
labelValue as labelValue4,
|
|
@@ -916,21 +920,22 @@ import {
|
|
|
916
920
|
// src/components/ui/radio.tsx
|
|
917
921
|
import { forwardRef as forwardRef5 } from "react";
|
|
918
922
|
import { RadioGroup as ChakraRadioGroup } from "@chakra-ui/react";
|
|
919
|
-
import { jsx as
|
|
923
|
+
import { jsx as jsx27, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
920
924
|
var Radio = forwardRef5(function Radio2(props, ref) {
|
|
921
925
|
const { children, inputProps, rootRef, ...rest } = props;
|
|
922
926
|
return /* @__PURE__ */ jsxs15(ChakraRadioGroup.Item, { ref: rootRef, ...rest, children: [
|
|
923
|
-
/* @__PURE__ */
|
|
924
|
-
/* @__PURE__ */
|
|
925
|
-
children && /* @__PURE__ */
|
|
927
|
+
/* @__PURE__ */ jsx27(ChakraRadioGroup.ItemHiddenInput, { ref, ...inputProps }),
|
|
928
|
+
/* @__PURE__ */ jsx27(ChakraRadioGroup.ItemIndicator, {}),
|
|
929
|
+
children && /* @__PURE__ */ jsx27(ChakraRadioGroup.ItemText, { children })
|
|
926
930
|
] });
|
|
927
931
|
});
|
|
928
932
|
var RadioGroup = ChakraRadioGroup.Root;
|
|
929
933
|
|
|
930
934
|
// src/RadioWidget/RadioWidget.tsx
|
|
931
|
-
import { jsx as
|
|
935
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
932
936
|
function RadioWidget({
|
|
933
937
|
id,
|
|
938
|
+
htmlName,
|
|
934
939
|
options,
|
|
935
940
|
value,
|
|
936
941
|
required,
|
|
@@ -950,7 +955,7 @@ function RadioWidget({
|
|
|
950
955
|
const row = options ? options.inline : false;
|
|
951
956
|
const selectedIndex = enumOptionsIndexForValue2(value, enumOptions) ?? null;
|
|
952
957
|
const chakraProps = getChakra({ uiSchema });
|
|
953
|
-
return /* @__PURE__ */
|
|
958
|
+
return /* @__PURE__ */ jsx28(
|
|
954
959
|
Field,
|
|
955
960
|
{
|
|
956
961
|
mb: 1,
|
|
@@ -959,18 +964,18 @@ function RadioWidget({
|
|
|
959
964
|
readOnly: readonly,
|
|
960
965
|
label: labelValue4(label, hideLabel || !label),
|
|
961
966
|
...chakraProps,
|
|
962
|
-
children: /* @__PURE__ */
|
|
967
|
+
children: /* @__PURE__ */ jsx28(
|
|
963
968
|
RadioGroup,
|
|
964
969
|
{
|
|
965
970
|
onChange: _onChange,
|
|
966
971
|
onBlur: _onBlur,
|
|
967
972
|
onFocus: _onFocus,
|
|
968
973
|
value: selectedIndex,
|
|
969
|
-
name: id,
|
|
970
|
-
"aria-describedby":
|
|
971
|
-
children: /* @__PURE__ */
|
|
974
|
+
name: htmlName || id,
|
|
975
|
+
"aria-describedby": ariaDescribedByIds4(id),
|
|
976
|
+
children: /* @__PURE__ */ jsx28(Stack2, { direction: row ? "row" : "column", children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
972
977
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
973
|
-
return /* @__PURE__ */
|
|
978
|
+
return /* @__PURE__ */ jsx28(
|
|
974
979
|
Radio,
|
|
975
980
|
{
|
|
976
981
|
value: String(index),
|
|
@@ -989,7 +994,7 @@ function RadioWidget({
|
|
|
989
994
|
|
|
990
995
|
// src/RangeWidget/RangeWidget.tsx
|
|
991
996
|
import {
|
|
992
|
-
ariaDescribedByIds as
|
|
997
|
+
ariaDescribedByIds as ariaDescribedByIds5,
|
|
993
998
|
labelValue as labelValue5,
|
|
994
999
|
rangeSpec
|
|
995
1000
|
} from "@rjsf/utils";
|
|
@@ -997,7 +1002,7 @@ import {
|
|
|
997
1002
|
// src/components/ui/slider.tsx
|
|
998
1003
|
import { forwardRef as forwardRef6 } from "react";
|
|
999
1004
|
import { Slider as ChakraSlider, HStack as HStack2 } from "@chakra-ui/react";
|
|
1000
|
-
import { Fragment as Fragment2, jsx as
|
|
1005
|
+
import { Fragment as Fragment2, jsx as jsx29, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1001
1006
|
var Slider = forwardRef6(function Slider2(props, ref) {
|
|
1002
1007
|
const { marks: marksProp, showValue, ...rest } = props;
|
|
1003
1008
|
const value = props.defaultValue ?? props.value;
|
|
@@ -1009,35 +1014,35 @@ var Slider = forwardRef6(function Slider2(props, ref) {
|
|
|
1009
1014
|
});
|
|
1010
1015
|
const hasMarkLabel = !!marks?.some((mark) => mark.label);
|
|
1011
1016
|
return /* @__PURE__ */ jsxs16(ChakraSlider.Root, { ref, width: "200px", thumbAlignment: "center", ...rest, children: [
|
|
1012
|
-
showValue && /* @__PURE__ */
|
|
1017
|
+
showValue && /* @__PURE__ */ jsx29(HStack2, { justify: "space-between", children: /* @__PURE__ */ jsx29(ChakraSlider.ValueText, {}) }),
|
|
1013
1018
|
/* @__PURE__ */ jsxs16(ChakraSlider.Control, { "data-has-mark-label": hasMarkLabel || void 0, children: [
|
|
1014
|
-
/* @__PURE__ */
|
|
1015
|
-
/* @__PURE__ */
|
|
1016
|
-
/* @__PURE__ */
|
|
1019
|
+
/* @__PURE__ */ jsx29(ChakraSlider.Track, { children: /* @__PURE__ */ jsx29(ChakraSlider.Range, {}) }),
|
|
1020
|
+
/* @__PURE__ */ jsx29(SliderThumbs, { value }),
|
|
1021
|
+
/* @__PURE__ */ jsx29(SliderMarks, { marks })
|
|
1017
1022
|
] })
|
|
1018
1023
|
] });
|
|
1019
1024
|
});
|
|
1020
1025
|
function SliderThumbs(props) {
|
|
1021
1026
|
const { value } = props;
|
|
1022
|
-
return /* @__PURE__ */
|
|
1027
|
+
return /* @__PURE__ */ jsx29(Fragment2, { children: value?.map((_, index) => /* @__PURE__ */ jsx29(ChakraSlider.Thumb, { index, children: /* @__PURE__ */ jsx29(ChakraSlider.HiddenInput, {}) }, index)) });
|
|
1023
1028
|
}
|
|
1024
1029
|
var SliderMarks = forwardRef6(function SliderMarks2(props, ref) {
|
|
1025
1030
|
const { marks } = props;
|
|
1026
1031
|
if (!marks?.length) {
|
|
1027
1032
|
return null;
|
|
1028
1033
|
}
|
|
1029
|
-
return /* @__PURE__ */
|
|
1034
|
+
return /* @__PURE__ */ jsx29(ChakraSlider.MarkerGroup, { ref, children: marks.map((mark, index) => {
|
|
1030
1035
|
const value = typeof mark === "number" ? mark : mark.value;
|
|
1031
1036
|
const label = typeof mark === "number" ? void 0 : mark.label;
|
|
1032
1037
|
return /* @__PURE__ */ jsxs16(ChakraSlider.Marker, { value, children: [
|
|
1033
|
-
/* @__PURE__ */
|
|
1038
|
+
/* @__PURE__ */ jsx29(ChakraSlider.MarkerIndicator, {}),
|
|
1034
1039
|
label
|
|
1035
1040
|
] }, index);
|
|
1036
1041
|
}) });
|
|
1037
1042
|
});
|
|
1038
1043
|
|
|
1039
1044
|
// src/RangeWidget/RangeWidget.tsx
|
|
1040
|
-
import { jsx as
|
|
1045
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1041
1046
|
function RangeWidget({
|
|
1042
1047
|
value,
|
|
1043
1048
|
readonly,
|
|
@@ -1056,7 +1061,7 @@ function RangeWidget({
|
|
|
1056
1061
|
const _onBlur = ({ target }) => onBlur(id, target && target.value);
|
|
1057
1062
|
const _onFocus = ({ target }) => onFocus(id, target && target.value);
|
|
1058
1063
|
const chakraProps = getChakra({ uiSchema });
|
|
1059
|
-
return /* @__PURE__ */
|
|
1064
|
+
return /* @__PURE__ */ jsx30(Field, { mb: 1, label: labelValue5(label, hideLabel || !label), ...chakraProps, children: /* @__PURE__ */ jsx30(
|
|
1060
1065
|
Slider,
|
|
1061
1066
|
{
|
|
1062
1067
|
...rangeSpec(schema),
|
|
@@ -1067,7 +1072,7 @@ function RangeWidget({
|
|
|
1067
1072
|
onValueChange: _onChange,
|
|
1068
1073
|
onBlur: _onBlur,
|
|
1069
1074
|
onFocus: _onFocus,
|
|
1070
|
-
"aria-describedby":
|
|
1075
|
+
"aria-describedby": ariaDescribedByIds5(id)
|
|
1071
1076
|
}
|
|
1072
1077
|
) });
|
|
1073
1078
|
}
|
|
@@ -1075,7 +1080,7 @@ function RangeWidget({
|
|
|
1075
1080
|
// src/SelectWidget/SelectWidget.tsx
|
|
1076
1081
|
import { useMemo, useRef } from "react";
|
|
1077
1082
|
import {
|
|
1078
|
-
ariaDescribedByIds as
|
|
1083
|
+
ariaDescribedByIds as ariaDescribedByIds6,
|
|
1079
1084
|
enumOptionsIndexForValue as enumOptionsIndexForValue3,
|
|
1080
1085
|
enumOptionsValueForIndex as enumOptionsValueForIndex3,
|
|
1081
1086
|
labelValue as labelValue6
|
|
@@ -1085,36 +1090,36 @@ import { createListCollection, Select as ChakraSelect2 } from "@chakra-ui/react"
|
|
|
1085
1090
|
// src/components/ui/select.tsx
|
|
1086
1091
|
import { forwardRef as forwardRef7 } from "react";
|
|
1087
1092
|
import { Select as ChakraSelect, Portal } from "@chakra-ui/react";
|
|
1088
|
-
import { Fragment as Fragment3, jsx as
|
|
1093
|
+
import { Fragment as Fragment3, jsx as jsx31, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1089
1094
|
var SelectTrigger = forwardRef7(function SelectTrigger2(props, ref) {
|
|
1090
1095
|
const { children, clearable, ...rest } = props;
|
|
1091
1096
|
return /* @__PURE__ */ jsxs17(ChakraSelect.Control, { ...rest, children: [
|
|
1092
|
-
/* @__PURE__ */
|
|
1097
|
+
/* @__PURE__ */ jsx31(ChakraSelect.Trigger, { ref, children }),
|
|
1093
1098
|
/* @__PURE__ */ jsxs17(ChakraSelect.IndicatorGroup, { children: [
|
|
1094
|
-
clearable && /* @__PURE__ */
|
|
1095
|
-
/* @__PURE__ */
|
|
1099
|
+
clearable && /* @__PURE__ */ jsx31(SelectClearTrigger, {}),
|
|
1100
|
+
/* @__PURE__ */ jsx31(ChakraSelect.Indicator, {})
|
|
1096
1101
|
] })
|
|
1097
1102
|
] });
|
|
1098
1103
|
});
|
|
1099
1104
|
var SelectClearTrigger = forwardRef7(
|
|
1100
1105
|
function SelectClearTrigger2(props, ref) {
|
|
1101
|
-
return /* @__PURE__ */
|
|
1106
|
+
return /* @__PURE__ */ jsx31(ChakraSelect.ClearTrigger, { asChild: true, ...props, ref, children: /* @__PURE__ */ jsx31(CloseButton, { size: "xs", variant: "plain", focusVisibleRing: "inside", focusRingWidth: "2px", pointerEvents: "auto" }) });
|
|
1102
1107
|
}
|
|
1103
1108
|
);
|
|
1104
1109
|
var SelectContent = forwardRef7(function SelectContent2(props, ref) {
|
|
1105
1110
|
const { portalled = true, portalRef, ...rest } = props;
|
|
1106
|
-
return /* @__PURE__ */
|
|
1111
|
+
return /* @__PURE__ */ jsx31(Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ jsx31(ChakraSelect.Positioner, { children: /* @__PURE__ */ jsx31(ChakraSelect.Content, { ...rest, ref }) }) });
|
|
1107
1112
|
});
|
|
1108
1113
|
var SelectItem = forwardRef7(function SelectItem2(props, ref) {
|
|
1109
1114
|
const { item, children, ...rest } = props;
|
|
1110
1115
|
return /* @__PURE__ */ jsxs17(ChakraSelect.Item, { item, ...rest, ref, children: [
|
|
1111
1116
|
children,
|
|
1112
|
-
/* @__PURE__ */
|
|
1117
|
+
/* @__PURE__ */ jsx31(ChakraSelect.ItemIndicator, {})
|
|
1113
1118
|
] }, item.value);
|
|
1114
1119
|
});
|
|
1115
1120
|
var SelectValueText = forwardRef7(function SelectValueText2(props, ref) {
|
|
1116
1121
|
const { children, ...rest } = props;
|
|
1117
|
-
return /* @__PURE__ */
|
|
1122
|
+
return /* @__PURE__ */ jsx31(ChakraSelect.ValueText, { ...rest, ref, children: /* @__PURE__ */ jsx31(ChakraSelect.Context, { children: (select) => {
|
|
1118
1123
|
const items = select.selectedItems;
|
|
1119
1124
|
if (items.length === 0) {
|
|
1120
1125
|
return props.placeholder;
|
|
@@ -1129,15 +1134,15 @@ var SelectValueText = forwardRef7(function SelectValueText2(props, ref) {
|
|
|
1129
1134
|
} }) });
|
|
1130
1135
|
});
|
|
1131
1136
|
var SelectRoot = forwardRef7(function SelectRoot2(props, ref) {
|
|
1132
|
-
return /* @__PURE__ */
|
|
1133
|
-
/* @__PURE__ */
|
|
1137
|
+
return /* @__PURE__ */ jsx31(ChakraSelect.Root, { ...props, ref, positioning: { sameWidth: true, ...props.positioning }, children: props.asChild ? props.children : /* @__PURE__ */ jsxs17(Fragment3, { children: [
|
|
1138
|
+
/* @__PURE__ */ jsx31(ChakraSelect.HiddenSelect, {}),
|
|
1134
1139
|
props.children
|
|
1135
1140
|
] }) });
|
|
1136
1141
|
});
|
|
1137
1142
|
var SelectItemGroup = forwardRef7(function SelectItemGroup2(props, ref) {
|
|
1138
1143
|
const { children, label, ...rest } = props;
|
|
1139
1144
|
return /* @__PURE__ */ jsxs17(ChakraSelect.ItemGroup, { ...rest, ref, children: [
|
|
1140
|
-
/* @__PURE__ */
|
|
1145
|
+
/* @__PURE__ */ jsx31(ChakraSelect.ItemGroupLabel, { children: label }),
|
|
1141
1146
|
children
|
|
1142
1147
|
] });
|
|
1143
1148
|
});
|
|
@@ -1145,10 +1150,11 @@ var SelectLabel = ChakraSelect.Label;
|
|
|
1145
1150
|
var SelectItemText = ChakraSelect.ItemText;
|
|
1146
1151
|
|
|
1147
1152
|
// src/SelectWidget/SelectWidget.tsx
|
|
1148
|
-
import { jsx as
|
|
1153
|
+
import { jsx as jsx32, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1149
1154
|
function SelectWidget(props) {
|
|
1150
1155
|
const {
|
|
1151
1156
|
id,
|
|
1157
|
+
htmlName,
|
|
1152
1158
|
options,
|
|
1153
1159
|
label,
|
|
1154
1160
|
hideLabel,
|
|
@@ -1168,19 +1174,12 @@ function SelectWidget(props) {
|
|
|
1168
1174
|
} = props;
|
|
1169
1175
|
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
1170
1176
|
const _onMultiChange = ({ value: value2 }) => {
|
|
1171
|
-
return onChange(
|
|
1172
|
-
enumOptionsValueForIndex3(
|
|
1173
|
-
value2.map((item) => {
|
|
1174
|
-
return item;
|
|
1175
|
-
}),
|
|
1176
|
-
enumOptions,
|
|
1177
|
-
emptyValue
|
|
1178
|
-
)
|
|
1179
|
-
);
|
|
1180
|
-
};
|
|
1181
|
-
const _onChange = ({ value: value2 }) => {
|
|
1182
1177
|
return onChange(enumOptionsValueForIndex3(value2, enumOptions, emptyValue));
|
|
1183
1178
|
};
|
|
1179
|
+
const _onSingleChange = ({ value: value2 }) => {
|
|
1180
|
+
const selected = enumOptionsValueForIndex3(value2, enumOptions, emptyValue);
|
|
1181
|
+
return onChange(Array.isArray(selected) && selected.length === 1 ? selected[0] : selected);
|
|
1182
|
+
};
|
|
1184
1183
|
const _onBlur = ({ target }) => onBlur(id, enumOptionsValueForIndex3(target && target.value, enumOptions, emptyValue));
|
|
1185
1184
|
const _onFocus = ({ target }) => onFocus(id, enumOptionsValueForIndex3(target && target.value, enumOptions, emptyValue));
|
|
1186
1185
|
const showPlaceholderOption = !multiple && schema.default === void 0;
|
|
@@ -1223,7 +1222,7 @@ function SelectWidget(props) {
|
|
|
1223
1222
|
});
|
|
1224
1223
|
const containerRef = useRef(null);
|
|
1225
1224
|
const chakraProps = getChakra({ uiSchema });
|
|
1226
|
-
return /* @__PURE__ */
|
|
1225
|
+
return /* @__PURE__ */ jsx32(
|
|
1227
1226
|
Field,
|
|
1228
1227
|
{
|
|
1229
1228
|
ref: containerRef,
|
|
@@ -1240,21 +1239,21 @@ function SelectWidget(props) {
|
|
|
1240
1239
|
{
|
|
1241
1240
|
collection: selectOptions,
|
|
1242
1241
|
id,
|
|
1243
|
-
name: id,
|
|
1242
|
+
name: htmlName || id,
|
|
1244
1243
|
multiple: isMultiple,
|
|
1245
1244
|
closeOnSelect: !isMultiple,
|
|
1246
1245
|
onBlur: _onBlur,
|
|
1247
|
-
onValueChange: isMultiple ? _onMultiChange :
|
|
1246
|
+
onValueChange: isMultiple ? _onMultiChange : _onSingleChange,
|
|
1248
1247
|
onFocus: _onFocus,
|
|
1249
1248
|
autoFocus: autofocus,
|
|
1250
1249
|
value: formValue,
|
|
1251
|
-
"aria-describedby":
|
|
1250
|
+
"aria-describedby": ariaDescribedByIds6(id),
|
|
1252
1251
|
positioning: { placement: "bottom" },
|
|
1253
1252
|
children: [
|
|
1254
|
-
/* @__PURE__ */
|
|
1255
|
-
/* @__PURE__ */
|
|
1253
|
+
/* @__PURE__ */ jsx32(ChakraSelect2.Control, { children: /* @__PURE__ */ jsx32(SelectTrigger, { children: /* @__PURE__ */ jsx32(SelectValueText, { placeholder }) }) }),
|
|
1254
|
+
/* @__PURE__ */ jsx32(ChakraSelect2.Positioner, { minWidth: "100% !important", zIndex: "2 !important", top: "calc(100% + 5px) !important", children: /* @__PURE__ */ jsx32(ChakraSelect2.Content, { children: selectOptions.items.map((item) => /* @__PURE__ */ jsxs18(ChakraSelect2.Item, { item, children: [
|
|
1256
1255
|
item.label,
|
|
1257
|
-
/* @__PURE__ */
|
|
1256
|
+
/* @__PURE__ */ jsx32(ChakraSelect2.ItemIndicator, {})
|
|
1258
1257
|
] }, item.value)) }) })
|
|
1259
1258
|
]
|
|
1260
1259
|
}
|
|
@@ -1266,13 +1265,13 @@ function SelectWidget(props) {
|
|
|
1266
1265
|
// src/SelectNativeWidget/NativeSelectWidget.tsx
|
|
1267
1266
|
import { useMemo as useMemo2 } from "react";
|
|
1268
1267
|
import {
|
|
1269
|
-
ariaDescribedByIds as
|
|
1268
|
+
ariaDescribedByIds as ariaDescribedByIds7,
|
|
1270
1269
|
enumOptionsIndexForValue as enumOptionsIndexForValue4,
|
|
1271
1270
|
enumOptionsValueForIndex as enumOptionsValueForIndex4,
|
|
1272
1271
|
labelValue as labelValue7
|
|
1273
1272
|
} from "@rjsf/utils";
|
|
1274
1273
|
import { createListCollection as createListCollection2, NativeSelect as ChakraSelect3 } from "@chakra-ui/react";
|
|
1275
|
-
import { jsx as
|
|
1274
|
+
import { jsx as jsx33, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1276
1275
|
function NativeSelectWidget(props) {
|
|
1277
1276
|
const {
|
|
1278
1277
|
id,
|
|
@@ -1331,7 +1330,7 @@ function NativeSelectWidget(props) {
|
|
|
1331
1330
|
items: displayEnumOptions.filter((item) => item.value)
|
|
1332
1331
|
});
|
|
1333
1332
|
const chakraProps = getChakra({ uiSchema });
|
|
1334
|
-
return /* @__PURE__ */
|
|
1333
|
+
return /* @__PURE__ */ jsx33(
|
|
1335
1334
|
Field,
|
|
1336
1335
|
{
|
|
1337
1336
|
mb: 1,
|
|
@@ -1342,7 +1341,7 @@ function NativeSelectWidget(props) {
|
|
|
1342
1341
|
label: labelValue7(label, hideLabel || !label),
|
|
1343
1342
|
...chakraProps,
|
|
1344
1343
|
children: /* @__PURE__ */ jsxs19(ChakraSelect3.Root, { children: [
|
|
1345
|
-
/* @__PURE__ */
|
|
1344
|
+
/* @__PURE__ */ jsx33(
|
|
1346
1345
|
ChakraSelect3.Field,
|
|
1347
1346
|
{
|
|
1348
1347
|
id,
|
|
@@ -1351,11 +1350,11 @@ function NativeSelectWidget(props) {
|
|
|
1351
1350
|
onFocus: _onFocus,
|
|
1352
1351
|
autoFocus: autofocus,
|
|
1353
1352
|
value: formValue,
|
|
1354
|
-
"aria-describedby":
|
|
1355
|
-
children: selectOptions.items.map((item) => /* @__PURE__ */
|
|
1353
|
+
"aria-describedby": ariaDescribedByIds7(id),
|
|
1354
|
+
children: selectOptions.items.map((item) => /* @__PURE__ */ jsx33("option", { value: item.value, children: item.label }, item.value))
|
|
1356
1355
|
}
|
|
1357
1356
|
),
|
|
1358
|
-
/* @__PURE__ */
|
|
1357
|
+
/* @__PURE__ */ jsx33(ChakraSelect3.Indicator, {})
|
|
1359
1358
|
] })
|
|
1360
1359
|
}
|
|
1361
1360
|
);
|
|
@@ -1364,12 +1363,13 @@ function NativeSelectWidget(props) {
|
|
|
1364
1363
|
// src/TextareaWidget/TextareaWidget.tsx
|
|
1365
1364
|
import { Textarea } from "@chakra-ui/react";
|
|
1366
1365
|
import {
|
|
1367
|
-
ariaDescribedByIds as
|
|
1366
|
+
ariaDescribedByIds as ariaDescribedByIds8,
|
|
1368
1367
|
labelValue as labelValue8
|
|
1369
1368
|
} from "@rjsf/utils";
|
|
1370
|
-
import { jsx as
|
|
1369
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
1371
1370
|
function TextareaWidget({
|
|
1372
1371
|
id,
|
|
1372
|
+
htmlName,
|
|
1373
1373
|
placeholder,
|
|
1374
1374
|
value,
|
|
1375
1375
|
label,
|
|
@@ -1389,7 +1389,7 @@ function TextareaWidget({
|
|
|
1389
1389
|
const _onBlur = ({ target }) => onBlur(id, target && target.value);
|
|
1390
1390
|
const _onFocus = ({ target }) => onFocus(id, target && target.value);
|
|
1391
1391
|
const chakraProps = getChakra({ uiSchema });
|
|
1392
|
-
return /* @__PURE__ */
|
|
1392
|
+
return /* @__PURE__ */ jsx34(
|
|
1393
1393
|
Field,
|
|
1394
1394
|
{
|
|
1395
1395
|
mb: 1,
|
|
@@ -1399,11 +1399,11 @@ function TextareaWidget({
|
|
|
1399
1399
|
invalid: rawErrors && rawErrors.length > 0,
|
|
1400
1400
|
label: labelValue8(label, hideLabel || !label),
|
|
1401
1401
|
...chakraProps,
|
|
1402
|
-
children: /* @__PURE__ */
|
|
1402
|
+
children: /* @__PURE__ */ jsx34(
|
|
1403
1403
|
Textarea,
|
|
1404
1404
|
{
|
|
1405
1405
|
id,
|
|
1406
|
-
name: id,
|
|
1406
|
+
name: htmlName || id,
|
|
1407
1407
|
value: value ?? "",
|
|
1408
1408
|
placeholder,
|
|
1409
1409
|
autoFocus: autofocus,
|
|
@@ -1411,7 +1411,7 @@ function TextareaWidget({
|
|
|
1411
1411
|
onBlur: _onBlur,
|
|
1412
1412
|
onFocus: _onFocus,
|
|
1413
1413
|
rows: options.rows,
|
|
1414
|
-
"aria-describedby":
|
|
1414
|
+
"aria-describedby": ariaDescribedByIds8(id)
|
|
1415
1415
|
}
|
|
1416
1416
|
)
|
|
1417
1417
|
}
|
|
@@ -1420,39 +1420,39 @@ function TextareaWidget({
|
|
|
1420
1420
|
|
|
1421
1421
|
// src/UpDownWidget/UpDownWidget.tsx
|
|
1422
1422
|
import {
|
|
1423
|
-
ariaDescribedByIds as
|
|
1423
|
+
ariaDescribedByIds as ariaDescribedByIds9,
|
|
1424
1424
|
labelValue as labelValue9
|
|
1425
1425
|
} from "@rjsf/utils";
|
|
1426
1426
|
|
|
1427
1427
|
// src/components/ui/number-input.tsx
|
|
1428
|
-
import { forwardRef as forwardRef8, useEffect
|
|
1428
|
+
import { forwardRef as forwardRef8, useEffect, useRef as useRef2 } from "react";
|
|
1429
1429
|
import { NumberInput as ChakraNumberInput } from "@chakra-ui/react";
|
|
1430
|
-
import { jsx as
|
|
1430
|
+
import { jsx as jsx35, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1431
1431
|
var NumberInputRoot = forwardRef8(function NumberInput(props, ref) {
|
|
1432
1432
|
const inputRef = useRef2(null);
|
|
1433
|
-
|
|
1433
|
+
useEffect(() => {
|
|
1434
1434
|
if (inputRef.current) {
|
|
1435
1435
|
inputRef.current.value = props.value || "";
|
|
1436
1436
|
}
|
|
1437
1437
|
}, [props.value]);
|
|
1438
1438
|
return /* @__PURE__ */ jsxs20(ChakraNumberInput.Root, { ref, variant: "outline", ...props, children: [
|
|
1439
1439
|
/* @__PURE__ */ jsxs20(ChakraNumberInput.Control, { children: [
|
|
1440
|
-
/* @__PURE__ */
|
|
1441
|
-
/* @__PURE__ */
|
|
1440
|
+
/* @__PURE__ */ jsx35(ChakraNumberInput.IncrementTrigger, {}),
|
|
1441
|
+
/* @__PURE__ */ jsx35(ChakraNumberInput.DecrementTrigger, {})
|
|
1442
1442
|
] }),
|
|
1443
|
-
/* @__PURE__ */
|
|
1443
|
+
/* @__PURE__ */ jsx35(ChakraNumberInput.Input, { ref: inputRef })
|
|
1444
1444
|
] });
|
|
1445
1445
|
});
|
|
1446
1446
|
|
|
1447
1447
|
// src/UpDownWidget/UpDownWidget.tsx
|
|
1448
|
-
import { jsx as
|
|
1448
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
1449
1449
|
function UpDownWidget(props) {
|
|
1450
1450
|
const { id, readonly, disabled, label, hideLabel, value, onChange, onBlur, onFocus, rawErrors, required } = props;
|
|
1451
1451
|
const _onChange = ({ value: value2 }) => onChange(value2);
|
|
1452
1452
|
const _onBlur = ({ target }) => onBlur(id, target && target.value);
|
|
1453
1453
|
const _onFocus = ({ target }) => onFocus(id, target && target.value);
|
|
1454
1454
|
const chakraProps = getChakra({ uiSchema: props.uiSchema });
|
|
1455
|
-
return /* @__PURE__ */
|
|
1455
|
+
return /* @__PURE__ */ jsx36(
|
|
1456
1456
|
Field,
|
|
1457
1457
|
{
|
|
1458
1458
|
mb: 1,
|
|
@@ -1462,14 +1462,14 @@ function UpDownWidget(props) {
|
|
|
1462
1462
|
invalid: rawErrors && rawErrors.length > 0,
|
|
1463
1463
|
label: labelValue9(label, hideLabel || !label),
|
|
1464
1464
|
...chakraProps,
|
|
1465
|
-
children: /* @__PURE__ */
|
|
1465
|
+
children: /* @__PURE__ */ jsx36(
|
|
1466
1466
|
NumberInputRoot,
|
|
1467
1467
|
{
|
|
1468
1468
|
value,
|
|
1469
1469
|
onValueChange: _onChange,
|
|
1470
1470
|
onBlur: _onBlur,
|
|
1471
1471
|
onFocus: _onFocus,
|
|
1472
|
-
"aria-describedby":
|
|
1472
|
+
"aria-describedby": ariaDescribedByIds9(id),
|
|
1473
1473
|
id,
|
|
1474
1474
|
name: id
|
|
1475
1475
|
}
|
|
@@ -1515,13 +1515,13 @@ import { CacheProvider } from "@emotion/react";
|
|
|
1515
1515
|
import createCache from "@emotion/cache";
|
|
1516
1516
|
import weakMemoize from "@emotion/weak-memoize";
|
|
1517
1517
|
import { ChakraProvider, defaultSystem as defaultSystem2 } from "@chakra-ui/react";
|
|
1518
|
-
import { jsx as
|
|
1518
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
1519
1519
|
var memoizedCreateCacheWithContainer = weakMemoize((container) => {
|
|
1520
1520
|
const newCache = createCache({ container, key: "rjsf" });
|
|
1521
1521
|
return newCache;
|
|
1522
1522
|
});
|
|
1523
1523
|
var __createChakraFrameProvider = (props) => ({ document }) => {
|
|
1524
|
-
return /* @__PURE__ */
|
|
1524
|
+
return /* @__PURE__ */ jsx37("div", { style: { margin: 2 }, children: /* @__PURE__ */ jsx37(CacheProvider, { value: memoizedCreateCacheWithContainer(document.head), children: /* @__PURE__ */ jsx37(ChakraProvider, { value: defaultSystem2, children: props.children }) }) });
|
|
1525
1525
|
};
|
|
1526
1526
|
|
|
1527
1527
|
// src/index.ts
|