@rjsf/chakra-ui 5.24.10 → 6.0.0-beta.1
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/chakra-ui.esm.js +664 -700
- package/dist/chakra-ui.esm.js.map +4 -4
- package/dist/chakra-ui.umd.js +488 -579
- package/dist/index.js +670 -708
- package/dist/index.js.map +4 -4
- package/lib/AddButton/AddButton.js +3 -3
- package/lib/AddButton/AddButton.js.map +1 -1
- package/lib/AltDateWidget/AltDateWidget.js.map +1 -1
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +2 -2
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +5 -8
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +2 -2
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
- package/lib/BaseInputTemplate/BaseInputTemplate.js +4 -5
- package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
- package/lib/ChakraFrameProvider.js +3 -4
- package/lib/ChakraFrameProvider.js.map +1 -1
- package/lib/CheckboxWidget/CheckboxWidget.js +5 -5
- package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.js +10 -13
- package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
- package/lib/DescriptionField/DescriptionField.js.map +1 -1
- package/lib/ErrorList/ErrorList.js +4 -3
- package/lib/ErrorList/ErrorList.js.map +1 -1
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js +3 -3
- 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/GridTemplate/GridTemplate.d.ts +7 -0
- package/lib/GridTemplate/GridTemplate.js +15 -0
- package/lib/GridTemplate/GridTemplate.js.map +1 -0
- package/lib/GridTemplate/index.d.ts +2 -0
- package/lib/GridTemplate/index.js +3 -0
- package/lib/GridTemplate/index.js.map +1 -0
- package/lib/IconButton/ChakraIconButton.js +1 -1
- package/lib/IconButton/ChakraIconButton.js.map +1 -1
- package/lib/IconButton/IconButton.js +1 -1
- package/lib/IconButton/IconButton.js.map +1 -1
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +2 -2
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
- package/lib/RadioWidget/RadioWidget.d.ts +1 -1
- package/lib/RadioWidget/RadioWidget.js +11 -11
- package/lib/RadioWidget/RadioWidget.js.map +1 -1
- package/lib/RangeWidget/RangeWidget.d.ts +1 -1
- package/lib/RangeWidget/RangeWidget.js +6 -8
- package/lib/RangeWidget/RangeWidget.js.map +1 -1
- package/lib/SelectNativeWidget/NativeSelectWidget.d.ts +12 -0
- package/lib/SelectNativeWidget/NativeSelectWidget.js +60 -0
- package/lib/SelectNativeWidget/NativeSelectWidget.js.map +1 -0
- package/lib/SelectNativeWidget/index.d.ts +2 -0
- package/lib/SelectNativeWidget/index.js +3 -0
- package/lib/SelectNativeWidget/index.js.map +1 -0
- package/lib/SelectWidget/SelectWidget.js +30 -23
- package/lib/SelectWidget/SelectWidget.js.map +1 -1
- package/lib/SubmitButton/SubmitButton.js.map +1 -1
- package/lib/Templates/Templates.js +2 -0
- package/lib/Templates/Templates.js.map +1 -1
- package/lib/TextareaWidget/TextareaWidget.d.ts +1 -1
- package/lib/TextareaWidget/TextareaWidget.js +5 -6
- package/lib/TextareaWidget/TextareaWidget.js.map +1 -1
- package/lib/TitleField/TitleField.js +2 -2
- package/lib/TitleField/TitleField.js.map +1 -1
- package/lib/UpDownWidget/UpDownWidget.js +6 -7
- package/lib/UpDownWidget/UpDownWidget.js.map +1 -1
- package/lib/Widgets/Widgets.js +2 -0
- package/lib/Widgets/Widgets.js.map +1 -1
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +4 -3
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/components/ui/alert.d.ts +24 -0
- package/lib/components/ui/alert.js +9 -0
- package/lib/components/ui/alert.js.map +1 -0
- package/lib/components/ui/checkbox.d.ts +17 -0
- package/lib/components/ui/checkbox.js +17 -0
- package/lib/components/ui/checkbox.js.map +1 -0
- package/lib/components/ui/close-button.d.ts +10 -0
- package/lib/components/ui/close-button.js +16 -0
- package/lib/components/ui/close-button.js.map +1 -0
- package/lib/components/ui/field.d.ts +20 -0
- package/lib/components/ui/field.js +19 -0
- package/lib/components/ui/field.js.map +1 -0
- package/lib/components/ui/number-input.d.ts +10 -0
- package/lib/components/ui/number-input.js +20 -0
- package/lib/components/ui/number-input.js.map +1 -0
- package/lib/components/ui/radio.d.ts +16 -0
- package/lib/components/ui/radio.js +17 -0
- package/lib/components/ui/radio.js.map +1 -0
- package/lib/components/ui/select.d.ts +73 -0
- package/lib/components/ui/select.js +99 -0
- package/lib/components/ui/select.js.map +1 -0
- package/lib/components/ui/slider.d.ts +18 -0
- package/lib/components/ui/slider.js +55 -0
- package/lib/components/ui/slider.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils.d.ts +3 -6
- package/lib/utils.js +6 -7
- package/lib/utils.js.map +1 -1
- package/package.json +52 -47
- package/src/AddButton/AddButton.tsx +3 -2
- package/src/AltDateTimeWidget/AltDateTimeWidget.tsx +1 -1
- package/src/AltDateWidget/AltDateWidget.tsx +3 -3
- package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +18 -60
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +9 -7
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +11 -18
- package/src/ChakraFrameProvider.tsx +3 -4
- package/src/CheckboxWidget/CheckboxWidget.tsx +13 -12
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +14 -29
- package/src/DescriptionField/DescriptionField.tsx +1 -1
- package/src/ErrorList/ErrorList.tsx +16 -7
- package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +5 -5
- package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +3 -3
- package/src/FieldTemplate/FieldTemplate.tsx +8 -8
- package/src/Form/Form.tsx +1 -1
- package/src/GridTemplate/GridTemplate.tsx +15 -0
- package/src/GridTemplate/index.ts +2 -0
- package/src/IconButton/ChakraIconButton.tsx +7 -3
- package/src/IconButton/IconButton.tsx +5 -5
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +6 -4
- package/src/RadioWidget/RadioWidget.tsx +15 -14
- package/src/RangeWidget/RangeWidget.tsx +13 -20
- package/src/SelectNativeWidget/NativeSelectWidget.tsx +134 -0
- package/src/SelectNativeWidget/index.ts +2 -0
- package/src/SelectWidget/SelectWidget.tsx +74 -46
- package/src/SubmitButton/SubmitButton.tsx +1 -1
- package/src/Templates/Templates.ts +3 -1
- package/src/TextareaWidget/TextareaWidget.tsx +11 -14
- package/src/Theme/Theme.tsx +1 -1
- package/src/TitleField/TitleField.tsx +2 -2
- package/src/UpDownWidget/UpDownWidget.tsx +21 -34
- package/src/Widgets/Widgets.ts +3 -1
- package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +9 -7
- package/src/components/ui/alert.tsx +47 -0
- package/src/components/ui/checkbox.tsx +28 -0
- package/src/components/ui/close-button.tsx +21 -0
- package/src/components/ui/field.tsx +37 -0
- package/src/components/ui/number-input.tsx +31 -0
- package/src/components/ui/radio.tsx +28 -0
- package/src/components/ui/select.tsx +171 -0
- package/src/components/ui/slider.tsx +100 -0
- package/src/tsconfig.json +3 -4
- package/src/utils.ts +8 -12
- package/LICENSE.md +0 -201
- package/lib/CssReset.d.ts +0 -23
- package/lib/CssReset.js +0 -266
- package/lib/CssReset.js.map +0 -1
- package/src/CssReset.tsx +0 -270
package/dist/chakra-ui.esm.js
CHANGED
|
@@ -4,107 +4,63 @@ import { withTheme } from "@rjsf/core";
|
|
|
4
4
|
// src/AddButton/AddButton.tsx
|
|
5
5
|
import { TranslatableString } from "@rjsf/utils";
|
|
6
6
|
import { Button } from "@chakra-ui/react";
|
|
7
|
-
import {
|
|
8
|
-
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { PlusIcon } from "lucide-react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
function AddButton({
|
|
10
10
|
uiSchema,
|
|
11
11
|
registry,
|
|
12
12
|
...props
|
|
13
13
|
}) {
|
|
14
14
|
const { translateString } = registry;
|
|
15
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ jsxs(Button, { ...props, children: [
|
|
16
|
+
/* @__PURE__ */ jsx(PlusIcon, {}),
|
|
17
|
+
translateString(TranslatableString.AddItemButton)
|
|
18
|
+
] });
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
// src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx
|
|
19
|
-
import { useMemo } from "react";
|
|
20
22
|
import { Box, ButtonGroup, HStack } from "@chakra-ui/react";
|
|
21
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
getTemplate,
|
|
25
|
+
getUiOptions
|
|
26
|
+
} from "@rjsf/utils";
|
|
27
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
22
28
|
function ArrayFieldItemTemplate(props) {
|
|
23
|
-
const {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
index,
|
|
32
|
-
onCopyIndexClick,
|
|
33
|
-
onDropIndexClick,
|
|
34
|
-
onReorderClick,
|
|
35
|
-
readonly,
|
|
36
|
-
uiSchema,
|
|
37
|
-
registry
|
|
38
|
-
} = props;
|
|
39
|
-
const { CopyButton: CopyButton2, MoveDownButton: MoveDownButton2, MoveUpButton: MoveUpButton2, RemoveButton: RemoveButton2 } = registry.templates.ButtonTemplates;
|
|
40
|
-
const onCopyClick = useMemo(() => onCopyIndexClick(index), [index, onCopyIndexClick]);
|
|
41
|
-
const onRemoveClick = useMemo(() => onDropIndexClick(index), [index, onDropIndexClick]);
|
|
42
|
-
const onArrowUpClick = useMemo(() => onReorderClick(index, index - 1), [index, onReorderClick]);
|
|
43
|
-
const onArrowDownClick = useMemo(() => onReorderClick(index, index + 1), [index, onReorderClick]);
|
|
44
|
-
return /* @__PURE__ */ jsxs(HStack, { alignItems: "flex-end", py: 1, children: [
|
|
29
|
+
const { children, buttonsProps, hasToolbar, uiSchema, registry } = props;
|
|
30
|
+
const uiOptions = getUiOptions(uiSchema);
|
|
31
|
+
const ArrayFieldItemButtonsTemplate = getTemplate(
|
|
32
|
+
"ArrayFieldItemButtonsTemplate",
|
|
33
|
+
registry,
|
|
34
|
+
uiOptions
|
|
35
|
+
);
|
|
36
|
+
return /* @__PURE__ */ jsxs2(HStack, { alignItems: "flex-end", py: 1, children: [
|
|
45
37
|
/* @__PURE__ */ jsx2(Box, { w: "100%", children }),
|
|
46
|
-
hasToolbar && /* @__PURE__ */ jsx2(Box, { children: /* @__PURE__ */
|
|
47
|
-
(hasMoveUp || hasMoveDown) && /* @__PURE__ */ jsx2(
|
|
48
|
-
MoveUpButton2,
|
|
49
|
-
{
|
|
50
|
-
disabled: disabled || readonly || !hasMoveUp,
|
|
51
|
-
onClick: onArrowUpClick,
|
|
52
|
-
uiSchema,
|
|
53
|
-
registry
|
|
54
|
-
}
|
|
55
|
-
),
|
|
56
|
-
(hasMoveUp || hasMoveDown) && /* @__PURE__ */ jsx2(
|
|
57
|
-
MoveDownButton2,
|
|
58
|
-
{
|
|
59
|
-
disabled: disabled || readonly || !hasMoveDown,
|
|
60
|
-
onClick: onArrowDownClick,
|
|
61
|
-
uiSchema,
|
|
62
|
-
registry
|
|
63
|
-
}
|
|
64
|
-
),
|
|
65
|
-
hasCopy && /* @__PURE__ */ jsx2(
|
|
66
|
-
CopyButton2,
|
|
67
|
-
{
|
|
68
|
-
disabled: disabled || readonly,
|
|
69
|
-
onClick: onCopyClick,
|
|
70
|
-
uiSchema,
|
|
71
|
-
registry
|
|
72
|
-
}
|
|
73
|
-
),
|
|
74
|
-
hasRemove && /* @__PURE__ */ jsx2(
|
|
75
|
-
RemoveButton2,
|
|
76
|
-
{
|
|
77
|
-
disabled: disabled || readonly,
|
|
78
|
-
onClick: onRemoveClick,
|
|
79
|
-
uiSchema,
|
|
80
|
-
registry
|
|
81
|
-
}
|
|
82
|
-
)
|
|
83
|
-
] }) })
|
|
38
|
+
hasToolbar && /* @__PURE__ */ jsx2(Box, { children: /* @__PURE__ */ jsx2(ButtonGroup, { attached: true, mb: 1, children: /* @__PURE__ */ jsx2(ArrayFieldItemButtonsTemplate, { ...buttonsProps }) }) })
|
|
84
39
|
] });
|
|
85
40
|
}
|
|
86
41
|
|
|
87
42
|
// src/ArrayFieldTemplate/ArrayFieldTemplate.tsx
|
|
88
43
|
import { Box as Box2, Grid, GridItem } from "@chakra-ui/react";
|
|
89
44
|
import {
|
|
90
|
-
getTemplate,
|
|
91
|
-
getUiOptions
|
|
45
|
+
getTemplate as getTemplate2,
|
|
46
|
+
getUiOptions as getUiOptions2,
|
|
47
|
+
buttonId
|
|
92
48
|
} from "@rjsf/utils";
|
|
93
|
-
import { jsx as jsx3, jsxs as
|
|
49
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
94
50
|
function ArrayFieldTemplate(props) {
|
|
95
51
|
const { canAdd, disabled, idSchema, uiSchema, items, onAddClick, readonly, registry, required, schema, title } = props;
|
|
96
|
-
const uiOptions =
|
|
97
|
-
const ArrayFieldDescriptionTemplate =
|
|
52
|
+
const uiOptions = getUiOptions2(uiSchema);
|
|
53
|
+
const ArrayFieldDescriptionTemplate = getTemplate2(
|
|
98
54
|
"ArrayFieldDescriptionTemplate",
|
|
99
55
|
registry,
|
|
100
56
|
uiOptions
|
|
101
57
|
);
|
|
102
|
-
const ArrayFieldItemTemplate2 =
|
|
58
|
+
const ArrayFieldItemTemplate2 = getTemplate2(
|
|
103
59
|
"ArrayFieldItemTemplate",
|
|
104
60
|
registry,
|
|
105
61
|
uiOptions
|
|
106
62
|
);
|
|
107
|
-
const ArrayFieldTitleTemplate =
|
|
63
|
+
const ArrayFieldTitleTemplate = getTemplate2(
|
|
108
64
|
"ArrayFieldTitleTemplate",
|
|
109
65
|
registry,
|
|
110
66
|
uiOptions
|
|
@@ -112,7 +68,7 @@ function ArrayFieldTemplate(props) {
|
|
|
112
68
|
const {
|
|
113
69
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
114
70
|
} = registry.templates;
|
|
115
|
-
return /* @__PURE__ */
|
|
71
|
+
return /* @__PURE__ */ jsxs3(Box2, { children: [
|
|
116
72
|
/* @__PURE__ */ jsx3(
|
|
117
73
|
ArrayFieldTitleTemplate,
|
|
118
74
|
{
|
|
@@ -134,12 +90,13 @@ function ArrayFieldTemplate(props) {
|
|
|
134
90
|
registry
|
|
135
91
|
}
|
|
136
92
|
),
|
|
137
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ jsxs3(Grid, { children: [
|
|
138
94
|
/* @__PURE__ */ jsx3(GridItem, { children: items.length > 0 && items.map(({ key, ...itemProps }) => /* @__PURE__ */ jsx3(ArrayFieldItemTemplate2, { ...itemProps }, key)) }),
|
|
139
95
|
canAdd && /* @__PURE__ */ jsx3(GridItem, { justifySelf: "flex-end", children: /* @__PURE__ */ jsx3(Box2, { mt: 2, children: /* @__PURE__ */ jsx3(
|
|
140
96
|
AddButton2,
|
|
141
97
|
{
|
|
142
|
-
|
|
98
|
+
id: buttonId(idSchema, "add"),
|
|
99
|
+
className: "rjsf-array-item-add",
|
|
143
100
|
onClick: onAddClick,
|
|
144
101
|
disabled: disabled || readonly,
|
|
145
102
|
uiSchema,
|
|
@@ -151,7 +108,7 @@ function ArrayFieldTemplate(props) {
|
|
|
151
108
|
}
|
|
152
109
|
|
|
153
110
|
// src/BaseInputTemplate/BaseInputTemplate.tsx
|
|
154
|
-
import {
|
|
111
|
+
import { Input } from "@chakra-ui/react";
|
|
155
112
|
import {
|
|
156
113
|
ariaDescribedByIds,
|
|
157
114
|
examplesId,
|
|
@@ -159,20 +116,25 @@ import {
|
|
|
159
116
|
getInputProps
|
|
160
117
|
} from "@rjsf/utils";
|
|
161
118
|
|
|
162
|
-
// src/
|
|
163
|
-
import {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
119
|
+
// src/components/ui/field.tsx
|
|
120
|
+
import { forwardRef } from "react";
|
|
121
|
+
import { Field as ChakraField } from "@chakra-ui/react";
|
|
122
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
123
|
+
var Field = forwardRef(function Field2(props, ref) {
|
|
124
|
+
const { label, children, helperText, errorText, optionalText, ...rest } = props;
|
|
125
|
+
return /* @__PURE__ */ jsxs4(ChakraField.Root, { ref, ...rest, children: [
|
|
126
|
+
label && /* @__PURE__ */ jsxs4(ChakraField.Label, { children: [
|
|
127
|
+
label,
|
|
128
|
+
/* @__PURE__ */ jsx4(ChakraField.RequiredIndicator, { fallback: optionalText })
|
|
129
|
+
] }),
|
|
130
|
+
children,
|
|
131
|
+
helperText && /* @__PURE__ */ jsx4(ChakraField.HelperText, { children: helperText }),
|
|
132
|
+
errorText && /* @__PURE__ */ jsx4(ChakraField.ErrorText, { children: errorText })
|
|
133
|
+
] });
|
|
134
|
+
});
|
|
173
135
|
|
|
174
136
|
// src/BaseInputTemplate/BaseInputTemplate.tsx
|
|
175
|
-
import { jsx as
|
|
137
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
176
138
|
function BaseInputTemplate(props) {
|
|
177
139
|
const {
|
|
178
140
|
id,
|
|
@@ -181,7 +143,6 @@ function BaseInputTemplate(props) {
|
|
|
181
143
|
label,
|
|
182
144
|
hideLabel,
|
|
183
145
|
schema,
|
|
184
|
-
uiSchema,
|
|
185
146
|
onChange,
|
|
186
147
|
onChangeOverride,
|
|
187
148
|
onBlur,
|
|
@@ -195,25 +156,20 @@ function BaseInputTemplate(props) {
|
|
|
195
156
|
disabled
|
|
196
157
|
} = props;
|
|
197
158
|
const inputProps = getInputProps(schema, type, options);
|
|
198
|
-
const chakraProps = getChakra({ uiSchema });
|
|
199
159
|
const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
|
|
200
160
|
const _onBlur = ({ target }) => onBlur(id, target && target.value);
|
|
201
161
|
const _onFocus = ({ target }) => onFocus(id, target && target.value);
|
|
202
|
-
return /* @__PURE__ */
|
|
203
|
-
|
|
162
|
+
return /* @__PURE__ */ jsxs5(
|
|
163
|
+
Field,
|
|
204
164
|
{
|
|
205
165
|
mb: 1,
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
166
|
+
disabled: disabled || readonly,
|
|
167
|
+
required,
|
|
168
|
+
readOnly: readonly,
|
|
169
|
+
invalid: rawErrors && rawErrors.length > 0,
|
|
170
|
+
label: labelValue(label, hideLabel || !label),
|
|
211
171
|
children: [
|
|
212
|
-
|
|
213
|
-
/* @__PURE__ */ jsx4(FormLabel, { htmlFor: id, id: `${id}-label`, children: label }),
|
|
214
|
-
hideLabel || !label
|
|
215
|
-
),
|
|
216
|
-
/* @__PURE__ */ jsx4(
|
|
172
|
+
/* @__PURE__ */ jsx5(
|
|
217
173
|
Input,
|
|
218
174
|
{
|
|
219
175
|
id,
|
|
@@ -229,8 +185,8 @@ function BaseInputTemplate(props) {
|
|
|
229
185
|
"aria-describedby": ariaDescribedByIds(id, !!schema.examples)
|
|
230
186
|
}
|
|
231
187
|
),
|
|
232
|
-
Array.isArray(schema.examples) ? /* @__PURE__ */
|
|
233
|
-
return /* @__PURE__ */
|
|
188
|
+
Array.isArray(schema.examples) ? /* @__PURE__ */ jsx5("datalist", { id: examplesId(id), children: schema.examples.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : []).map((example) => {
|
|
189
|
+
return /* @__PURE__ */ jsx5("option", { value: example }, example);
|
|
234
190
|
}) }) : null
|
|
235
191
|
]
|
|
236
192
|
}
|
|
@@ -239,67 +195,104 @@ function BaseInputTemplate(props) {
|
|
|
239
195
|
|
|
240
196
|
// src/DescriptionField/DescriptionField.tsx
|
|
241
197
|
import { Text } from "@chakra-ui/react";
|
|
242
|
-
import { Fragment, jsx as
|
|
198
|
+
import { Fragment, jsx as jsx6 } from "react/jsx-runtime";
|
|
243
199
|
function DescriptionField({ description, id }) {
|
|
244
200
|
if (!description) {
|
|
245
201
|
return null;
|
|
246
202
|
}
|
|
247
203
|
if (typeof description === "string") {
|
|
248
|
-
return /* @__PURE__ */
|
|
204
|
+
return /* @__PURE__ */ jsx6(Text, { as: "sup", fontSize: "md", id, children: description });
|
|
249
205
|
}
|
|
250
|
-
return /* @__PURE__ */
|
|
206
|
+
return /* @__PURE__ */ jsx6(Fragment, { children: description });
|
|
251
207
|
}
|
|
252
208
|
|
|
253
209
|
// src/ErrorList/ErrorList.tsx
|
|
254
210
|
import { TranslatableString as TranslatableString2 } from "@rjsf/utils";
|
|
255
|
-
import {
|
|
256
|
-
import {
|
|
257
|
-
|
|
211
|
+
import { ListIndicator, ListItem, ListRoot } from "@chakra-ui/react";
|
|
212
|
+
import { TriangleAlert } from "lucide-react";
|
|
213
|
+
|
|
214
|
+
// src/components/ui/alert.tsx
|
|
215
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
216
|
+
import { Alert as ChakraAlert } from "@chakra-ui/react";
|
|
217
|
+
|
|
218
|
+
// src/components/ui/close-button.tsx
|
|
219
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
220
|
+
import { IconButton as ChakraIconButton } from "@chakra-ui/react";
|
|
221
|
+
import { LuX } from "react-icons/lu";
|
|
222
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
223
|
+
var CloseButton = forwardRef2(function CloseButton2(props, ref) {
|
|
224
|
+
return /* @__PURE__ */ jsx7(ChakraIconButton, { variant: "ghost", "aria-label": "Close", ref, ...props, children: props.children ?? /* @__PURE__ */ jsx7(LuX, {}) });
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
// src/components/ui/alert.tsx
|
|
228
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
229
|
+
var Alert = forwardRef3(function Alert2(props, ref) {
|
|
230
|
+
const { title, children, icon, closable, onClose, startElement, endElement, ...rest } = props;
|
|
231
|
+
return /* @__PURE__ */ jsxs6(ChakraAlert.Root, { ref, ...rest, children: [
|
|
232
|
+
startElement || /* @__PURE__ */ jsx8(ChakraAlert.Indicator, { children: icon }),
|
|
233
|
+
children ? /* @__PURE__ */ jsxs6(ChakraAlert.Content, { children: [
|
|
234
|
+
/* @__PURE__ */ jsx8(ChakraAlert.Title, { children: title }),
|
|
235
|
+
/* @__PURE__ */ jsx8(ChakraAlert.Description, { children })
|
|
236
|
+
] }) : /* @__PURE__ */ jsx8(ChakraAlert.Title, { flex: "1", children: title }),
|
|
237
|
+
endElement,
|
|
238
|
+
closable && /* @__PURE__ */ jsx8(CloseButton, { size: "sm", pos: "relative", top: "-2", insetEnd: "-2", alignSelf: "flex-start", onClick: onClose })
|
|
239
|
+
] });
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
// src/ErrorList/ErrorList.tsx
|
|
243
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
258
244
|
function ErrorList({
|
|
259
245
|
errors,
|
|
260
246
|
registry
|
|
261
247
|
}) {
|
|
262
248
|
const { translateString } = registry;
|
|
263
|
-
return /* @__PURE__ */
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
249
|
+
return /* @__PURE__ */ jsx9(
|
|
250
|
+
Alert,
|
|
251
|
+
{
|
|
252
|
+
flexDirection: "column",
|
|
253
|
+
alignItems: "flex-start",
|
|
254
|
+
gap: 3,
|
|
255
|
+
status: "error",
|
|
256
|
+
title: translateString(TranslatableString2.ErrorsLabel),
|
|
257
|
+
children: /* @__PURE__ */ jsx9(ListRoot, { children: errors.map((error, i) => /* @__PURE__ */ jsxs7(ListItem, { children: [
|
|
258
|
+
/* @__PURE__ */ jsx9(ListIndicator, { asChild: true, color: "red.500", children: /* @__PURE__ */ jsx9(TriangleAlert, {}) }),
|
|
259
|
+
error.stack
|
|
260
|
+
] }, i)) })
|
|
261
|
+
}
|
|
262
|
+
);
|
|
270
263
|
}
|
|
271
264
|
|
|
272
265
|
// src/IconButton/ChakraIconButton.tsx
|
|
273
266
|
import { memo } from "react";
|
|
274
267
|
import { IconButton } from "@chakra-ui/react";
|
|
275
|
-
import { jsx as
|
|
276
|
-
function
|
|
268
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
269
|
+
function ChakraIconButton2(props) {
|
|
277
270
|
const { icon, iconType, uiSchema, registry, ...otherProps } = props;
|
|
278
|
-
return /* @__PURE__ */
|
|
271
|
+
return /* @__PURE__ */ jsx10(IconButton, { "aria-label": props.title, ...otherProps, children: icon });
|
|
279
272
|
}
|
|
280
|
-
|
|
281
|
-
var ChakraIconButton_default = memo(
|
|
273
|
+
ChakraIconButton2.displayName = "ChakraIconButton";
|
|
274
|
+
var ChakraIconButton_default = memo(ChakraIconButton2);
|
|
282
275
|
|
|
283
276
|
// src/IconButton/IconButton.tsx
|
|
284
277
|
import { TranslatableString as TranslatableString3 } from "@rjsf/utils";
|
|
285
|
-
import { ArrowUpIcon, ArrowDownIcon, CopyIcon, DeleteIcon } from "
|
|
286
|
-
import { jsx as
|
|
278
|
+
import { ArrowUpIcon, ArrowDownIcon, CopyIcon, DeleteIcon } from "lucide-react";
|
|
279
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
287
280
|
function CopyButton(props) {
|
|
288
281
|
const {
|
|
289
282
|
registry: { translateString }
|
|
290
283
|
} = props;
|
|
291
|
-
return /* @__PURE__ */
|
|
284
|
+
return /* @__PURE__ */ jsx11(ChakraIconButton_default, { title: translateString(TranslatableString3.CopyButton), ...props, icon: /* @__PURE__ */ jsx11(CopyIcon, {}) });
|
|
292
285
|
}
|
|
293
286
|
function MoveDownButton(props) {
|
|
294
287
|
const {
|
|
295
288
|
registry: { translateString }
|
|
296
289
|
} = props;
|
|
297
|
-
return /* @__PURE__ */
|
|
290
|
+
return /* @__PURE__ */ jsx11(
|
|
298
291
|
ChakraIconButton_default,
|
|
299
292
|
{
|
|
300
293
|
title: translateString(TranslatableString3.MoveDownButton),
|
|
301
294
|
...props,
|
|
302
|
-
icon: /* @__PURE__ */
|
|
295
|
+
icon: /* @__PURE__ */ jsx11(ArrowDownIcon, {})
|
|
303
296
|
}
|
|
304
297
|
);
|
|
305
298
|
}
|
|
@@ -307,12 +300,12 @@ function MoveUpButton(props) {
|
|
|
307
300
|
const {
|
|
308
301
|
registry: { translateString }
|
|
309
302
|
} = props;
|
|
310
|
-
return /* @__PURE__ */
|
|
303
|
+
return /* @__PURE__ */ jsx11(
|
|
311
304
|
ChakraIconButton_default,
|
|
312
305
|
{
|
|
313
306
|
title: translateString(TranslatableString3.MoveUpButton),
|
|
314
307
|
...props,
|
|
315
|
-
icon: /* @__PURE__ */
|
|
308
|
+
icon: /* @__PURE__ */ jsx11(ArrowUpIcon, {})
|
|
316
309
|
}
|
|
317
310
|
);
|
|
318
311
|
}
|
|
@@ -320,51 +313,51 @@ function RemoveButton(props) {
|
|
|
320
313
|
const {
|
|
321
314
|
registry: { translateString }
|
|
322
315
|
} = props;
|
|
323
|
-
return /* @__PURE__ */
|
|
316
|
+
return /* @__PURE__ */ jsx11(
|
|
324
317
|
ChakraIconButton_default,
|
|
325
318
|
{
|
|
326
319
|
title: translateString(TranslatableString3.RemoveButton),
|
|
327
320
|
...props,
|
|
328
|
-
icon: /* @__PURE__ */
|
|
321
|
+
icon: /* @__PURE__ */ jsx11(DeleteIcon, {})
|
|
329
322
|
}
|
|
330
323
|
);
|
|
331
324
|
}
|
|
332
325
|
|
|
333
326
|
// src/FieldErrorTemplate/FieldErrorTemplate.tsx
|
|
334
327
|
import { errorId } from "@rjsf/utils";
|
|
335
|
-
import {
|
|
336
|
-
import { jsx as
|
|
328
|
+
import { ListItem as ListItem2, ListRoot as ListRoot2, Text as Text2 } from "@chakra-ui/react";
|
|
329
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
337
330
|
function FieldErrorTemplate(props) {
|
|
338
331
|
const { errors = [], idSchema } = props;
|
|
339
332
|
if (errors.length === 0) {
|
|
340
333
|
return null;
|
|
341
334
|
}
|
|
342
335
|
const id = errorId(idSchema);
|
|
343
|
-
return /* @__PURE__ */
|
|
344
|
-
return /* @__PURE__ */
|
|
336
|
+
return /* @__PURE__ */ jsx12(ListRoot2, { children: errors.map((error, i) => {
|
|
337
|
+
return /* @__PURE__ */ jsx12(ListItem2, { children: /* @__PURE__ */ jsx12(Text2, { id, children: error }) }, i);
|
|
345
338
|
}) });
|
|
346
339
|
}
|
|
347
340
|
|
|
348
341
|
// src/FieldHelpTemplate/FieldHelpTemplate.tsx
|
|
342
|
+
import { Text as Text3 } from "@chakra-ui/react";
|
|
349
343
|
import { helpId } from "@rjsf/utils";
|
|
350
|
-
import {
|
|
351
|
-
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
344
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
352
345
|
function FieldHelpTemplate(props) {
|
|
353
346
|
const { idSchema, help } = props;
|
|
354
347
|
if (!help) {
|
|
355
348
|
return null;
|
|
356
349
|
}
|
|
357
350
|
const id = helpId(idSchema);
|
|
358
|
-
return /* @__PURE__ */
|
|
351
|
+
return /* @__PURE__ */ jsx13(Text3, { id, children: help });
|
|
359
352
|
}
|
|
360
353
|
|
|
361
354
|
// src/FieldTemplate/FieldTemplate.tsx
|
|
355
|
+
import { Fieldset } from "@chakra-ui/react";
|
|
362
356
|
import {
|
|
363
|
-
getTemplate as
|
|
364
|
-
getUiOptions as
|
|
357
|
+
getTemplate as getTemplate3,
|
|
358
|
+
getUiOptions as getUiOptions3
|
|
365
359
|
} from "@rjsf/utils";
|
|
366
|
-
import {
|
|
367
|
-
import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
360
|
+
import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
368
361
|
function FieldTemplate(props) {
|
|
369
362
|
const {
|
|
370
363
|
id,
|
|
@@ -388,16 +381,16 @@ function FieldTemplate(props) {
|
|
|
388
381
|
schema,
|
|
389
382
|
uiSchema
|
|
390
383
|
} = props;
|
|
391
|
-
const uiOptions =
|
|
392
|
-
const WrapIfAdditionalTemplate2 =
|
|
384
|
+
const uiOptions = getUiOptions3(uiSchema);
|
|
385
|
+
const WrapIfAdditionalTemplate2 = getTemplate3(
|
|
393
386
|
"WrapIfAdditionalTemplate",
|
|
394
387
|
registry,
|
|
395
388
|
uiOptions
|
|
396
389
|
);
|
|
397
390
|
if (hidden) {
|
|
398
|
-
return /* @__PURE__ */
|
|
391
|
+
return /* @__PURE__ */ jsx14("div", { style: { display: "none" }, children });
|
|
399
392
|
}
|
|
400
|
-
return /* @__PURE__ */
|
|
393
|
+
return /* @__PURE__ */ jsx14(
|
|
401
394
|
WrapIfAdditionalTemplate2,
|
|
402
395
|
{
|
|
403
396
|
classNames,
|
|
@@ -412,26 +405,38 @@ function FieldTemplate(props) {
|
|
|
412
405
|
schema,
|
|
413
406
|
uiSchema,
|
|
414
407
|
registry,
|
|
415
|
-
children: /* @__PURE__ */
|
|
416
|
-
children,
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
408
|
+
children: /* @__PURE__ */ jsxs8(Fieldset.Root, { disabled, invalid: rawErrors && rawErrors.length > 0, children: [
|
|
409
|
+
displayLabel && rawDescription ? /* @__PURE__ */ jsx14(Fieldset.Legend, { mt: 2, children: description }) : null,
|
|
410
|
+
help,
|
|
411
|
+
/* @__PURE__ */ jsx14(Fieldset.Content, { children }),
|
|
412
|
+
errors && /* @__PURE__ */ jsx14(Fieldset.ErrorText, { children: errors })
|
|
420
413
|
] })
|
|
421
414
|
}
|
|
422
415
|
);
|
|
423
416
|
}
|
|
424
417
|
|
|
425
|
-
// src/
|
|
418
|
+
// src/GridTemplate/GridTemplate.tsx
|
|
426
419
|
import { Grid as Grid2, GridItem as GridItem2 } from "@chakra-ui/react";
|
|
420
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
421
|
+
function GridTemplate(props) {
|
|
422
|
+
const { children, column, ...rest } = props;
|
|
423
|
+
if (column) {
|
|
424
|
+
return /* @__PURE__ */ jsx15(GridItem2, { ...rest, children });
|
|
425
|
+
}
|
|
426
|
+
return /* @__PURE__ */ jsx15(Grid2, { ...rest, children });
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
// src/ObjectFieldTemplate/ObjectFieldTemplate.tsx
|
|
430
|
+
import { Grid as Grid3, GridItem as GridItem3 } from "@chakra-ui/react";
|
|
427
431
|
import {
|
|
432
|
+
buttonId as buttonId2,
|
|
428
433
|
canExpand,
|
|
429
434
|
descriptionId,
|
|
430
|
-
getTemplate as
|
|
431
|
-
getUiOptions as
|
|
435
|
+
getTemplate as getTemplate4,
|
|
436
|
+
getUiOptions as getUiOptions4,
|
|
432
437
|
titleId
|
|
433
438
|
} from "@rjsf/utils";
|
|
434
|
-
import { Fragment as Fragment2, jsx as
|
|
439
|
+
import { Fragment as Fragment2, jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
435
440
|
function ObjectFieldTemplate(props) {
|
|
436
441
|
const {
|
|
437
442
|
description,
|
|
@@ -447,9 +452,9 @@ function ObjectFieldTemplate(props) {
|
|
|
447
452
|
onAddClick,
|
|
448
453
|
registry
|
|
449
454
|
} = props;
|
|
450
|
-
const uiOptions =
|
|
451
|
-
const TitleFieldTemplate =
|
|
452
|
-
const DescriptionFieldTemplate =
|
|
455
|
+
const uiOptions = getUiOptions4(uiSchema);
|
|
456
|
+
const TitleFieldTemplate = getTemplate4("TitleFieldTemplate", registry, uiOptions);
|
|
457
|
+
const DescriptionFieldTemplate = getTemplate4(
|
|
453
458
|
"DescriptionFieldTemplate",
|
|
454
459
|
registry,
|
|
455
460
|
uiOptions
|
|
@@ -457,8 +462,8 @@ function ObjectFieldTemplate(props) {
|
|
|
457
462
|
const {
|
|
458
463
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
459
464
|
} = registry.templates;
|
|
460
|
-
return /* @__PURE__ */
|
|
461
|
-
title && /* @__PURE__ */
|
|
465
|
+
return /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
466
|
+
title && /* @__PURE__ */ jsx16(
|
|
462
467
|
TitleFieldTemplate,
|
|
463
468
|
{
|
|
464
469
|
id: titleId(idSchema),
|
|
@@ -469,7 +474,7 @@ function ObjectFieldTemplate(props) {
|
|
|
469
474
|
registry
|
|
470
475
|
}
|
|
471
476
|
),
|
|
472
|
-
description && /* @__PURE__ */
|
|
477
|
+
description && /* @__PURE__ */ jsx16(
|
|
473
478
|
DescriptionFieldTemplate,
|
|
474
479
|
{
|
|
475
480
|
id: descriptionId(idSchema),
|
|
@@ -479,14 +484,15 @@ function ObjectFieldTemplate(props) {
|
|
|
479
484
|
registry
|
|
480
485
|
}
|
|
481
486
|
),
|
|
482
|
-
/* @__PURE__ */
|
|
487
|
+
/* @__PURE__ */ jsxs9(Grid3, { gap: description ? 2 : 6, mb: 4, children: [
|
|
483
488
|
properties.map(
|
|
484
|
-
(element, index) => element.hidden ? element.content : /* @__PURE__ */
|
|
489
|
+
(element, index) => element.hidden ? element.content : /* @__PURE__ */ jsx16(GridItem3, { children: element.content }, `${idSchema.$id}-${element.name}-${index}`)
|
|
485
490
|
),
|
|
486
|
-
canExpand(schema, uiSchema, formData) && /* @__PURE__ */
|
|
491
|
+
canExpand(schema, uiSchema, formData) && /* @__PURE__ */ jsx16(GridItem3, { justifySelf: "flex-end", children: /* @__PURE__ */ jsx16(
|
|
487
492
|
AddButton2,
|
|
488
493
|
{
|
|
489
|
-
|
|
494
|
+
id: buttonId2(idSchema, "add"),
|
|
495
|
+
className: "rjsf-object-property-expand",
|
|
490
496
|
onClick: onAddClick(schema),
|
|
491
497
|
disabled: disabled || readonly,
|
|
492
498
|
uiSchema,
|
|
@@ -500,35 +506,36 @@ function ObjectFieldTemplate(props) {
|
|
|
500
506
|
// src/SubmitButton/SubmitButton.tsx
|
|
501
507
|
import { Box as Box3, Button as Button2 } from "@chakra-ui/react";
|
|
502
508
|
import { getSubmitButtonOptions } from "@rjsf/utils";
|
|
503
|
-
import { jsx as
|
|
509
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
504
510
|
function SubmitButton({ uiSchema }) {
|
|
505
511
|
const { submitText, norender, props: submitButtonProps } = getSubmitButtonOptions(uiSchema);
|
|
506
512
|
if (norender) {
|
|
507
513
|
return null;
|
|
508
514
|
}
|
|
509
|
-
return /* @__PURE__ */
|
|
515
|
+
return /* @__PURE__ */ jsx17(Box3, { marginTop: 3, children: /* @__PURE__ */ jsx17(Button2, { type: "submit", variant: "solid", ...submitButtonProps, children: submitText }) });
|
|
510
516
|
}
|
|
511
517
|
|
|
512
518
|
// src/TitleField/TitleField.tsx
|
|
513
|
-
import { Box as Box4,
|
|
514
|
-
import { jsx as
|
|
519
|
+
import { Box as Box4, Separator, Heading } from "@chakra-ui/react";
|
|
520
|
+
import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
515
521
|
function TitleField({
|
|
516
522
|
id,
|
|
517
523
|
title
|
|
518
524
|
}) {
|
|
519
|
-
return /* @__PURE__ */
|
|
520
|
-
/* @__PURE__ */
|
|
521
|
-
/* @__PURE__ */
|
|
525
|
+
return /* @__PURE__ */ jsxs10(Box4, { id, mt: 1, mb: 4, children: [
|
|
526
|
+
/* @__PURE__ */ jsx18(Heading, { as: "h5", children: title }),
|
|
527
|
+
/* @__PURE__ */ jsx18(Separator, {})
|
|
522
528
|
] });
|
|
523
529
|
}
|
|
524
530
|
|
|
525
531
|
// src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx
|
|
526
532
|
import {
|
|
527
533
|
ADDITIONAL_PROPERTY_FLAG,
|
|
534
|
+
buttonId as buttonId3,
|
|
528
535
|
TranslatableString as TranslatableString4
|
|
529
536
|
} from "@rjsf/utils";
|
|
530
|
-
import {
|
|
531
|
-
import { jsx as
|
|
537
|
+
import { Grid as Grid4, GridItem as GridItem4, Input as Input2 } from "@chakra-ui/react";
|
|
538
|
+
import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
532
539
|
function WrapIfAdditionalTemplate(props) {
|
|
533
540
|
const {
|
|
534
541
|
children,
|
|
@@ -550,29 +557,28 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
550
557
|
const keyLabel = translateString(TranslatableString4.KeyLabel, [label]);
|
|
551
558
|
const additional = ADDITIONAL_PROPERTY_FLAG in schema;
|
|
552
559
|
if (!additional) {
|
|
553
|
-
return /* @__PURE__ */
|
|
560
|
+
return /* @__PURE__ */ jsx19("div", { className: classNames, style, children });
|
|
554
561
|
}
|
|
555
562
|
const handleBlur = ({ target }) => onKeyChange(target.value);
|
|
556
|
-
return /* @__PURE__ */
|
|
557
|
-
/* @__PURE__ */
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
] }) }),
|
|
572
|
-
/* @__PURE__ */ jsx15(GridItem3, { children }),
|
|
573
|
-
/* @__PURE__ */ jsx15(GridItem3, { children: /* @__PURE__ */ jsx15(
|
|
563
|
+
return /* @__PURE__ */ jsxs11(Grid4, { className: classNames, style, alignItems: "center", gap: 2, children: [
|
|
564
|
+
/* @__PURE__ */ jsx19(GridItem4, { children: /* @__PURE__ */ jsx19(Field, { required, label: keyLabel, children: /* @__PURE__ */ jsx19(
|
|
565
|
+
Input2,
|
|
566
|
+
{
|
|
567
|
+
defaultValue: label,
|
|
568
|
+
disabled: disabled || readonly,
|
|
569
|
+
id: `${id}-key`,
|
|
570
|
+
name: `${id}-key`,
|
|
571
|
+
onBlur: !readonly ? handleBlur : void 0,
|
|
572
|
+
type: "text",
|
|
573
|
+
mb: 1
|
|
574
|
+
}
|
|
575
|
+
) }) }),
|
|
576
|
+
/* @__PURE__ */ jsx19(GridItem4, { children }),
|
|
577
|
+
/* @__PURE__ */ jsx19(GridItem4, { children: /* @__PURE__ */ jsx19(
|
|
574
578
|
RemoveButton2,
|
|
575
579
|
{
|
|
580
|
+
id: buttonId3(id, "remove"),
|
|
581
|
+
className: "rjsf-object-property-remove",
|
|
576
582
|
disabled: disabled || readonly,
|
|
577
583
|
onClick: onDropPropertyClick(label),
|
|
578
584
|
uiSchema,
|
|
@@ -601,6 +607,7 @@ function generateTemplates() {
|
|
|
601
607
|
FieldErrorTemplate,
|
|
602
608
|
FieldHelpTemplate,
|
|
603
609
|
FieldTemplate,
|
|
610
|
+
GridTemplate,
|
|
604
611
|
ObjectFieldTemplate,
|
|
605
612
|
TitleFieldTemplate: TitleField,
|
|
606
613
|
WrapIfAdditionalTemplate
|
|
@@ -619,11 +626,11 @@ import {
|
|
|
619
626
|
TranslatableString as TranslatableString5
|
|
620
627
|
} from "@rjsf/utils";
|
|
621
628
|
import { Box as Box5, Button as Button3 } from "@chakra-ui/react";
|
|
622
|
-
import { jsx as
|
|
629
|
+
import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
623
630
|
function DateElement(props) {
|
|
624
631
|
const { SelectWidget: SelectWidget2 } = props.registry.widgets;
|
|
625
632
|
const value = props.value ? props.value : void 0;
|
|
626
|
-
return /* @__PURE__ */
|
|
633
|
+
return /* @__PURE__ */ jsx20(
|
|
627
634
|
SelectWidget2,
|
|
628
635
|
{
|
|
629
636
|
...props,
|
|
@@ -676,15 +683,15 @@ function AltDateWidget(props) {
|
|
|
676
683
|
}
|
|
677
684
|
onChange(void 0);
|
|
678
685
|
};
|
|
679
|
-
return /* @__PURE__ */
|
|
680
|
-
/* @__PURE__ */
|
|
686
|
+
return /* @__PURE__ */ jsxs12(Box5, { children: [
|
|
687
|
+
/* @__PURE__ */ jsx20(Box5, { display: "flex", flexWrap: "wrap", alignItems: "center", children: getDateElementProps(
|
|
681
688
|
state,
|
|
682
689
|
showTime,
|
|
683
690
|
options.yearsRange,
|
|
684
691
|
options.format
|
|
685
692
|
).map((elemProps, i) => {
|
|
686
693
|
const elemId = id + "_" + elemProps.type;
|
|
687
|
-
return /* @__PURE__ */
|
|
694
|
+
return /* @__PURE__ */ jsx20(Box5, { mr: "2", mb: "2", children: /* @__PURE__ */ jsx20(
|
|
688
695
|
DateElement,
|
|
689
696
|
{
|
|
690
697
|
...props,
|
|
@@ -702,9 +709,9 @@ function AltDateWidget(props) {
|
|
|
702
709
|
}
|
|
703
710
|
) }, elemId);
|
|
704
711
|
}) }),
|
|
705
|
-
/* @__PURE__ */
|
|
706
|
-
!options.hideNowButton && /* @__PURE__ */
|
|
707
|
-
!options.hideClearButton && /* @__PURE__ */
|
|
712
|
+
/* @__PURE__ */ jsxs12(Box5, { display: "flex", children: [
|
|
713
|
+
!options.hideNowButton && /* @__PURE__ */ jsx20(Button3, { onClick: (e) => handleNow(e), mr: "2", children: translateString(TranslatableString5.NowLabel) }),
|
|
714
|
+
!options.hideClearButton && /* @__PURE__ */ jsx20(Button3, { onClick: (e) => handleClear(e), children: translateString(TranslatableString5.ClearLabel) })
|
|
708
715
|
] })
|
|
709
716
|
] });
|
|
710
717
|
}
|
|
@@ -720,10 +727,10 @@ AltDateWidget.defaultProps = {
|
|
|
720
727
|
var AltDateWidget_default = AltDateWidget;
|
|
721
728
|
|
|
722
729
|
// src/AltDateTimeWidget/AltDateTimeWidget.tsx
|
|
723
|
-
import { jsx as
|
|
730
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
724
731
|
function AltDateTimeWidget(props) {
|
|
725
732
|
const { AltDateWidget: AltDateWidget2 } = props.registry.widgets;
|
|
726
|
-
return /* @__PURE__ */
|
|
733
|
+
return /* @__PURE__ */ jsx21(AltDateWidget2, { ...props, showTime: true });
|
|
727
734
|
}
|
|
728
735
|
AltDateTimeWidget.defaultProps = {
|
|
729
736
|
...AltDateWidget_default.defaultProps,
|
|
@@ -732,15 +739,30 @@ AltDateTimeWidget.defaultProps = {
|
|
|
732
739
|
var AltDateTimeWidget_default = AltDateTimeWidget;
|
|
733
740
|
|
|
734
741
|
// src/CheckboxWidget/CheckboxWidget.tsx
|
|
735
|
-
import {
|
|
742
|
+
import { Text as Text4 } from "@chakra-ui/react";
|
|
736
743
|
import {
|
|
737
744
|
ariaDescribedByIds as ariaDescribedByIds3,
|
|
738
745
|
descriptionId as descriptionId2,
|
|
739
|
-
getTemplate as
|
|
746
|
+
getTemplate as getTemplate5,
|
|
740
747
|
labelValue as labelValue2,
|
|
741
748
|
schemaRequiresTrueValue
|
|
742
749
|
} from "@rjsf/utils";
|
|
743
|
-
|
|
750
|
+
|
|
751
|
+
// src/components/ui/checkbox.tsx
|
|
752
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
753
|
+
import { Checkbox as ChakraCheckbox } from "@chakra-ui/react";
|
|
754
|
+
import { jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
755
|
+
var Checkbox = forwardRef4(function Checkbox2(props, ref) {
|
|
756
|
+
const { icon, children, inputProps, rootRef, ...rest } = props;
|
|
757
|
+
return /* @__PURE__ */ jsxs13(ChakraCheckbox.Root, { ref: rootRef, ...rest, children: [
|
|
758
|
+
/* @__PURE__ */ jsx22(ChakraCheckbox.HiddenInput, { ref, ...inputProps }),
|
|
759
|
+
/* @__PURE__ */ jsx22(ChakraCheckbox.Control, { children: icon || /* @__PURE__ */ jsx22(ChakraCheckbox.Indicator, {}) }),
|
|
760
|
+
children != null && /* @__PURE__ */ jsx22(ChakraCheckbox.Label, { children })
|
|
761
|
+
] });
|
|
762
|
+
});
|
|
763
|
+
|
|
764
|
+
// src/CheckboxWidget/CheckboxWidget.tsx
|
|
765
|
+
import { jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
744
766
|
function CheckboxWidget(props) {
|
|
745
767
|
const {
|
|
746
768
|
id,
|
|
@@ -757,19 +779,18 @@ function CheckboxWidget(props) {
|
|
|
757
779
|
uiSchema,
|
|
758
780
|
schema
|
|
759
781
|
} = props;
|
|
760
|
-
const chakraProps = getChakra({ uiSchema });
|
|
761
782
|
const required = schemaRequiresTrueValue(schema);
|
|
762
|
-
const DescriptionFieldTemplate =
|
|
783
|
+
const DescriptionFieldTemplate = getTemplate5(
|
|
763
784
|
"DescriptionFieldTemplate",
|
|
764
785
|
registry,
|
|
765
786
|
options
|
|
766
787
|
);
|
|
767
788
|
const description = options.description || schema.description;
|
|
768
|
-
const _onChange = ({
|
|
789
|
+
const _onChange = ({ checked }) => onChange(checked);
|
|
769
790
|
const _onBlur = ({ target }) => onBlur(id, target && target.value);
|
|
770
791
|
const _onFocus = ({ target }) => onFocus(id, target && target.value);
|
|
771
|
-
return /* @__PURE__ */
|
|
772
|
-
!hideLabel && !!description && /* @__PURE__ */
|
|
792
|
+
return /* @__PURE__ */ jsxs14(Field, { mb: 1, required, children: [
|
|
793
|
+
!hideLabel && !!description && /* @__PURE__ */ jsx23(
|
|
773
794
|
DescriptionFieldTemplate,
|
|
774
795
|
{
|
|
775
796
|
id: descriptionId2(id),
|
|
@@ -779,34 +800,33 @@ function CheckboxWidget(props) {
|
|
|
779
800
|
registry
|
|
780
801
|
}
|
|
781
802
|
),
|
|
782
|
-
/* @__PURE__ */
|
|
803
|
+
/* @__PURE__ */ jsx23(
|
|
783
804
|
Checkbox,
|
|
784
805
|
{
|
|
785
806
|
id,
|
|
786
807
|
name: id,
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
808
|
+
checked: typeof value === "undefined" ? false : value,
|
|
809
|
+
disabled: disabled || readonly,
|
|
810
|
+
onCheckedChange: _onChange,
|
|
790
811
|
onBlur: _onBlur,
|
|
791
812
|
onFocus: _onFocus,
|
|
792
813
|
"aria-describedby": ariaDescribedByIds3(id),
|
|
793
|
-
children: labelValue2(/* @__PURE__ */
|
|
814
|
+
children: labelValue2(/* @__PURE__ */ jsx23(Text4, { children: label }), hideLabel || !label)
|
|
794
815
|
}
|
|
795
816
|
)
|
|
796
817
|
] });
|
|
797
818
|
}
|
|
798
819
|
|
|
799
820
|
// src/CheckboxesWidget/CheckboxesWidget.tsx
|
|
800
|
-
import { CheckboxGroup,
|
|
821
|
+
import { CheckboxGroup, FieldsetRoot, Stack, Text as Text5 } from "@chakra-ui/react";
|
|
801
822
|
import {
|
|
802
823
|
ariaDescribedByIds as ariaDescribedByIds4,
|
|
803
824
|
enumOptionsIndexForValue,
|
|
804
|
-
enumOptionsIsSelected,
|
|
805
825
|
enumOptionsValueForIndex,
|
|
806
826
|
labelValue as labelValue3,
|
|
807
827
|
optionId
|
|
808
828
|
} from "@rjsf/utils";
|
|
809
|
-
import { jsx as
|
|
829
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
810
830
|
function CheckboxesWidget(props) {
|
|
811
831
|
const {
|
|
812
832
|
id,
|
|
@@ -820,63 +840,44 @@ function CheckboxesWidget(props) {
|
|
|
820
840
|
required,
|
|
821
841
|
label,
|
|
822
842
|
hideLabel,
|
|
823
|
-
uiSchema,
|
|
824
843
|
rawErrors = []
|
|
825
844
|
} = props;
|
|
826
845
|
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
827
|
-
const chakraProps = getChakra({ uiSchema });
|
|
828
|
-
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
829
846
|
const _onBlur = ({ target }) => onBlur(id, enumOptionsValueForIndex(target && target.value, enumOptions, emptyValue));
|
|
830
847
|
const _onFocus = ({ target }) => onFocus(id, enumOptionsValueForIndex(target && target.value, enumOptions, emptyValue));
|
|
831
848
|
const row = options ? options.inline : false;
|
|
832
849
|
const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, true);
|
|
833
|
-
return /* @__PURE__ */
|
|
834
|
-
|
|
850
|
+
return /* @__PURE__ */ jsx24(FieldsetRoot, { mb: 1, disabled: disabled || readonly, invalid: rawErrors && rawErrors.length > 0, children: /* @__PURE__ */ jsx24(
|
|
851
|
+
CheckboxGroup,
|
|
835
852
|
{
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
children:
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
),
|
|
847
|
-
/* @__PURE__ */ jsx19(
|
|
848
|
-
CheckboxGroup,
|
|
853
|
+
onValueChange: (option) => onChange(enumOptionsValueForIndex(option, enumOptions, emptyValue)),
|
|
854
|
+
value: selectedIndexes,
|
|
855
|
+
"aria-describedby": ariaDescribedByIds4(id),
|
|
856
|
+
readOnly: readonly,
|
|
857
|
+
required,
|
|
858
|
+
label: labelValue3(label, hideLabel || !label),
|
|
859
|
+
children: /* @__PURE__ */ jsx24(Stack, { direction: row ? "row" : "column", children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
860
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
861
|
+
return /* @__PURE__ */ jsx24(
|
|
862
|
+
Checkbox,
|
|
849
863
|
{
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
value: String(index),
|
|
862
|
-
isChecked: checked,
|
|
863
|
-
isDisabled: disabled || itemDisabled || readonly,
|
|
864
|
-
onBlur: _onBlur,
|
|
865
|
-
onFocus: _onFocus,
|
|
866
|
-
children: option.label && /* @__PURE__ */ jsx19(Text4, { children: option.label })
|
|
867
|
-
},
|
|
868
|
-
index
|
|
869
|
-
);
|
|
870
|
-
}) })
|
|
871
|
-
}
|
|
872
|
-
)
|
|
873
|
-
]
|
|
864
|
+
id: optionId(id, index),
|
|
865
|
+
name: id,
|
|
866
|
+
value: String(index),
|
|
867
|
+
disabled: disabled || itemDisabled || readonly,
|
|
868
|
+
onBlur: _onBlur,
|
|
869
|
+
onFocus: _onFocus,
|
|
870
|
+
children: option.label && /* @__PURE__ */ jsx24(Text5, { children: option.label })
|
|
871
|
+
},
|
|
872
|
+
index
|
|
873
|
+
);
|
|
874
|
+
}) })
|
|
874
875
|
}
|
|
875
|
-
);
|
|
876
|
+
) });
|
|
876
877
|
}
|
|
877
878
|
|
|
878
879
|
// src/RadioWidget/RadioWidget.tsx
|
|
879
|
-
import {
|
|
880
|
+
import { Stack as Stack2 } from "@chakra-ui/react";
|
|
880
881
|
import {
|
|
881
882
|
ariaDescribedByIds as ariaDescribedByIds5,
|
|
882
883
|
enumOptionsIndexForValue as enumOptionsIndexForValue2,
|
|
@@ -884,7 +885,23 @@ import {
|
|
|
884
885
|
labelValue as labelValue4,
|
|
885
886
|
optionId as optionId2
|
|
886
887
|
} from "@rjsf/utils";
|
|
887
|
-
|
|
888
|
+
|
|
889
|
+
// src/components/ui/radio.tsx
|
|
890
|
+
import { forwardRef as forwardRef5 } from "react";
|
|
891
|
+
import { RadioGroup as ChakraRadioGroup } from "@chakra-ui/react";
|
|
892
|
+
import { jsx as jsx25, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
893
|
+
var Radio = forwardRef5(function Radio2(props, ref) {
|
|
894
|
+
const { children, inputProps, rootRef, ...rest } = props;
|
|
895
|
+
return /* @__PURE__ */ jsxs15(ChakraRadioGroup.Item, { ref: rootRef, ...rest, children: [
|
|
896
|
+
/* @__PURE__ */ jsx25(ChakraRadioGroup.ItemHiddenInput, { ref, ...inputProps }),
|
|
897
|
+
/* @__PURE__ */ jsx25(ChakraRadioGroup.ItemIndicator, {}),
|
|
898
|
+
children && /* @__PURE__ */ jsx25(ChakraRadioGroup.ItemText, { children })
|
|
899
|
+
] });
|
|
900
|
+
});
|
|
901
|
+
var RadioGroup = ChakraRadioGroup.Root;
|
|
902
|
+
|
|
903
|
+
// src/RadioWidget/RadioWidget.tsx
|
|
904
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
888
905
|
function RadioWidget({
|
|
889
906
|
id,
|
|
890
907
|
options,
|
|
@@ -896,56 +913,101 @@ function RadioWidget({
|
|
|
896
913
|
hideLabel,
|
|
897
914
|
onChange,
|
|
898
915
|
onBlur,
|
|
899
|
-
onFocus
|
|
900
|
-
uiSchema
|
|
916
|
+
onFocus
|
|
901
917
|
}) {
|
|
902
918
|
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
903
|
-
const
|
|
904
|
-
const _onChange = (nextValue) => onChange(enumOptionsValueForIndex2(nextValue, enumOptions, emptyValue));
|
|
919
|
+
const _onChange = ({ target: { value: value2 } }) => onChange(enumOptionsValueForIndex2(value2, enumOptions, emptyValue));
|
|
905
920
|
const _onBlur = ({ target: { value: value2 } }) => onBlur(id, enumOptionsValueForIndex2(value2, enumOptions, emptyValue));
|
|
906
921
|
const _onFocus = ({ target: { value: value2 } }) => onFocus(id, enumOptionsValueForIndex2(value2, enumOptions, emptyValue));
|
|
907
922
|
const row = options ? options.inline : false;
|
|
908
923
|
const selectedIndex = enumOptionsIndexForValue2(value, enumOptions) ?? null;
|
|
909
|
-
return /* @__PURE__ */
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
924
|
+
return /* @__PURE__ */ jsx26(
|
|
925
|
+
Field,
|
|
926
|
+
{
|
|
927
|
+
mb: 1,
|
|
928
|
+
disabled: disabled || readonly,
|
|
929
|
+
required,
|
|
930
|
+
readOnly: readonly,
|
|
931
|
+
label: labelValue4(label, hideLabel || !label),
|
|
932
|
+
children: /* @__PURE__ */ jsx26(
|
|
933
|
+
RadioGroup,
|
|
934
|
+
{
|
|
935
|
+
onChange: _onChange,
|
|
936
|
+
onBlur: _onBlur,
|
|
937
|
+
onFocus: _onFocus,
|
|
938
|
+
value: selectedIndex,
|
|
939
|
+
name: id,
|
|
940
|
+
"aria-describedby": ariaDescribedByIds5(id),
|
|
941
|
+
children: /* @__PURE__ */ jsx26(Stack2, { direction: row ? "row" : "column", children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
942
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
943
|
+
return /* @__PURE__ */ jsx26(
|
|
944
|
+
Radio,
|
|
945
|
+
{
|
|
946
|
+
value: String(index),
|
|
947
|
+
id: optionId2(id, index),
|
|
948
|
+
disabled: disabled || itemDisabled || readonly,
|
|
949
|
+
children: option.label
|
|
950
|
+
},
|
|
951
|
+
index
|
|
952
|
+
);
|
|
953
|
+
}) })
|
|
954
|
+
}
|
|
955
|
+
)
|
|
956
|
+
}
|
|
957
|
+
);
|
|
939
958
|
}
|
|
940
959
|
|
|
941
960
|
// src/RangeWidget/RangeWidget.tsx
|
|
942
|
-
import { FormControl as FormControl7, FormLabel as FormLabel5, Slider, SliderFilledTrack, SliderThumb, SliderTrack } from "@chakra-ui/react";
|
|
943
961
|
import {
|
|
944
962
|
ariaDescribedByIds as ariaDescribedByIds6,
|
|
945
963
|
labelValue as labelValue5,
|
|
946
964
|
rangeSpec
|
|
947
965
|
} from "@rjsf/utils";
|
|
948
|
-
|
|
966
|
+
|
|
967
|
+
// src/components/ui/slider.tsx
|
|
968
|
+
import { forwardRef as forwardRef6 } from "react";
|
|
969
|
+
import { Slider as ChakraSlider, HStack as HStack2 } from "@chakra-ui/react";
|
|
970
|
+
import { Fragment as Fragment3, jsx as jsx27, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
971
|
+
var Slider = forwardRef6(function Slider2(props, ref) {
|
|
972
|
+
const { marks: marksProp, showValue, ...rest } = props;
|
|
973
|
+
const value = props.defaultValue ?? props.value;
|
|
974
|
+
const marks = marksProp?.map((mark) => {
|
|
975
|
+
if (typeof mark === "number") {
|
|
976
|
+
return { value: mark, label: void 0 };
|
|
977
|
+
}
|
|
978
|
+
return mark;
|
|
979
|
+
});
|
|
980
|
+
const hasMarkLabel = !!marks?.some((mark) => mark.label);
|
|
981
|
+
return /* @__PURE__ */ jsxs16(ChakraSlider.Root, { ref, width: "200px", thumbAlignment: "center", ...rest, children: [
|
|
982
|
+
showValue && /* @__PURE__ */ jsx27(HStack2, { justify: "space-between", children: /* @__PURE__ */ jsx27(ChakraSlider.ValueText, {}) }),
|
|
983
|
+
/* @__PURE__ */ jsxs16(ChakraSlider.Control, { "data-has-mark-label": hasMarkLabel || void 0, children: [
|
|
984
|
+
/* @__PURE__ */ jsx27(ChakraSlider.Track, { children: /* @__PURE__ */ jsx27(ChakraSlider.Range, {}) }),
|
|
985
|
+
/* @__PURE__ */ jsx27(SliderThumbs, { value }),
|
|
986
|
+
/* @__PURE__ */ jsx27(SliderMarks, { marks })
|
|
987
|
+
] })
|
|
988
|
+
] });
|
|
989
|
+
});
|
|
990
|
+
function SliderThumbs(props) {
|
|
991
|
+
const { value } = props;
|
|
992
|
+
return /* @__PURE__ */ jsx27(Fragment3, { children: value?.map((_, index) => /* @__PURE__ */ jsx27(ChakraSlider.Thumb, { index, children: /* @__PURE__ */ jsx27(ChakraSlider.HiddenInput, {}) }, index)) });
|
|
993
|
+
}
|
|
994
|
+
var SliderMarks = forwardRef6(function SliderMarks2(props, ref) {
|
|
995
|
+
const { marks } = props;
|
|
996
|
+
if (!marks?.length) {
|
|
997
|
+
return null;
|
|
998
|
+
}
|
|
999
|
+
return /* @__PURE__ */ jsx27(ChakraSlider.MarkerGroup, { ref, children: marks.map((mark, index) => {
|
|
1000
|
+
const value = typeof mark === "number" ? mark : mark.value;
|
|
1001
|
+
const label = typeof mark === "number" ? void 0 : mark.label;
|
|
1002
|
+
return /* @__PURE__ */ jsxs16(ChakraSlider.Marker, { value, children: [
|
|
1003
|
+
/* @__PURE__ */ jsx27(ChakraSlider.MarkerIndicator, {}),
|
|
1004
|
+
label
|
|
1005
|
+
] }, index);
|
|
1006
|
+
}) });
|
|
1007
|
+
});
|
|
1008
|
+
|
|
1009
|
+
// src/RangeWidget/RangeWidget.tsx
|
|
1010
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
949
1011
|
function RangeWidget({
|
|
950
1012
|
value,
|
|
951
1013
|
readonly,
|
|
@@ -954,50 +1016,104 @@ function RangeWidget({
|
|
|
954
1016
|
onFocus,
|
|
955
1017
|
options,
|
|
956
1018
|
schema,
|
|
957
|
-
uiSchema,
|
|
958
1019
|
onChange,
|
|
959
1020
|
label,
|
|
960
1021
|
hideLabel,
|
|
961
1022
|
id
|
|
962
1023
|
}) {
|
|
963
|
-
const
|
|
964
|
-
const sliderWidgetProps = { value, label, id, ...rangeSpec(schema) };
|
|
965
|
-
const _onChange = (value2) => onChange(value2 === void 0 ? options.emptyValue : value2);
|
|
1024
|
+
const _onChange = ({ value: value2 }) => onChange(value2 === void 0 ? options.emptyValue : value2[0]);
|
|
966
1025
|
const _onBlur = ({ target }) => onBlur(id, target && target.value);
|
|
967
1026
|
const _onFocus = ({ target }) => onFocus(id, target && target.value);
|
|
968
|
-
return /* @__PURE__ */
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
/* @__PURE__ */ jsx21(SliderTrack, { children: /* @__PURE__ */ jsx21(SliderFilledTrack, {}) }),
|
|
983
|
-
/* @__PURE__ */ jsx21(SliderThumb, {})
|
|
984
|
-
]
|
|
985
|
-
}
|
|
986
|
-
)
|
|
987
|
-
] });
|
|
1027
|
+
return /* @__PURE__ */ jsx28(Field, { mb: 1, label: labelValue5(label, hideLabel || !label), children: /* @__PURE__ */ jsx28(
|
|
1028
|
+
Slider,
|
|
1029
|
+
{
|
|
1030
|
+
...rangeSpec(schema),
|
|
1031
|
+
id,
|
|
1032
|
+
name: id,
|
|
1033
|
+
disabled: disabled || readonly,
|
|
1034
|
+
value: [value],
|
|
1035
|
+
onValueChange: _onChange,
|
|
1036
|
+
onBlur: _onBlur,
|
|
1037
|
+
onFocus: _onFocus,
|
|
1038
|
+
"aria-describedby": ariaDescribedByIds6(id)
|
|
1039
|
+
}
|
|
1040
|
+
) });
|
|
988
1041
|
}
|
|
989
1042
|
|
|
990
1043
|
// src/SelectWidget/SelectWidget.tsx
|
|
991
|
-
import { useMemo
|
|
992
|
-
import { FormControl as FormControl8, FormLabel as FormLabel6 } from "@chakra-ui/react";
|
|
1044
|
+
import { useMemo, useRef } from "react";
|
|
993
1045
|
import {
|
|
994
1046
|
ariaDescribedByIds as ariaDescribedByIds7,
|
|
995
1047
|
enumOptionsIndexForValue as enumOptionsIndexForValue3,
|
|
996
1048
|
enumOptionsValueForIndex as enumOptionsValueForIndex3,
|
|
997
1049
|
labelValue as labelValue6
|
|
998
1050
|
} from "@rjsf/utils";
|
|
999
|
-
import { Select } from "chakra-react
|
|
1000
|
-
|
|
1051
|
+
import { createListCollection, Select as ChakraSelect2 } from "@chakra-ui/react";
|
|
1052
|
+
|
|
1053
|
+
// src/components/ui/select.tsx
|
|
1054
|
+
import { forwardRef as forwardRef7 } from "react";
|
|
1055
|
+
import { Select as ChakraSelect, Portal } from "@chakra-ui/react";
|
|
1056
|
+
import { Fragment as Fragment4, jsx as jsx29, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1057
|
+
var SelectTrigger = forwardRef7(function SelectTrigger2(props, ref) {
|
|
1058
|
+
const { children, clearable, ...rest } = props;
|
|
1059
|
+
return /* @__PURE__ */ jsxs17(ChakraSelect.Control, { ...rest, children: [
|
|
1060
|
+
/* @__PURE__ */ jsx29(ChakraSelect.Trigger, { ref, children }),
|
|
1061
|
+
/* @__PURE__ */ jsxs17(ChakraSelect.IndicatorGroup, { children: [
|
|
1062
|
+
clearable && /* @__PURE__ */ jsx29(SelectClearTrigger, {}),
|
|
1063
|
+
/* @__PURE__ */ jsx29(ChakraSelect.Indicator, {})
|
|
1064
|
+
] })
|
|
1065
|
+
] });
|
|
1066
|
+
});
|
|
1067
|
+
var SelectClearTrigger = forwardRef7(
|
|
1068
|
+
function SelectClearTrigger2(props, ref) {
|
|
1069
|
+
return /* @__PURE__ */ jsx29(ChakraSelect.ClearTrigger, { asChild: true, ...props, ref, children: /* @__PURE__ */ jsx29(CloseButton, { size: "xs", variant: "plain", focusVisibleRing: "inside", focusRingWidth: "2px", pointerEvents: "auto" }) });
|
|
1070
|
+
}
|
|
1071
|
+
);
|
|
1072
|
+
var SelectContent = forwardRef7(function SelectContent2(props, ref) {
|
|
1073
|
+
const { portalled = true, portalRef, ...rest } = props;
|
|
1074
|
+
return /* @__PURE__ */ jsx29(Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ jsx29(ChakraSelect.Positioner, { children: /* @__PURE__ */ jsx29(ChakraSelect.Content, { ...rest, ref }) }) });
|
|
1075
|
+
});
|
|
1076
|
+
var SelectItem = forwardRef7(function SelectItem2(props, ref) {
|
|
1077
|
+
const { item, children, ...rest } = props;
|
|
1078
|
+
return /* @__PURE__ */ jsxs17(ChakraSelect.Item, { item, ...rest, ref, children: [
|
|
1079
|
+
children,
|
|
1080
|
+
/* @__PURE__ */ jsx29(ChakraSelect.ItemIndicator, {})
|
|
1081
|
+
] }, item.value);
|
|
1082
|
+
});
|
|
1083
|
+
var SelectValueText = forwardRef7(function SelectValueText2(props, ref) {
|
|
1084
|
+
const { children, ...rest } = props;
|
|
1085
|
+
return /* @__PURE__ */ jsx29(ChakraSelect.ValueText, { ...rest, ref, children: /* @__PURE__ */ jsx29(ChakraSelect.Context, { children: (select) => {
|
|
1086
|
+
const items = select.selectedItems;
|
|
1087
|
+
if (items.length === 0) {
|
|
1088
|
+
return props.placeholder;
|
|
1089
|
+
}
|
|
1090
|
+
if (children) {
|
|
1091
|
+
return children(items);
|
|
1092
|
+
}
|
|
1093
|
+
if (items.length === 1) {
|
|
1094
|
+
return select.collection.stringifyItem(items[0]);
|
|
1095
|
+
}
|
|
1096
|
+
return `${items.length} selected`;
|
|
1097
|
+
} }) });
|
|
1098
|
+
});
|
|
1099
|
+
var SelectRoot = forwardRef7(function SelectRoot2(props, ref) {
|
|
1100
|
+
return /* @__PURE__ */ jsx29(ChakraSelect.Root, { ...props, ref, positioning: { sameWidth: true, ...props.positioning }, children: props.asChild ? props.children : /* @__PURE__ */ jsxs17(Fragment4, { children: [
|
|
1101
|
+
/* @__PURE__ */ jsx29(ChakraSelect.HiddenSelect, {}),
|
|
1102
|
+
props.children
|
|
1103
|
+
] }) });
|
|
1104
|
+
});
|
|
1105
|
+
var SelectItemGroup = forwardRef7(function SelectItemGroup2(props, ref) {
|
|
1106
|
+
const { children, label, ...rest } = props;
|
|
1107
|
+
return /* @__PURE__ */ jsxs17(ChakraSelect.ItemGroup, { ...rest, ref, children: [
|
|
1108
|
+
/* @__PURE__ */ jsx29(ChakraSelect.ItemGroupLabel, { children: label }),
|
|
1109
|
+
children
|
|
1110
|
+
] });
|
|
1111
|
+
});
|
|
1112
|
+
var SelectLabel = ChakraSelect.Label;
|
|
1113
|
+
var SelectItemText = ChakraSelect.ItemText;
|
|
1114
|
+
|
|
1115
|
+
// src/SelectWidget/SelectWidget.tsx
|
|
1116
|
+
import { jsx as jsx30, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1001
1117
|
function SelectWidget(props) {
|
|
1002
1118
|
const {
|
|
1003
1119
|
id,
|
|
@@ -1015,29 +1131,27 @@ function SelectWidget(props) {
|
|
|
1015
1131
|
onBlur,
|
|
1016
1132
|
onFocus,
|
|
1017
1133
|
rawErrors = [],
|
|
1018
|
-
uiSchema,
|
|
1019
1134
|
schema
|
|
1020
1135
|
} = props;
|
|
1021
1136
|
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
1022
|
-
const
|
|
1023
|
-
const _onMultiChange = (e) => {
|
|
1137
|
+
const _onMultiChange = ({ value: value2 }) => {
|
|
1024
1138
|
return onChange(
|
|
1025
1139
|
enumOptionsValueForIndex3(
|
|
1026
|
-
|
|
1027
|
-
return
|
|
1140
|
+
value2.map((item) => {
|
|
1141
|
+
return item;
|
|
1028
1142
|
}),
|
|
1029
1143
|
enumOptions,
|
|
1030
1144
|
emptyValue
|
|
1031
1145
|
)
|
|
1032
1146
|
);
|
|
1033
1147
|
};
|
|
1034
|
-
const _onChange = (
|
|
1035
|
-
return onChange(enumOptionsValueForIndex3(
|
|
1148
|
+
const _onChange = ({ value: value2 }) => {
|
|
1149
|
+
return onChange(enumOptionsValueForIndex3(value2, enumOptions, emptyValue));
|
|
1036
1150
|
};
|
|
1037
1151
|
const _onBlur = ({ target }) => onBlur(id, enumOptionsValueForIndex3(target && target.value, enumOptions, emptyValue));
|
|
1038
1152
|
const _onFocus = ({ target }) => onFocus(id, enumOptionsValueForIndex3(target && target.value, enumOptions, emptyValue));
|
|
1039
1153
|
const showPlaceholderOption = !multiple && schema.default === void 0;
|
|
1040
|
-
const { valueLabelMap, displayEnumOptions } =
|
|
1154
|
+
const { valueLabelMap, displayEnumOptions } = useMemo(() => {
|
|
1041
1155
|
const valueLabelMap2 = {};
|
|
1042
1156
|
let displayEnumOptions2 = [];
|
|
1043
1157
|
if (Array.isArray(enumOptions)) {
|
|
@@ -1047,7 +1161,7 @@ function SelectWidget(props) {
|
|
|
1047
1161
|
return {
|
|
1048
1162
|
label: label2,
|
|
1049
1163
|
value: String(index),
|
|
1050
|
-
|
|
1164
|
+
disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value2) !== -1
|
|
1051
1165
|
};
|
|
1052
1166
|
});
|
|
1053
1167
|
if (showPlaceholderOption) {
|
|
@@ -1058,58 +1172,164 @@ function SelectWidget(props) {
|
|
|
1058
1172
|
}, [enumDisabled, enumOptions, placeholder, showPlaceholderOption]);
|
|
1059
1173
|
const isMultiple = typeof multiple !== "undefined" && multiple !== false && Boolean(enumOptions);
|
|
1060
1174
|
const selectedIndex = enumOptionsIndexForValue3(value, enumOptions, isMultiple);
|
|
1061
|
-
const
|
|
1175
|
+
const getMultiValue = () => (selectedIndex || []).map((i) => {
|
|
1062
1176
|
return {
|
|
1063
1177
|
label: valueLabelMap[i],
|
|
1064
|
-
value: i
|
|
1178
|
+
value: i.toString()
|
|
1065
1179
|
};
|
|
1066
|
-
})
|
|
1067
|
-
|
|
1068
|
-
|
|
1180
|
+
});
|
|
1181
|
+
const getSingleValue = () => typeof selectedIndex !== "undefined" ? [
|
|
1182
|
+
{
|
|
1183
|
+
label: valueLabelMap[selectedIndex] || "",
|
|
1184
|
+
value: selectedIndex.toString()
|
|
1185
|
+
}
|
|
1186
|
+
] : [];
|
|
1187
|
+
const formValue = (isMultiple ? getMultiValue() : getSingleValue()).map((item) => item.value);
|
|
1188
|
+
const selectOptions = createListCollection({
|
|
1189
|
+
items: displayEnumOptions.filter((item) => item.value)
|
|
1190
|
+
});
|
|
1191
|
+
const containerRef = useRef(null);
|
|
1192
|
+
return /* @__PURE__ */ jsx30(
|
|
1193
|
+
Field,
|
|
1194
|
+
{
|
|
1195
|
+
ref: containerRef,
|
|
1196
|
+
mb: 1,
|
|
1197
|
+
disabled: disabled || readonly,
|
|
1198
|
+
required,
|
|
1199
|
+
readOnly: readonly,
|
|
1200
|
+
invalid: rawErrors && rawErrors.length > 0,
|
|
1201
|
+
label: labelValue6(label, hideLabel || !label),
|
|
1202
|
+
position: "relative",
|
|
1203
|
+
children: /* @__PURE__ */ jsxs18(
|
|
1204
|
+
SelectRoot,
|
|
1205
|
+
{
|
|
1206
|
+
collection: selectOptions,
|
|
1207
|
+
id,
|
|
1208
|
+
name: id,
|
|
1209
|
+
multiple: isMultiple,
|
|
1210
|
+
closeOnSelect: !isMultiple,
|
|
1211
|
+
onBlur: _onBlur,
|
|
1212
|
+
onValueChange: isMultiple ? _onMultiChange : _onChange,
|
|
1213
|
+
onFocus: _onFocus,
|
|
1214
|
+
autoFocus: autofocus,
|
|
1215
|
+
value: formValue,
|
|
1216
|
+
"aria-describedby": ariaDescribedByIds7(id),
|
|
1217
|
+
positioning: { placement: "bottom" },
|
|
1218
|
+
children: [
|
|
1219
|
+
/* @__PURE__ */ jsx30(ChakraSelect2.Control, { children: /* @__PURE__ */ jsx30(SelectTrigger, { children: /* @__PURE__ */ jsx30(SelectValueText, { placeholder }) }) }),
|
|
1220
|
+
/* @__PURE__ */ jsx30(ChakraSelect2.Positioner, { minWidth: "100% !important", zIndex: "2 !important", top: "calc(100% + 5px) !important", children: /* @__PURE__ */ jsx30(ChakraSelect2.Content, { children: selectOptions.items.map((item) => /* @__PURE__ */ jsxs18(ChakraSelect2.Item, { item, children: [
|
|
1221
|
+
item.label,
|
|
1222
|
+
/* @__PURE__ */ jsx30(ChakraSelect2.ItemIndicator, {})
|
|
1223
|
+
] }, item.value)) }) })
|
|
1224
|
+
]
|
|
1225
|
+
}
|
|
1226
|
+
)
|
|
1227
|
+
}
|
|
1228
|
+
);
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
// src/SelectNativeWidget/NativeSelectWidget.tsx
|
|
1232
|
+
import { useMemo as useMemo2 } from "react";
|
|
1233
|
+
import {
|
|
1234
|
+
ariaDescribedByIds as ariaDescribedByIds8,
|
|
1235
|
+
enumOptionsIndexForValue as enumOptionsIndexForValue4,
|
|
1236
|
+
enumOptionsValueForIndex as enumOptionsValueForIndex4,
|
|
1237
|
+
labelValue as labelValue7
|
|
1238
|
+
} from "@rjsf/utils";
|
|
1239
|
+
import { createListCollection as createListCollection2, NativeSelect as ChakraSelect3 } from "@chakra-ui/react";
|
|
1240
|
+
import { jsx as jsx31, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1241
|
+
function NativeSelectWidget(props) {
|
|
1242
|
+
const {
|
|
1243
|
+
id,
|
|
1244
|
+
options,
|
|
1245
|
+
label,
|
|
1246
|
+
hideLabel,
|
|
1247
|
+
placeholder,
|
|
1248
|
+
multiple,
|
|
1249
|
+
required,
|
|
1250
|
+
disabled,
|
|
1251
|
+
readonly,
|
|
1252
|
+
value,
|
|
1253
|
+
autofocus,
|
|
1254
|
+
onChange,
|
|
1255
|
+
onBlur,
|
|
1256
|
+
onFocus,
|
|
1257
|
+
rawErrors = [],
|
|
1258
|
+
schema
|
|
1259
|
+
} = props;
|
|
1260
|
+
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
1261
|
+
const _onChange = ({ target }) => {
|
|
1262
|
+
return onChange(enumOptionsValueForIndex4(target && target.value, enumOptions, emptyValue));
|
|
1069
1263
|
};
|
|
1070
|
-
|
|
1071
|
-
|
|
1264
|
+
const _onBlur = ({ target }) => onBlur(id, enumOptionsValueForIndex4(target && target.value, enumOptions, emptyValue));
|
|
1265
|
+
const _onFocus = ({ target }) => onFocus(id, enumOptionsValueForIndex4(target && target.value, enumOptions, emptyValue));
|
|
1266
|
+
const showPlaceholderOption = !multiple && schema.default === void 0;
|
|
1267
|
+
const { valueLabelMap, displayEnumOptions } = useMemo2(() => {
|
|
1268
|
+
const valueLabelMap2 = {};
|
|
1269
|
+
let displayEnumOptions2 = [];
|
|
1270
|
+
if (Array.isArray(enumOptions)) {
|
|
1271
|
+
displayEnumOptions2 = enumOptions.map((option, index) => {
|
|
1272
|
+
const { value: value2, label: label2 } = option;
|
|
1273
|
+
valueLabelMap2[index] = label2 || String(value2);
|
|
1274
|
+
return {
|
|
1275
|
+
label: label2,
|
|
1276
|
+
value: String(index),
|
|
1277
|
+
disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value2) !== -1
|
|
1278
|
+
};
|
|
1279
|
+
});
|
|
1280
|
+
if (showPlaceholderOption) {
|
|
1281
|
+
displayEnumOptions2.unshift({ value: "", label: placeholder || "" });
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
return { valueLabelMap: valueLabelMap2, displayEnumOptions: displayEnumOptions2 };
|
|
1285
|
+
}, [enumDisabled, enumOptions, placeholder, showPlaceholderOption]);
|
|
1286
|
+
const selectedIndex = enumOptionsIndexForValue4(value, enumOptions, false);
|
|
1287
|
+
const getSingleValue = () => typeof selectedIndex !== "undefined" ? [
|
|
1288
|
+
{
|
|
1289
|
+
label: valueLabelMap[selectedIndex] || "",
|
|
1290
|
+
value: selectedIndex.toString()
|
|
1291
|
+
}
|
|
1292
|
+
] : [];
|
|
1293
|
+
const formValue = getSingleValue()[0]?.value || "";
|
|
1294
|
+
const selectOptions = createListCollection2({
|
|
1295
|
+
items: displayEnumOptions.filter((item) => item.value)
|
|
1296
|
+
});
|
|
1297
|
+
return /* @__PURE__ */ jsx31(
|
|
1298
|
+
Field,
|
|
1072
1299
|
{
|
|
1073
1300
|
mb: 1,
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
children: [
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
hideLabel || !label
|
|
1083
|
-
),
|
|
1084
|
-
/* @__PURE__ */ jsx22(
|
|
1085
|
-
Select,
|
|
1301
|
+
disabled: disabled || readonly,
|
|
1302
|
+
required,
|
|
1303
|
+
readOnly: readonly,
|
|
1304
|
+
invalid: rawErrors && rawErrors.length > 0,
|
|
1305
|
+
label: labelValue7(label, hideLabel || !label),
|
|
1306
|
+
children: /* @__PURE__ */ jsxs19(ChakraSelect3.Root, { children: [
|
|
1307
|
+
/* @__PURE__ */ jsx31(
|
|
1308
|
+
ChakraSelect3.Field,
|
|
1086
1309
|
{
|
|
1087
|
-
|
|
1088
|
-
name: id,
|
|
1089
|
-
isMulti: isMultiple,
|
|
1090
|
-
options: displayEnumOptions,
|
|
1091
|
-
placeholder,
|
|
1092
|
-
closeMenuOnSelect: !isMultiple,
|
|
1310
|
+
id,
|
|
1093
1311
|
onBlur: _onBlur,
|
|
1094
|
-
onChange:
|
|
1312
|
+
onChange: _onChange,
|
|
1095
1313
|
onFocus: _onFocus,
|
|
1096
1314
|
autoFocus: autofocus,
|
|
1097
1315
|
value: formValue,
|
|
1098
|
-
"aria-describedby":
|
|
1316
|
+
"aria-describedby": ariaDescribedByIds8(id),
|
|
1317
|
+
children: selectOptions.items.map((item) => /* @__PURE__ */ jsx31("option", { value: item.value, children: item.label }, item.value))
|
|
1099
1318
|
}
|
|
1100
|
-
)
|
|
1101
|
-
|
|
1319
|
+
),
|
|
1320
|
+
/* @__PURE__ */ jsx31(ChakraSelect3.Indicator, {})
|
|
1321
|
+
] })
|
|
1102
1322
|
}
|
|
1103
1323
|
);
|
|
1104
1324
|
}
|
|
1105
1325
|
|
|
1106
1326
|
// src/TextareaWidget/TextareaWidget.tsx
|
|
1107
|
-
import {
|
|
1327
|
+
import { Textarea } from "@chakra-ui/react";
|
|
1108
1328
|
import {
|
|
1109
|
-
ariaDescribedByIds as
|
|
1110
|
-
labelValue as
|
|
1329
|
+
ariaDescribedByIds as ariaDescribedByIds9,
|
|
1330
|
+
labelValue as labelValue8
|
|
1111
1331
|
} from "@rjsf/utils";
|
|
1112
|
-
import { jsx as
|
|
1332
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1113
1333
|
function TextareaWidget({
|
|
1114
1334
|
id,
|
|
1115
1335
|
placeholder,
|
|
@@ -1123,95 +1343,94 @@ function TextareaWidget({
|
|
|
1123
1343
|
onFocus,
|
|
1124
1344
|
onChange,
|
|
1125
1345
|
options,
|
|
1126
|
-
uiSchema,
|
|
1127
1346
|
required,
|
|
1128
1347
|
rawErrors
|
|
1129
1348
|
}) {
|
|
1130
|
-
const chakraProps = getChakra({ uiSchema });
|
|
1131
1349
|
const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
|
|
1132
1350
|
const _onBlur = ({ target }) => onBlur(id, target && target.value);
|
|
1133
1351
|
const _onFocus = ({ target }) => onFocus(id, target && target.value);
|
|
1134
|
-
return /* @__PURE__ */
|
|
1135
|
-
|
|
1352
|
+
return /* @__PURE__ */ jsx32(
|
|
1353
|
+
Field,
|
|
1136
1354
|
{
|
|
1137
1355
|
mb: 1,
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
children:
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
}
|
|
1159
|
-
)
|
|
1160
|
-
]
|
|
1356
|
+
disabled: disabled || readonly,
|
|
1357
|
+
required,
|
|
1358
|
+
readOnly: readonly,
|
|
1359
|
+
invalid: rawErrors && rawErrors.length > 0,
|
|
1360
|
+
label: labelValue8(label, hideLabel || !label),
|
|
1361
|
+
children: /* @__PURE__ */ jsx32(
|
|
1362
|
+
Textarea,
|
|
1363
|
+
{
|
|
1364
|
+
id,
|
|
1365
|
+
name: id,
|
|
1366
|
+
value: value ?? "",
|
|
1367
|
+
placeholder,
|
|
1368
|
+
autoFocus: autofocus,
|
|
1369
|
+
onChange: _onChange,
|
|
1370
|
+
onBlur: _onBlur,
|
|
1371
|
+
onFocus: _onFocus,
|
|
1372
|
+
rows: options.rows,
|
|
1373
|
+
"aria-describedby": ariaDescribedByIds9(id)
|
|
1374
|
+
}
|
|
1375
|
+
)
|
|
1161
1376
|
}
|
|
1162
1377
|
);
|
|
1163
1378
|
}
|
|
1164
1379
|
|
|
1165
1380
|
// src/UpDownWidget/UpDownWidget.tsx
|
|
1166
1381
|
import {
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
NumberIncrementStepper,
|
|
1170
|
-
NumberInputField,
|
|
1171
|
-
NumberInputStepper,
|
|
1172
|
-
FormControl as FormControl10,
|
|
1173
|
-
FormLabel as FormLabel8
|
|
1174
|
-
} from "@chakra-ui/react";
|
|
1175
|
-
import {
|
|
1176
|
-
ariaDescribedByIds as ariaDescribedByIds9,
|
|
1177
|
-
labelValue as labelValue8
|
|
1382
|
+
ariaDescribedByIds as ariaDescribedByIds10,
|
|
1383
|
+
labelValue as labelValue9
|
|
1178
1384
|
} from "@rjsf/utils";
|
|
1179
|
-
|
|
1385
|
+
|
|
1386
|
+
// src/components/ui/number-input.tsx
|
|
1387
|
+
import { forwardRef as forwardRef8, useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
1388
|
+
import { NumberInput as ChakraNumberInput } from "@chakra-ui/react";
|
|
1389
|
+
import { jsx as jsx33, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1390
|
+
var NumberInputRoot = forwardRef8(function NumberInput(props, ref) {
|
|
1391
|
+
const inputRef = useRef2(null);
|
|
1392
|
+
useEffect2(() => {
|
|
1393
|
+
if (inputRef.current) {
|
|
1394
|
+
inputRef.current.value = props.value || "";
|
|
1395
|
+
}
|
|
1396
|
+
}, [props.value]);
|
|
1397
|
+
return /* @__PURE__ */ jsxs20(ChakraNumberInput.Root, { ref, variant: "outline", ...props, children: [
|
|
1398
|
+
/* @__PURE__ */ jsxs20(ChakraNumberInput.Control, { children: [
|
|
1399
|
+
/* @__PURE__ */ jsx33(ChakraNumberInput.IncrementTrigger, {}),
|
|
1400
|
+
/* @__PURE__ */ jsx33(ChakraNumberInput.DecrementTrigger, {})
|
|
1401
|
+
] }),
|
|
1402
|
+
/* @__PURE__ */ jsx33(ChakraNumberInput.Input, { ref: inputRef })
|
|
1403
|
+
] });
|
|
1404
|
+
});
|
|
1405
|
+
|
|
1406
|
+
// src/UpDownWidget/UpDownWidget.tsx
|
|
1407
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
1180
1408
|
function UpDownWidget(props) {
|
|
1181
|
-
const { id,
|
|
1182
|
-
const
|
|
1183
|
-
const _onChange = (value2) => onChange(value2);
|
|
1409
|
+
const { id, readonly, disabled, label, hideLabel, value, onChange, onBlur, onFocus, rawErrors, required } = props;
|
|
1410
|
+
const _onChange = ({ value: value2 }) => onChange(value2);
|
|
1184
1411
|
const _onBlur = ({ target }) => onBlur(id, target && target.value);
|
|
1185
1412
|
const _onFocus = ({ target }) => onFocus(id, target && target.value);
|
|
1186
|
-
return /* @__PURE__ */
|
|
1187
|
-
|
|
1413
|
+
return /* @__PURE__ */ jsx34(
|
|
1414
|
+
Field,
|
|
1188
1415
|
{
|
|
1189
1416
|
mb: 1,
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
children:
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
/* @__PURE__ */ jsxs16(NumberInputStepper, { children: [
|
|
1208
|
-
/* @__PURE__ */ jsx24(NumberIncrementStepper, {}),
|
|
1209
|
-
/* @__PURE__ */ jsx24(NumberDecrementStepper, {})
|
|
1210
|
-
] })
|
|
1211
|
-
]
|
|
1212
|
-
}
|
|
1213
|
-
)
|
|
1214
|
-
]
|
|
1417
|
+
disabled: disabled || readonly,
|
|
1418
|
+
required,
|
|
1419
|
+
readOnly: readonly,
|
|
1420
|
+
invalid: rawErrors && rawErrors.length > 0,
|
|
1421
|
+
label: labelValue9(label, hideLabel || !label),
|
|
1422
|
+
children: /* @__PURE__ */ jsx34(
|
|
1423
|
+
NumberInputRoot,
|
|
1424
|
+
{
|
|
1425
|
+
value,
|
|
1426
|
+
onValueChange: _onChange,
|
|
1427
|
+
onBlur: _onBlur,
|
|
1428
|
+
onFocus: _onFocus,
|
|
1429
|
+
"aria-describedby": ariaDescribedByIds10(id),
|
|
1430
|
+
id,
|
|
1431
|
+
name: id
|
|
1432
|
+
}
|
|
1433
|
+
)
|
|
1215
1434
|
}
|
|
1216
1435
|
);
|
|
1217
1436
|
}
|
|
@@ -1226,6 +1445,7 @@ function generateWidgets() {
|
|
|
1226
1445
|
RadioWidget,
|
|
1227
1446
|
RangeWidget,
|
|
1228
1447
|
SelectWidget,
|
|
1448
|
+
NativeSelectWidget,
|
|
1229
1449
|
TextareaWidget,
|
|
1230
1450
|
UpDownWidget
|
|
1231
1451
|
};
|
|
@@ -1251,281 +1471,25 @@ var Form_default = generateForm();
|
|
|
1251
1471
|
import { CacheProvider } from "@emotion/react";
|
|
1252
1472
|
import createCache from "@emotion/cache";
|
|
1253
1473
|
import weakMemoize from "@emotion/weak-memoize";
|
|
1254
|
-
import { ChakraProvider } from "@chakra-ui/react";
|
|
1255
|
-
|
|
1256
|
-
// src/CssReset.tsx
|
|
1257
|
-
import { Global } from "@emotion/react";
|
|
1258
|
-
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1259
|
-
var CSSReset = () => /* @__PURE__ */ jsx25(
|
|
1260
|
-
Global,
|
|
1261
|
-
{
|
|
1262
|
-
styles: `
|
|
1263
|
-
html {
|
|
1264
|
-
line-height: 1.5;
|
|
1265
|
-
-webkit-text-size-adjust: 100%;
|
|
1266
|
-
font-family: system-ui, sans-serif;
|
|
1267
|
-
-webkit-font-smoothing: antialiased;
|
|
1268
|
-
text-rendering: optimizeLegibility;
|
|
1269
|
-
-moz-osx-font-smoothing: grayscale;
|
|
1270
|
-
touch-action: manipulation;
|
|
1271
|
-
}
|
|
1272
|
-
body {
|
|
1273
|
-
position: relative;
|
|
1274
|
-
min-height: 100%;
|
|
1275
|
-
font-feature-settings: 'kern';
|
|
1276
|
-
}
|
|
1277
|
-
*,
|
|
1278
|
-
*::before,
|
|
1279
|
-
*::after {
|
|
1280
|
-
border-width: 0;
|
|
1281
|
-
border-style: solid;
|
|
1282
|
-
box-sizing: border-box;
|
|
1283
|
-
}
|
|
1284
|
-
main {
|
|
1285
|
-
display: block;
|
|
1286
|
-
}
|
|
1287
|
-
hr {
|
|
1288
|
-
border-top-width: 1px;
|
|
1289
|
-
box-sizing: content-box;
|
|
1290
|
-
height: 0;
|
|
1291
|
-
overflow: visible;
|
|
1292
|
-
}
|
|
1293
|
-
pre,
|
|
1294
|
-
code,
|
|
1295
|
-
kbd,
|
|
1296
|
-
samp {
|
|
1297
|
-
font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
1298
|
-
font-size: 1em;
|
|
1299
|
-
}
|
|
1300
|
-
a {
|
|
1301
|
-
background-color: transparent;
|
|
1302
|
-
color: inherit;
|
|
1303
|
-
text-decoration: inherit;
|
|
1304
|
-
}
|
|
1305
|
-
abbr[title] {
|
|
1306
|
-
border-bottom: none;
|
|
1307
|
-
text-decoration: underline;
|
|
1308
|
-
-webkit-text-decoration: underline dotted;
|
|
1309
|
-
text-decoration: underline dotted;
|
|
1310
|
-
}
|
|
1311
|
-
b,
|
|
1312
|
-
strong {
|
|
1313
|
-
font-weight: bold;
|
|
1314
|
-
}
|
|
1315
|
-
small {
|
|
1316
|
-
font-size: 80%;
|
|
1317
|
-
}
|
|
1318
|
-
sub,
|
|
1319
|
-
sup {
|
|
1320
|
-
font-size: 75%;
|
|
1321
|
-
line-height: 0;
|
|
1322
|
-
position: relative;
|
|
1323
|
-
vertical-align: baseline;
|
|
1324
|
-
}
|
|
1325
|
-
sub {
|
|
1326
|
-
bottom: -0.25em;
|
|
1327
|
-
}
|
|
1328
|
-
sup {
|
|
1329
|
-
top: -0.5em;
|
|
1330
|
-
}
|
|
1331
|
-
img {
|
|
1332
|
-
border-style: none;
|
|
1333
|
-
}
|
|
1334
|
-
button,
|
|
1335
|
-
input,
|
|
1336
|
-
optgroup,
|
|
1337
|
-
select,
|
|
1338
|
-
textarea {
|
|
1339
|
-
font-family: inherit;
|
|
1340
|
-
font-size: 100%;
|
|
1341
|
-
line-height: 1.15;
|
|
1342
|
-
margin: 0;
|
|
1343
|
-
}
|
|
1344
|
-
button,
|
|
1345
|
-
input {
|
|
1346
|
-
overflow: visible;
|
|
1347
|
-
}
|
|
1348
|
-
button,
|
|
1349
|
-
select {
|
|
1350
|
-
text-transform: none;
|
|
1351
|
-
}
|
|
1352
|
-
button::-moz-focus-inner,
|
|
1353
|
-
[type="button"]::-moz-focus-inner,
|
|
1354
|
-
[type="reset"]::-moz-focus-inner,
|
|
1355
|
-
[type="submit"]::-moz-focus-inner {
|
|
1356
|
-
border-style: none;
|
|
1357
|
-
padding: 0;
|
|
1358
|
-
}
|
|
1359
|
-
fieldset {
|
|
1360
|
-
padding: 0.35em 0.75em 0.625em;
|
|
1361
|
-
}
|
|
1362
|
-
legend {
|
|
1363
|
-
box-sizing: border-box;
|
|
1364
|
-
color: inherit;
|
|
1365
|
-
display: table;
|
|
1366
|
-
max-width: 100%;
|
|
1367
|
-
padding: 0;
|
|
1368
|
-
white-space: normal;
|
|
1369
|
-
}
|
|
1370
|
-
progress {
|
|
1371
|
-
vertical-align: baseline;
|
|
1372
|
-
}
|
|
1373
|
-
textarea {
|
|
1374
|
-
overflow: auto;
|
|
1375
|
-
}
|
|
1376
|
-
[type="checkbox"],
|
|
1377
|
-
[type="radio"] {
|
|
1378
|
-
box-sizing: border-box;
|
|
1379
|
-
padding: 0;
|
|
1380
|
-
}
|
|
1381
|
-
[type="number"]::-webkit-inner-spin-button,
|
|
1382
|
-
[type="number"]::-webkit-outer-spin-button {
|
|
1383
|
-
-webkit-appearance: none !important;
|
|
1384
|
-
}
|
|
1385
|
-
input[type="number"] {
|
|
1386
|
-
-moz-appearance: textfield;
|
|
1387
|
-
}
|
|
1388
|
-
[type="search"] {
|
|
1389
|
-
-webkit-appearance: textfield;
|
|
1390
|
-
outline-offset: -2px;
|
|
1391
|
-
}
|
|
1392
|
-
[type="search"]::-webkit-search-decoration {
|
|
1393
|
-
-webkit-appearance: none !important;
|
|
1394
|
-
}
|
|
1395
|
-
::-webkit-file-upload-button {
|
|
1396
|
-
-webkit-appearance: button;
|
|
1397
|
-
font: inherit;
|
|
1398
|
-
}
|
|
1399
|
-
details {
|
|
1400
|
-
display: block;
|
|
1401
|
-
}
|
|
1402
|
-
summary {
|
|
1403
|
-
display: list-item;
|
|
1404
|
-
}
|
|
1405
|
-
template {
|
|
1406
|
-
display: none;
|
|
1407
|
-
}
|
|
1408
|
-
[hidden] {
|
|
1409
|
-
display: none !important;
|
|
1410
|
-
}
|
|
1411
|
-
body,
|
|
1412
|
-
blockquote,
|
|
1413
|
-
dl,
|
|
1414
|
-
dd,
|
|
1415
|
-
h1,
|
|
1416
|
-
h2,
|
|
1417
|
-
h3,
|
|
1418
|
-
h4,
|
|
1419
|
-
h5,
|
|
1420
|
-
h6,
|
|
1421
|
-
hr,
|
|
1422
|
-
figure,
|
|
1423
|
-
p,
|
|
1424
|
-
pre {
|
|
1425
|
-
margin: 0;
|
|
1426
|
-
}
|
|
1427
|
-
button {
|
|
1428
|
-
background: transparent;
|
|
1429
|
-
padding: 0;
|
|
1430
|
-
}
|
|
1431
|
-
fieldset {
|
|
1432
|
-
margin: 0;
|
|
1433
|
-
padding: 0;
|
|
1434
|
-
}
|
|
1435
|
-
ol,
|
|
1436
|
-
ul {
|
|
1437
|
-
margin: 0;
|
|
1438
|
-
padding: 0;
|
|
1439
|
-
}
|
|
1440
|
-
textarea {
|
|
1441
|
-
resize: vertical;
|
|
1442
|
-
}
|
|
1443
|
-
button,
|
|
1444
|
-
[role="button"] {
|
|
1445
|
-
cursor: pointer;
|
|
1446
|
-
}
|
|
1447
|
-
button::-moz-focus-inner {
|
|
1448
|
-
border: 0 !important;
|
|
1449
|
-
}
|
|
1450
|
-
table {
|
|
1451
|
-
border-collapse: collapse;
|
|
1452
|
-
}
|
|
1453
|
-
h1,
|
|
1454
|
-
h2,
|
|
1455
|
-
h3,
|
|
1456
|
-
h4,
|
|
1457
|
-
h5,
|
|
1458
|
-
h6 {
|
|
1459
|
-
font-size: inherit;
|
|
1460
|
-
font-weight: inherit;
|
|
1461
|
-
}
|
|
1462
|
-
button,
|
|
1463
|
-
input,
|
|
1464
|
-
optgroup,
|
|
1465
|
-
select,
|
|
1466
|
-
textarea {
|
|
1467
|
-
padding: 0;
|
|
1468
|
-
line-height: inherit;
|
|
1469
|
-
color: inherit;
|
|
1470
|
-
}
|
|
1471
|
-
img,
|
|
1472
|
-
svg,
|
|
1473
|
-
video,
|
|
1474
|
-
canvas,
|
|
1475
|
-
audio,
|
|
1476
|
-
iframe,
|
|
1477
|
-
embed,
|
|
1478
|
-
object {
|
|
1479
|
-
display: block;
|
|
1480
|
-
}
|
|
1481
|
-
img,
|
|
1482
|
-
video {
|
|
1483
|
-
max-width: 100%;
|
|
1484
|
-
height: auto;
|
|
1485
|
-
}
|
|
1486
|
-
[data-js-focus-visible] :focus:not([data-focus-visible-added]) {
|
|
1487
|
-
outline: none;
|
|
1488
|
-
box-shadow: none;
|
|
1489
|
-
}
|
|
1490
|
-
select::-ms-expand {
|
|
1491
|
-
display: none;
|
|
1492
|
-
}
|
|
1493
|
-
input {
|
|
1494
|
-
border-width: revert;
|
|
1495
|
-
border-color: revert;
|
|
1496
|
-
border-style: revert;
|
|
1497
|
-
}
|
|
1498
|
-
.array-item > hr {
|
|
1499
|
-
margin-top: 16px;
|
|
1500
|
-
margin-bottom: 16px;
|
|
1501
|
-
}
|
|
1502
|
-
`
|
|
1503
|
-
}
|
|
1504
|
-
);
|
|
1505
|
-
var CssReset_default = CSSReset;
|
|
1506
|
-
|
|
1507
|
-
// src/ChakraFrameProvider.tsx
|
|
1508
|
-
import { jsx as jsx26, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1474
|
+
import { ChakraProvider, defaultSystem } from "@chakra-ui/react";
|
|
1475
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
1509
1476
|
var memoizedCreateCacheWithContainer = weakMemoize((container) => {
|
|
1510
1477
|
const newCache = createCache({ container, key: "rjsf" });
|
|
1511
1478
|
return newCache;
|
|
1512
1479
|
});
|
|
1513
1480
|
var __createChakraFrameProvider = (props) => ({ document }) => {
|
|
1514
|
-
return /* @__PURE__ */
|
|
1515
|
-
/* @__PURE__ */ jsx26(CssReset_default, {}),
|
|
1516
|
-
props.children
|
|
1517
|
-
] }) }) });
|
|
1481
|
+
return /* @__PURE__ */ jsx35("div", { style: { margin: 2 }, children: /* @__PURE__ */ jsx35(CacheProvider, { value: memoizedCreateCacheWithContainer(document.head), children: /* @__PURE__ */ jsx35(ChakraProvider, { value: defaultSystem, children: props.children }) }) });
|
|
1518
1482
|
};
|
|
1519
1483
|
|
|
1520
1484
|
// src/index.ts
|
|
1521
|
-
var
|
|
1485
|
+
var index_default = Form_default;
|
|
1522
1486
|
export {
|
|
1523
1487
|
Form_default as Form,
|
|
1524
1488
|
Templates_default as Templates,
|
|
1525
1489
|
Theme_default as Theme,
|
|
1526
1490
|
Widgets_default as Widgets,
|
|
1527
1491
|
__createChakraFrameProvider,
|
|
1528
|
-
|
|
1492
|
+
index_default as default,
|
|
1529
1493
|
generateForm,
|
|
1530
1494
|
generateTemplates,
|
|
1531
1495
|
generateTheme,
|