@rjsf/chakra-ui 5.10.0 → 5.11.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.cjs.development.js +929 -639
- package/dist/chakra-ui.cjs.development.js.map +1 -1
- package/dist/chakra-ui.cjs.production.min.js +1 -1
- package/dist/chakra-ui.cjs.production.min.js.map +1 -1
- package/dist/chakra-ui.esm.js +929 -639
- package/dist/chakra-ui.esm.js.map +1 -1
- package/dist/chakra-ui.umd.development.js +929 -639
- package/dist/chakra-ui.umd.development.js.map +1 -1
- package/dist/chakra-ui.umd.production.min.js +1 -1
- package/dist/chakra-ui.umd.production.min.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/package.json +12 -10
|
@@ -18,77 +18,48 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
18
18
|
var createCache__default = /*#__PURE__*/_interopDefaultLegacy(createCache);
|
|
19
19
|
var weakMemoize__default = /*#__PURE__*/_interopDefaultLegacy(weakMemoize);
|
|
20
20
|
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
};
|
|
33
|
-
return _extends.apply(this, arguments);
|
|
34
|
-
}
|
|
35
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
36
|
-
if (source == null) return {};
|
|
37
|
-
var target = {};
|
|
38
|
-
var sourceKeys = Object.keys(source);
|
|
39
|
-
var key, i;
|
|
40
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
41
|
-
key = sourceKeys[i];
|
|
42
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
43
|
-
target[key] = source[key];
|
|
44
|
-
}
|
|
45
|
-
return target;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
var _excluded$2 = ["uiSchema", "registry"];
|
|
49
|
-
function AddButton(_ref) {
|
|
50
|
-
var registry = _ref.registry,
|
|
51
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
52
|
-
var translateString = registry.translateString;
|
|
53
|
-
return jsxRuntime.jsx(react.Button, _extends({
|
|
54
|
-
leftIcon: jsxRuntime.jsx(icons.AddIcon, {})
|
|
55
|
-
}, props, {
|
|
21
|
+
function AddButton({
|
|
22
|
+
uiSchema,
|
|
23
|
+
registry,
|
|
24
|
+
...props
|
|
25
|
+
}) {
|
|
26
|
+
const {
|
|
27
|
+
translateString
|
|
28
|
+
} = registry;
|
|
29
|
+
return jsxRuntime.jsx(react.Button, {
|
|
30
|
+
leftIcon: jsxRuntime.jsx(icons.AddIcon, {}),
|
|
31
|
+
...props,
|
|
56
32
|
children: translateString(utils.TranslatableString.AddItemButton)
|
|
57
|
-
})
|
|
33
|
+
});
|
|
58
34
|
}
|
|
59
35
|
|
|
60
36
|
function ArrayFieldItemTemplate(props) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return onReorderClick(index, index - 1);
|
|
88
|
-
}, [index, onReorderClick]);
|
|
89
|
-
var onArrowDownClick = react$1.useMemo(function () {
|
|
90
|
-
return onReorderClick(index, index + 1);
|
|
91
|
-
}, [index, onReorderClick]);
|
|
37
|
+
const {
|
|
38
|
+
children,
|
|
39
|
+
disabled,
|
|
40
|
+
hasToolbar,
|
|
41
|
+
hasCopy,
|
|
42
|
+
hasMoveDown,
|
|
43
|
+
hasMoveUp,
|
|
44
|
+
hasRemove,
|
|
45
|
+
index,
|
|
46
|
+
onCopyIndexClick,
|
|
47
|
+
onDropIndexClick,
|
|
48
|
+
onReorderClick,
|
|
49
|
+
readonly,
|
|
50
|
+
uiSchema,
|
|
51
|
+
registry
|
|
52
|
+
} = props;
|
|
53
|
+
const {
|
|
54
|
+
CopyButton,
|
|
55
|
+
MoveDownButton,
|
|
56
|
+
MoveUpButton,
|
|
57
|
+
RemoveButton
|
|
58
|
+
} = registry.templates.ButtonTemplates;
|
|
59
|
+
const onCopyClick = react$1.useMemo(() => onCopyIndexClick(index), [index, onCopyIndexClick]);
|
|
60
|
+
const onRemoveClick = react$1.useMemo(() => onDropIndexClick(index), [index, onDropIndexClick]);
|
|
61
|
+
const onArrowUpClick = react$1.useMemo(() => onReorderClick(index, index - 1), [index, onReorderClick]);
|
|
62
|
+
const onArrowDownClick = react$1.useMemo(() => onReorderClick(index, index + 1), [index, onReorderClick]);
|
|
92
63
|
return jsxRuntime.jsxs(react.HStack, {
|
|
93
64
|
alignItems: 'flex-end',
|
|
94
65
|
py: 1,
|
|
@@ -125,25 +96,30 @@ function ArrayFieldItemTemplate(props) {
|
|
|
125
96
|
});
|
|
126
97
|
}
|
|
127
98
|
|
|
128
|
-
var _excluded$1 = ["key"];
|
|
129
99
|
function ArrayFieldTemplate(props) {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
100
|
+
const {
|
|
101
|
+
canAdd,
|
|
102
|
+
disabled,
|
|
103
|
+
idSchema,
|
|
104
|
+
uiSchema,
|
|
105
|
+
items,
|
|
106
|
+
onAddClick,
|
|
107
|
+
readonly,
|
|
108
|
+
registry,
|
|
109
|
+
required,
|
|
110
|
+
schema,
|
|
111
|
+
title
|
|
112
|
+
} = props;
|
|
113
|
+
const uiOptions = utils.getUiOptions(uiSchema);
|
|
114
|
+
const ArrayFieldDescriptionTemplate = utils.getTemplate('ArrayFieldDescriptionTemplate', registry, uiOptions);
|
|
115
|
+
const ArrayFieldItemTemplate = utils.getTemplate('ArrayFieldItemTemplate', registry, uiOptions);
|
|
116
|
+
const ArrayFieldTitleTemplate = utils.getTemplate('ArrayFieldTitleTemplate', registry, uiOptions);
|
|
145
117
|
// Button templates are not overridden in the uiSchema
|
|
146
|
-
|
|
118
|
+
const {
|
|
119
|
+
ButtonTemplates: {
|
|
120
|
+
AddButton
|
|
121
|
+
}
|
|
122
|
+
} = registry.templates;
|
|
147
123
|
return jsxRuntime.jsxs(react.Box, {
|
|
148
124
|
children: [jsxRuntime.jsx(ArrayFieldTitleTemplate, {
|
|
149
125
|
idSchema: idSchema,
|
|
@@ -160,11 +136,12 @@ function ArrayFieldTemplate(props) {
|
|
|
160
136
|
registry: registry
|
|
161
137
|
}), jsxRuntime.jsxs(react.Grid, {
|
|
162
138
|
children: [jsxRuntime.jsx(react.GridItem, {
|
|
163
|
-
children: items.length > 0 && items.map(
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
139
|
+
children: items.length > 0 && items.map(({
|
|
140
|
+
key,
|
|
141
|
+
...itemProps
|
|
142
|
+
}) => jsxRuntime.jsx(ArrayFieldItemTemplate, {
|
|
143
|
+
...itemProps
|
|
144
|
+
}, key))
|
|
168
145
|
}), canAdd && jsxRuntime.jsx(react.GridItem, {
|
|
169
146
|
justifySelf: 'flex-end',
|
|
170
147
|
children: jsxRuntime.jsx(react.Box, {
|
|
@@ -178,15 +155,15 @@ function ArrayFieldTemplate(props) {
|
|
|
178
155
|
})
|
|
179
156
|
})
|
|
180
157
|
})]
|
|
181
|
-
},
|
|
158
|
+
}, `array-item-list-${idSchema.$id}`)]
|
|
182
159
|
});
|
|
183
160
|
}
|
|
184
161
|
|
|
185
|
-
function getChakra(
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
Object.keys(chakraProps).forEach(
|
|
162
|
+
function getChakra({
|
|
163
|
+
uiSchema = {}
|
|
164
|
+
}) {
|
|
165
|
+
const chakraProps = uiSchema['ui:options'] && uiSchema['ui:options'].chakra || {};
|
|
166
|
+
Object.keys(chakraProps).forEach(key => {
|
|
190
167
|
/**
|
|
191
168
|
* Leveraging `shouldForwardProp` to remove props
|
|
192
169
|
*
|
|
@@ -202,52 +179,57 @@ function getChakra(_ref) {
|
|
|
202
179
|
}
|
|
203
180
|
|
|
204
181
|
function BaseInputTemplate(props) {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
182
|
+
const {
|
|
183
|
+
id,
|
|
184
|
+
type,
|
|
185
|
+
value,
|
|
186
|
+
label,
|
|
187
|
+
hideLabel,
|
|
188
|
+
schema,
|
|
189
|
+
uiSchema,
|
|
190
|
+
onChange,
|
|
191
|
+
onChangeOverride,
|
|
192
|
+
onBlur,
|
|
193
|
+
onFocus,
|
|
194
|
+
options,
|
|
195
|
+
required,
|
|
196
|
+
readonly,
|
|
197
|
+
rawErrors,
|
|
198
|
+
autofocus,
|
|
199
|
+
placeholder,
|
|
200
|
+
disabled
|
|
201
|
+
} = props;
|
|
202
|
+
const inputProps = utils.getInputProps(schema, type, options);
|
|
203
|
+
const chakraProps = getChakra({
|
|
204
|
+
uiSchema
|
|
226
205
|
});
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
}
|
|
206
|
+
const _onChange = ({
|
|
207
|
+
target: {
|
|
208
|
+
value
|
|
209
|
+
}
|
|
210
|
+
}) => onChange(value === '' ? options.emptyValue : value);
|
|
211
|
+
const _onBlur = ({
|
|
212
|
+
target: {
|
|
213
|
+
value
|
|
214
|
+
}
|
|
215
|
+
}) => onBlur(id, value);
|
|
216
|
+
const _onFocus = ({
|
|
217
|
+
target: {
|
|
218
|
+
value
|
|
219
|
+
}
|
|
220
|
+
}) => onFocus(id, value);
|
|
221
|
+
return jsxRuntime.jsxs(react.FormControl, {
|
|
222
|
+
mb: 1,
|
|
223
|
+
...chakraProps,
|
|
242
224
|
isDisabled: disabled || readonly,
|
|
243
225
|
isRequired: required,
|
|
244
226
|
isReadOnly: readonly,
|
|
245
227
|
isInvalid: rawErrors && rawErrors.length > 0,
|
|
246
228
|
children: [utils.labelValue(jsxRuntime.jsx(react.FormLabel, {
|
|
247
229
|
htmlFor: id,
|
|
248
|
-
id: id
|
|
230
|
+
id: `${id}-label`,
|
|
249
231
|
children: label
|
|
250
|
-
}), hideLabel || !label), jsxRuntime.jsx(react.Input,
|
|
232
|
+
}), hideLabel || !label), jsxRuntime.jsx(react.Input, {
|
|
251
233
|
id: id,
|
|
252
234
|
name: id,
|
|
253
235
|
value: value || value === 0 ? value : '',
|
|
@@ -255,24 +237,25 @@ function BaseInputTemplate(props) {
|
|
|
255
237
|
onBlur: _onBlur,
|
|
256
238
|
onFocus: _onFocus,
|
|
257
239
|
autoFocus: autofocus,
|
|
258
|
-
placeholder: placeholder
|
|
259
|
-
|
|
240
|
+
placeholder: placeholder,
|
|
241
|
+
...inputProps,
|
|
260
242
|
list: schema.examples ? utils.examplesId(id) : undefined,
|
|
261
243
|
"aria-describedby": utils.ariaDescribedByIds(id, !!schema.examples)
|
|
262
|
-
})
|
|
244
|
+
}), Array.isArray(schema.examples) ? jsxRuntime.jsx("datalist", {
|
|
263
245
|
id: utils.examplesId(id),
|
|
264
|
-
children: schema.examples.concat(schema
|
|
246
|
+
children: schema.examples.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : []).map(example => {
|
|
265
247
|
return jsxRuntime.jsx("option", {
|
|
266
248
|
value: example
|
|
267
249
|
}, example);
|
|
268
250
|
})
|
|
269
251
|
}) : null]
|
|
270
|
-
})
|
|
252
|
+
});
|
|
271
253
|
}
|
|
272
254
|
|
|
273
|
-
function DescriptionField(
|
|
274
|
-
|
|
275
|
-
|
|
255
|
+
function DescriptionField({
|
|
256
|
+
description,
|
|
257
|
+
id
|
|
258
|
+
}) {
|
|
276
259
|
if (!description) {
|
|
277
260
|
return null;
|
|
278
261
|
}
|
|
@@ -289,10 +272,13 @@ function DescriptionField(_ref) {
|
|
|
289
272
|
});
|
|
290
273
|
}
|
|
291
274
|
|
|
292
|
-
function ErrorList(
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
275
|
+
function ErrorList({
|
|
276
|
+
errors,
|
|
277
|
+
registry
|
|
278
|
+
}) {
|
|
279
|
+
const {
|
|
280
|
+
translateString
|
|
281
|
+
} = registry;
|
|
296
282
|
return jsxRuntime.jsxs(react.Alert, {
|
|
297
283
|
flexDirection: 'column',
|
|
298
284
|
alignItems: 'flex-start',
|
|
@@ -301,62 +287,80 @@ function ErrorList(_ref) {
|
|
|
301
287
|
children: [jsxRuntime.jsx(react.AlertTitle, {
|
|
302
288
|
children: translateString(utils.TranslatableString.ErrorsLabel)
|
|
303
289
|
}), jsxRuntime.jsx(react.List, {
|
|
304
|
-
children: errors.map(
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
}, i);
|
|
311
|
-
})
|
|
290
|
+
children: errors.map((error, i) => jsxRuntime.jsxs(react.ListItem, {
|
|
291
|
+
children: [jsxRuntime.jsx(react.ListIcon, {
|
|
292
|
+
as: icons.WarningIcon,
|
|
293
|
+
color: 'red.500'
|
|
294
|
+
}), error.stack]
|
|
295
|
+
}, i))
|
|
312
296
|
})]
|
|
313
297
|
});
|
|
314
298
|
}
|
|
315
299
|
|
|
316
|
-
var _excluded = ["icon", "iconType", "uiSchema", "registry"];
|
|
317
300
|
function ChakraIconButton(props) {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
301
|
+
const {
|
|
302
|
+
icon,
|
|
303
|
+
iconType,
|
|
304
|
+
uiSchema,
|
|
305
|
+
registry,
|
|
306
|
+
...otherProps
|
|
307
|
+
} = props;
|
|
308
|
+
return jsxRuntime.jsx(react.IconButton, {
|
|
309
|
+
"aria-label": props.title,
|
|
310
|
+
...otherProps,
|
|
323
311
|
icon: icon
|
|
324
|
-
})
|
|
312
|
+
});
|
|
325
313
|
}
|
|
326
314
|
ChakraIconButton.displayName = 'ChakraIconButton';
|
|
327
315
|
var ChakraIconButton$1 = /*#__PURE__*/react$1.memo(ChakraIconButton);
|
|
328
316
|
|
|
329
317
|
function CopyButton(props) {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
318
|
+
const {
|
|
319
|
+
registry: {
|
|
320
|
+
translateString
|
|
321
|
+
}
|
|
322
|
+
} = props;
|
|
323
|
+
return jsxRuntime.jsx(ChakraIconButton$1, {
|
|
324
|
+
title: translateString(utils.TranslatableString.CopyButton),
|
|
325
|
+
...props,
|
|
334
326
|
icon: jsxRuntime.jsx(icons.CopyIcon, {})
|
|
335
|
-
})
|
|
327
|
+
});
|
|
336
328
|
}
|
|
337
329
|
function MoveDownButton(props) {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
330
|
+
const {
|
|
331
|
+
registry: {
|
|
332
|
+
translateString
|
|
333
|
+
}
|
|
334
|
+
} = props;
|
|
335
|
+
return jsxRuntime.jsx(ChakraIconButton$1, {
|
|
336
|
+
title: translateString(utils.TranslatableString.MoveDownButton),
|
|
337
|
+
...props,
|
|
342
338
|
icon: jsxRuntime.jsx(icons.ArrowDownIcon, {})
|
|
343
|
-
})
|
|
339
|
+
});
|
|
344
340
|
}
|
|
345
341
|
function MoveUpButton(props) {
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
342
|
+
const {
|
|
343
|
+
registry: {
|
|
344
|
+
translateString
|
|
345
|
+
}
|
|
346
|
+
} = props;
|
|
347
|
+
return jsxRuntime.jsx(ChakraIconButton$1, {
|
|
348
|
+
title: translateString(utils.TranslatableString.MoveUpButton),
|
|
349
|
+
...props,
|
|
350
350
|
icon: jsxRuntime.jsx(icons.ArrowUpIcon, {})
|
|
351
|
-
})
|
|
351
|
+
});
|
|
352
352
|
}
|
|
353
353
|
function RemoveButton(props) {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
354
|
+
const {
|
|
355
|
+
registry: {
|
|
356
|
+
translateString
|
|
357
|
+
}
|
|
358
|
+
} = props;
|
|
359
|
+
return jsxRuntime.jsx(ChakraIconButton$1, {
|
|
360
|
+
title: translateString(utils.TranslatableString.RemoveButton),
|
|
361
|
+
...props,
|
|
358
362
|
icon: jsxRuntime.jsx(icons.DeleteIcon, {})
|
|
359
|
-
})
|
|
363
|
+
});
|
|
360
364
|
}
|
|
361
365
|
|
|
362
366
|
/** The `FieldErrorTemplate` component renders the errors local to the particular field
|
|
@@ -364,15 +368,16 @@ function RemoveButton(props) {
|
|
|
364
368
|
* @param props - The `FieldErrorProps` for the errors being rendered
|
|
365
369
|
*/
|
|
366
370
|
function FieldErrorTemplate(props) {
|
|
367
|
-
|
|
368
|
-
errors =
|
|
369
|
-
idSchema
|
|
371
|
+
const {
|
|
372
|
+
errors = [],
|
|
373
|
+
idSchema
|
|
374
|
+
} = props;
|
|
370
375
|
if (errors.length === 0) {
|
|
371
376
|
return null;
|
|
372
377
|
}
|
|
373
|
-
|
|
378
|
+
const id = utils.errorId(idSchema);
|
|
374
379
|
return jsxRuntime.jsx(react.List, {
|
|
375
|
-
children: errors.map(
|
|
380
|
+
children: errors.map((error, i) => {
|
|
376
381
|
return jsxRuntime.jsx(react.ListItem, {
|
|
377
382
|
children: jsxRuntime.jsx(react.FormErrorMessage, {
|
|
378
383
|
id: id,
|
|
@@ -388,12 +393,14 @@ function FieldErrorTemplate(props) {
|
|
|
388
393
|
* @param props - The `FieldHelpProps` to be rendered
|
|
389
394
|
*/
|
|
390
395
|
function FieldHelpTemplate(props) {
|
|
391
|
-
|
|
392
|
-
|
|
396
|
+
const {
|
|
397
|
+
idSchema,
|
|
398
|
+
help
|
|
399
|
+
} = props;
|
|
393
400
|
if (!help) {
|
|
394
401
|
return null;
|
|
395
402
|
}
|
|
396
|
-
|
|
403
|
+
const id = utils.helpId(idSchema);
|
|
397
404
|
return jsxRuntime.jsx(react.FormHelperText, {
|
|
398
405
|
id: id,
|
|
399
406
|
children: help
|
|
@@ -401,29 +408,30 @@ function FieldHelpTemplate(props) {
|
|
|
401
408
|
}
|
|
402
409
|
|
|
403
410
|
function FieldTemplate(props) {
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
rawErrors =
|
|
419
|
-
errors
|
|
420
|
-
help
|
|
421
|
-
description
|
|
422
|
-
rawDescription
|
|
423
|
-
schema
|
|
424
|
-
uiSchema
|
|
425
|
-
|
|
426
|
-
|
|
411
|
+
const {
|
|
412
|
+
id,
|
|
413
|
+
children,
|
|
414
|
+
classNames,
|
|
415
|
+
style,
|
|
416
|
+
disabled,
|
|
417
|
+
displayLabel,
|
|
418
|
+
hidden,
|
|
419
|
+
label,
|
|
420
|
+
onDropPropertyClick,
|
|
421
|
+
onKeyChange,
|
|
422
|
+
readonly,
|
|
423
|
+
registry,
|
|
424
|
+
required,
|
|
425
|
+
rawErrors = [],
|
|
426
|
+
errors,
|
|
427
|
+
help,
|
|
428
|
+
description,
|
|
429
|
+
rawDescription,
|
|
430
|
+
schema,
|
|
431
|
+
uiSchema
|
|
432
|
+
} = props;
|
|
433
|
+
const uiOptions = utils.getUiOptions(uiSchema);
|
|
434
|
+
const WrapIfAdditionalTemplate = utils.getTemplate('WrapIfAdditionalTemplate', registry, uiOptions);
|
|
427
435
|
if (hidden) {
|
|
428
436
|
return jsxRuntime.jsx("div", {
|
|
429
437
|
style: {
|
|
@@ -457,23 +465,29 @@ function FieldTemplate(props) {
|
|
|
457
465
|
}
|
|
458
466
|
|
|
459
467
|
function ObjectFieldTemplate(props) {
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
468
|
+
const {
|
|
469
|
+
description,
|
|
470
|
+
title,
|
|
471
|
+
properties,
|
|
472
|
+
required,
|
|
473
|
+
disabled,
|
|
474
|
+
readonly,
|
|
475
|
+
uiSchema,
|
|
476
|
+
idSchema,
|
|
477
|
+
schema,
|
|
478
|
+
formData,
|
|
479
|
+
onAddClick,
|
|
480
|
+
registry
|
|
481
|
+
} = props;
|
|
482
|
+
const uiOptions = utils.getUiOptions(uiSchema);
|
|
483
|
+
const TitleFieldTemplate = utils.getTemplate('TitleFieldTemplate', registry, uiOptions);
|
|
484
|
+
const DescriptionFieldTemplate = utils.getTemplate('DescriptionFieldTemplate', registry, uiOptions);
|
|
475
485
|
// Button templates are not overridden in the uiSchema
|
|
476
|
-
|
|
486
|
+
const {
|
|
487
|
+
ButtonTemplates: {
|
|
488
|
+
AddButton
|
|
489
|
+
}
|
|
490
|
+
} = registry.templates;
|
|
477
491
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
478
492
|
children: [title && jsxRuntime.jsx(TitleFieldTemplate, {
|
|
479
493
|
id: utils.titleId(idSchema),
|
|
@@ -491,11 +505,9 @@ function ObjectFieldTemplate(props) {
|
|
|
491
505
|
}), jsxRuntime.jsxs(react.Grid, {
|
|
492
506
|
gap: description ? 2 : 6,
|
|
493
507
|
mb: 4,
|
|
494
|
-
children: [properties.map(
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
}, idSchema.$id + "-" + element.name + "-" + index);
|
|
498
|
-
}), utils.canExpand(schema, uiSchema, formData) && jsxRuntime.jsx(react.GridItem, {
|
|
508
|
+
children: [properties.map((element, index) => element.hidden ? element.content : jsxRuntime.jsx(react.GridItem, {
|
|
509
|
+
children: element.content
|
|
510
|
+
}, `${idSchema.$id}-${element.name}-${index}`)), utils.canExpand(schema, uiSchema, formData) && jsxRuntime.jsx(react.GridItem, {
|
|
499
511
|
justifySelf: 'flex-end',
|
|
500
512
|
children: jsxRuntime.jsx(AddButton, {
|
|
501
513
|
className: 'object-property-expand',
|
|
@@ -509,29 +521,32 @@ function ObjectFieldTemplate(props) {
|
|
|
509
521
|
});
|
|
510
522
|
}
|
|
511
523
|
|
|
512
|
-
function SubmitButton(
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
524
|
+
function SubmitButton({
|
|
525
|
+
uiSchema
|
|
526
|
+
}) {
|
|
527
|
+
const {
|
|
528
|
+
submitText,
|
|
529
|
+
norender,
|
|
530
|
+
props: submitButtonProps
|
|
531
|
+
} = utils.getSubmitButtonOptions(uiSchema);
|
|
518
532
|
if (norender) {
|
|
519
533
|
return null;
|
|
520
534
|
}
|
|
521
535
|
return jsxRuntime.jsx(react.Box, {
|
|
522
536
|
marginTop: 3,
|
|
523
|
-
children: jsxRuntime.jsx(react.Button,
|
|
537
|
+
children: jsxRuntime.jsx(react.Button, {
|
|
524
538
|
type: 'submit',
|
|
525
|
-
variant: 'solid'
|
|
526
|
-
|
|
539
|
+
variant: 'solid',
|
|
540
|
+
...submitButtonProps,
|
|
527
541
|
children: submitText
|
|
528
|
-
})
|
|
542
|
+
})
|
|
529
543
|
});
|
|
530
544
|
}
|
|
531
545
|
|
|
532
|
-
function TitleField(
|
|
533
|
-
|
|
534
|
-
|
|
546
|
+
function TitleField({
|
|
547
|
+
id,
|
|
548
|
+
title
|
|
549
|
+
}) {
|
|
535
550
|
return jsxRuntime.jsxs(react.Box, {
|
|
536
551
|
id: id,
|
|
537
552
|
mt: 1,
|
|
@@ -544,25 +559,31 @@ function TitleField(_ref) {
|
|
|
544
559
|
}
|
|
545
560
|
|
|
546
561
|
function WrapIfAdditionalTemplate(props) {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
+
const {
|
|
563
|
+
children,
|
|
564
|
+
classNames,
|
|
565
|
+
style,
|
|
566
|
+
disabled,
|
|
567
|
+
id,
|
|
568
|
+
label,
|
|
569
|
+
onDropPropertyClick,
|
|
570
|
+
onKeyChange,
|
|
571
|
+
readonly,
|
|
572
|
+
registry,
|
|
573
|
+
required,
|
|
574
|
+
schema,
|
|
575
|
+
uiSchema
|
|
576
|
+
} = props;
|
|
577
|
+
const {
|
|
578
|
+
templates,
|
|
579
|
+
translateString
|
|
580
|
+
} = registry;
|
|
562
581
|
// Button templates are not overridden in the uiSchema
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
582
|
+
const {
|
|
583
|
+
RemoveButton
|
|
584
|
+
} = templates.ButtonTemplates;
|
|
585
|
+
const keyLabel = translateString(utils.TranslatableString.KeyLabel, [label]);
|
|
586
|
+
const additional = (utils.ADDITIONAL_PROPERTY_FLAG in schema);
|
|
566
587
|
if (!additional) {
|
|
567
588
|
return jsxRuntime.jsx("div", {
|
|
568
589
|
className: classNames,
|
|
@@ -570,10 +591,9 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
570
591
|
children: children
|
|
571
592
|
});
|
|
572
593
|
}
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
};
|
|
594
|
+
const handleBlur = ({
|
|
595
|
+
target
|
|
596
|
+
}) => onKeyChange(target.value);
|
|
577
597
|
return jsxRuntime.jsxs(react.Grid, {
|
|
578
598
|
className: classNames,
|
|
579
599
|
style: style,
|
|
@@ -583,14 +603,14 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
583
603
|
children: jsxRuntime.jsxs(react.FormControl, {
|
|
584
604
|
isRequired: required,
|
|
585
605
|
children: [jsxRuntime.jsx(react.FormLabel, {
|
|
586
|
-
htmlFor: id
|
|
587
|
-
id: id
|
|
606
|
+
htmlFor: `${id}-key`,
|
|
607
|
+
id: `${id}-key-label`,
|
|
588
608
|
children: keyLabel
|
|
589
609
|
}), jsxRuntime.jsx(react.Input, {
|
|
590
610
|
defaultValue: label,
|
|
591
611
|
disabled: disabled || readonly,
|
|
592
|
-
id: id
|
|
593
|
-
name: id
|
|
612
|
+
id: `${id}-key`,
|
|
613
|
+
name: `${id}-key`,
|
|
594
614
|
onBlur: !readonly ? handleBlur : undefined,
|
|
595
615
|
type: 'text',
|
|
596
616
|
mb: 1
|
|
@@ -606,37 +626,37 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
606
626
|
registry: registry
|
|
607
627
|
})
|
|
608
628
|
})]
|
|
609
|
-
}, id
|
|
629
|
+
}, `${id}-key`);
|
|
610
630
|
}
|
|
611
631
|
|
|
612
632
|
function generateTemplates() {
|
|
613
633
|
return {
|
|
614
|
-
ArrayFieldItemTemplate
|
|
615
|
-
ArrayFieldTemplate
|
|
616
|
-
BaseInputTemplate
|
|
634
|
+
ArrayFieldItemTemplate,
|
|
635
|
+
ArrayFieldTemplate,
|
|
636
|
+
BaseInputTemplate,
|
|
617
637
|
ButtonTemplates: {
|
|
618
|
-
CopyButton
|
|
619
|
-
AddButton
|
|
620
|
-
MoveDownButton
|
|
621
|
-
MoveUpButton
|
|
622
|
-
RemoveButton
|
|
623
|
-
SubmitButton
|
|
638
|
+
CopyButton,
|
|
639
|
+
AddButton,
|
|
640
|
+
MoveDownButton,
|
|
641
|
+
MoveUpButton,
|
|
642
|
+
RemoveButton,
|
|
643
|
+
SubmitButton
|
|
624
644
|
},
|
|
625
645
|
DescriptionFieldTemplate: DescriptionField,
|
|
626
646
|
ErrorListTemplate: ErrorList,
|
|
627
|
-
FieldErrorTemplate
|
|
628
|
-
FieldHelpTemplate
|
|
629
|
-
FieldTemplate
|
|
630
|
-
ObjectFieldTemplate
|
|
647
|
+
FieldErrorTemplate,
|
|
648
|
+
FieldHelpTemplate,
|
|
649
|
+
FieldTemplate,
|
|
650
|
+
ObjectFieldTemplate,
|
|
631
651
|
TitleFieldTemplate: TitleField,
|
|
632
|
-
WrapIfAdditionalTemplate
|
|
652
|
+
WrapIfAdditionalTemplate
|
|
633
653
|
};
|
|
634
654
|
}
|
|
635
655
|
var Templates = /*#__PURE__*/generateTemplates();
|
|
636
656
|
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
for (
|
|
657
|
+
const rangeOptions = (start, stop) => {
|
|
658
|
+
const options = [];
|
|
659
|
+
for (let i = start; i <= stop; i++) {
|
|
640
660
|
options.push({
|
|
641
661
|
value: i,
|
|
642
662
|
label: utils.pad(i, 2)
|
|
@@ -645,14 +665,15 @@ var rangeOptions = function rangeOptions(start, stop) {
|
|
|
645
665
|
return options;
|
|
646
666
|
};
|
|
647
667
|
function DateElement(props) {
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
668
|
+
const {
|
|
669
|
+
SelectWidget
|
|
670
|
+
} = props.registry.widgets;
|
|
671
|
+
const value = props.value ? props.value : undefined;
|
|
672
|
+
return jsxRuntime.jsx(SelectWidget, {
|
|
673
|
+
...props,
|
|
651
674
|
label: '',
|
|
652
675
|
className: 'form-control',
|
|
653
|
-
onChange:
|
|
654
|
-
return props.select(props.type, elemValue);
|
|
655
|
-
},
|
|
676
|
+
onChange: elemValue => props.select(props.type, elemValue),
|
|
656
677
|
options: {
|
|
657
678
|
enumOptions: rangeOptions(props.range[0], props.range[1])
|
|
658
679
|
},
|
|
@@ -662,64 +683,68 @@ function DateElement(props) {
|
|
|
662
683
|
},
|
|
663
684
|
value: value,
|
|
664
685
|
"aria-describedby": utils.ariaDescribedByIds(props.name)
|
|
665
|
-
}));
|
|
666
|
-
}
|
|
667
|
-
var readyForChange = function readyForChange(state) {
|
|
668
|
-
return Object.keys(state).every(function (key) {
|
|
669
|
-
return typeof state[key] !== 'undefined' && state[key] !== -1;
|
|
670
686
|
});
|
|
687
|
+
}
|
|
688
|
+
const readyForChange = state => {
|
|
689
|
+
return Object.keys(state).every(key => typeof state[key] !== 'undefined' && state[key] !== -1);
|
|
671
690
|
};
|
|
672
691
|
function AltDateWidget(props) {
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
692
|
+
const {
|
|
693
|
+
autofocus,
|
|
694
|
+
disabled,
|
|
695
|
+
id,
|
|
696
|
+
onBlur,
|
|
697
|
+
onChange,
|
|
698
|
+
onFocus,
|
|
699
|
+
options,
|
|
700
|
+
readonly,
|
|
701
|
+
registry,
|
|
702
|
+
showTime,
|
|
703
|
+
value
|
|
704
|
+
} = props;
|
|
705
|
+
const {
|
|
706
|
+
translateString
|
|
707
|
+
} = registry;
|
|
708
|
+
const [state, setState] = react$1.useState(utils.parseDateString(value, showTime));
|
|
709
|
+
react$1.useEffect(() => {
|
|
689
710
|
setState(utils.parseDateString(value, showTime));
|
|
690
711
|
}, [showTime, value]);
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
712
|
+
const handleChange = (property, nextValue) => {
|
|
713
|
+
const nextState = {
|
|
714
|
+
...state,
|
|
715
|
+
[property]: typeof nextValue === 'undefined' ? -1 : nextValue
|
|
716
|
+
};
|
|
694
717
|
if (readyForChange(nextState)) {
|
|
695
718
|
onChange(utils.toDateString(nextState, showTime));
|
|
696
719
|
} else {
|
|
697
720
|
setState(nextState);
|
|
698
721
|
}
|
|
699
722
|
};
|
|
700
|
-
|
|
723
|
+
const handleNow = event => {
|
|
701
724
|
event.preventDefault();
|
|
702
725
|
if (disabled || readonly) {
|
|
703
726
|
return;
|
|
704
727
|
}
|
|
705
|
-
|
|
728
|
+
const nextState = utils.parseDateString(new Date().toJSON(), showTime);
|
|
706
729
|
onChange(utils.toDateString(nextState, showTime));
|
|
707
730
|
};
|
|
708
|
-
|
|
731
|
+
const handleClear = event => {
|
|
709
732
|
event.preventDefault();
|
|
710
733
|
if (disabled || readonly) {
|
|
711
734
|
return;
|
|
712
735
|
}
|
|
713
736
|
onChange(undefined);
|
|
714
737
|
};
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
738
|
+
const dateElementProps = () => {
|
|
739
|
+
const {
|
|
740
|
+
year,
|
|
741
|
+
month,
|
|
742
|
+
day,
|
|
743
|
+
hour,
|
|
744
|
+
minute,
|
|
745
|
+
second
|
|
746
|
+
} = state;
|
|
747
|
+
const data = [{
|
|
723
748
|
type: 'year',
|
|
724
749
|
range: options.yearsRange,
|
|
725
750
|
value: year
|
|
@@ -754,12 +779,14 @@ function AltDateWidget(props) {
|
|
|
754
779
|
display: 'flex',
|
|
755
780
|
flexWrap: 'wrap',
|
|
756
781
|
alignItems: 'center',
|
|
757
|
-
children: dateElementProps().map(
|
|
758
|
-
|
|
782
|
+
children: dateElementProps().map((elemProps, i) => {
|
|
783
|
+
const elemId = id + '_' + elemProps.type;
|
|
759
784
|
return jsxRuntime.jsx(react.Box, {
|
|
760
785
|
mr: '2',
|
|
761
786
|
mb: '2',
|
|
762
|
-
children: jsxRuntime.jsx(DateElement,
|
|
787
|
+
children: jsxRuntime.jsx(DateElement, {
|
|
788
|
+
...props,
|
|
789
|
+
...elemProps,
|
|
763
790
|
autofocus: autofocus && i === 0,
|
|
764
791
|
disabled: disabled,
|
|
765
792
|
id: elemId,
|
|
@@ -770,21 +797,17 @@ function AltDateWidget(props) {
|
|
|
770
797
|
registry: registry,
|
|
771
798
|
select: handleChange,
|
|
772
799
|
value: elemProps.value < 0 ? '' : elemProps.value
|
|
773
|
-
})
|
|
800
|
+
})
|
|
774
801
|
}, elemId);
|
|
775
802
|
})
|
|
776
803
|
}), jsxRuntime.jsxs(react.Box, {
|
|
777
804
|
display: 'flex',
|
|
778
805
|
children: [!options.hideNowButton && jsxRuntime.jsx(react.Button, {
|
|
779
|
-
onClick:
|
|
780
|
-
return handleNow(e);
|
|
781
|
-
},
|
|
806
|
+
onClick: e => handleNow(e),
|
|
782
807
|
mr: '2',
|
|
783
808
|
children: translateString(utils.TranslatableString.NowLabel)
|
|
784
809
|
}), !options.hideClearButton && jsxRuntime.jsx(react.Button, {
|
|
785
|
-
onClick:
|
|
786
|
-
return handleClear(e);
|
|
787
|
-
},
|
|
810
|
+
onClick: e => handleClear(e),
|
|
788
811
|
children: translateString(utils.TranslatableString.ClearLabel)
|
|
789
812
|
})]
|
|
790
813
|
})]
|
|
@@ -801,53 +824,62 @@ AltDateWidget.defaultProps = {
|
|
|
801
824
|
};
|
|
802
825
|
|
|
803
826
|
function AltDateTimeWidget(props) {
|
|
804
|
-
|
|
805
|
-
|
|
827
|
+
const {
|
|
828
|
+
AltDateWidget
|
|
829
|
+
} = props.registry.widgets;
|
|
830
|
+
return jsxRuntime.jsx(AltDateWidget, {
|
|
831
|
+
...props,
|
|
806
832
|
showTime: true
|
|
807
|
-
})
|
|
833
|
+
});
|
|
808
834
|
}
|
|
809
|
-
AltDateTimeWidget.defaultProps =
|
|
835
|
+
AltDateTimeWidget.defaultProps = {
|
|
836
|
+
...AltDateWidget.defaultProps,
|
|
810
837
|
showTime: true
|
|
811
|
-
}
|
|
838
|
+
};
|
|
812
839
|
|
|
813
840
|
function CheckboxWidget(props) {
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
841
|
+
const {
|
|
842
|
+
id,
|
|
843
|
+
value,
|
|
844
|
+
disabled,
|
|
845
|
+
readonly,
|
|
846
|
+
onChange,
|
|
847
|
+
onBlur,
|
|
848
|
+
onFocus,
|
|
849
|
+
label,
|
|
850
|
+
hideLabel,
|
|
851
|
+
registry,
|
|
852
|
+
options,
|
|
853
|
+
uiSchema,
|
|
854
|
+
schema
|
|
855
|
+
} = props;
|
|
856
|
+
const chakraProps = getChakra({
|
|
857
|
+
uiSchema
|
|
829
858
|
});
|
|
830
859
|
// Because an unchecked checkbox will cause html5 validation to fail, only add
|
|
831
860
|
// the "required" attribute if the field value must be "true", due to the
|
|
832
861
|
// "const" or "enum" keywords
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
}
|
|
862
|
+
const required = utils.schemaRequiresTrueValue(schema);
|
|
863
|
+
const DescriptionFieldTemplate = utils.getTemplate('DescriptionFieldTemplate', registry, options);
|
|
864
|
+
const description = options.description || schema.description;
|
|
865
|
+
const _onChange = ({
|
|
866
|
+
target: {
|
|
867
|
+
checked
|
|
868
|
+
}
|
|
869
|
+
}) => onChange(checked);
|
|
870
|
+
const _onBlur = ({
|
|
871
|
+
target: {
|
|
872
|
+
value
|
|
873
|
+
}
|
|
874
|
+
}) => onBlur(id, value);
|
|
875
|
+
const _onFocus = ({
|
|
876
|
+
target: {
|
|
877
|
+
value
|
|
878
|
+
}
|
|
879
|
+
}) => onFocus(id, value);
|
|
880
|
+
return jsxRuntime.jsxs(react.FormControl, {
|
|
881
|
+
mb: 1,
|
|
882
|
+
...chakraProps,
|
|
851
883
|
isRequired: required,
|
|
852
884
|
children: [!hideLabel && !!description && jsxRuntime.jsx(DescriptionFieldTemplate, {
|
|
853
885
|
id: utils.descriptionId(id),
|
|
@@ -868,63 +900,66 @@ function CheckboxWidget(props) {
|
|
|
868
900
|
children: label
|
|
869
901
|
}), hideLabel || !label)
|
|
870
902
|
})]
|
|
871
|
-
})
|
|
903
|
+
});
|
|
872
904
|
}
|
|
873
905
|
|
|
874
906
|
function CheckboxesWidget(props) {
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
rawErrors =
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
907
|
+
const {
|
|
908
|
+
id,
|
|
909
|
+
disabled,
|
|
910
|
+
options,
|
|
911
|
+
value,
|
|
912
|
+
readonly,
|
|
913
|
+
onChange,
|
|
914
|
+
onBlur,
|
|
915
|
+
onFocus,
|
|
916
|
+
required,
|
|
917
|
+
label,
|
|
918
|
+
hideLabel,
|
|
919
|
+
uiSchema,
|
|
920
|
+
rawErrors = []
|
|
921
|
+
} = props;
|
|
922
|
+
const {
|
|
923
|
+
enumOptions,
|
|
924
|
+
enumDisabled,
|
|
925
|
+
emptyValue
|
|
926
|
+
} = options;
|
|
927
|
+
const chakraProps = getChakra({
|
|
928
|
+
uiSchema
|
|
894
929
|
});
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
930
|
+
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
931
|
+
const _onBlur = ({
|
|
932
|
+
target: {
|
|
933
|
+
value
|
|
934
|
+
}
|
|
935
|
+
}) => onBlur(id, utils.enumOptionsValueForIndex(value, enumOptions, emptyValue));
|
|
936
|
+
const _onFocus = ({
|
|
937
|
+
target: {
|
|
938
|
+
value
|
|
939
|
+
}
|
|
940
|
+
}) => onFocus(id, utils.enumOptionsValueForIndex(value, enumOptions, emptyValue));
|
|
941
|
+
const row = options ? options.inline : false;
|
|
942
|
+
const selectedIndexes = utils.enumOptionsIndexForValue(value, enumOptions, true);
|
|
943
|
+
return jsxRuntime.jsxs(react.FormControl, {
|
|
944
|
+
mb: 1,
|
|
945
|
+
...chakraProps,
|
|
909
946
|
isDisabled: disabled || readonly,
|
|
910
947
|
isRequired: required,
|
|
911
948
|
isReadOnly: readonly,
|
|
912
949
|
isInvalid: rawErrors && rawErrors.length > 0,
|
|
913
950
|
children: [utils.labelValue(jsxRuntime.jsx(react.FormLabel, {
|
|
914
951
|
htmlFor: id,
|
|
915
|
-
id: id
|
|
952
|
+
id: `${id}-label`,
|
|
916
953
|
children: label
|
|
917
954
|
}), hideLabel || !label), jsxRuntime.jsx(react.CheckboxGroup, {
|
|
918
|
-
onChange:
|
|
919
|
-
return _onChange(utils.enumOptionsValueForIndex(option, enumOptions, emptyValue));
|
|
920
|
-
},
|
|
955
|
+
onChange: option => onChange(utils.enumOptionsValueForIndex(option, enumOptions, emptyValue)),
|
|
921
956
|
defaultValue: selectedIndexes,
|
|
922
957
|
"aria-describedby": utils.ariaDescribedByIds(id),
|
|
923
958
|
children: jsxRuntime.jsx(react.Stack, {
|
|
924
959
|
direction: row ? 'row' : 'column',
|
|
925
|
-
children: Array.isArray(enumOptions) && enumOptions.map(
|
|
926
|
-
|
|
927
|
-
|
|
960
|
+
children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
961
|
+
const checked = utils.enumOptionsIsSelected(option.value, checkboxesValues);
|
|
962
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
928
963
|
return jsxRuntime.jsx(react.Checkbox, {
|
|
929
964
|
id: utils.optionId(id, index),
|
|
930
965
|
name: id,
|
|
@@ -940,51 +975,53 @@ function CheckboxesWidget(props) {
|
|
|
940
975
|
})
|
|
941
976
|
})
|
|
942
977
|
})]
|
|
943
|
-
})
|
|
978
|
+
});
|
|
944
979
|
}
|
|
945
980
|
|
|
946
|
-
function RadioWidget(
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
981
|
+
function RadioWidget({
|
|
982
|
+
id,
|
|
983
|
+
options,
|
|
984
|
+
value,
|
|
985
|
+
required,
|
|
986
|
+
disabled,
|
|
987
|
+
readonly,
|
|
988
|
+
label,
|
|
989
|
+
hideLabel,
|
|
990
|
+
onChange,
|
|
991
|
+
onBlur,
|
|
992
|
+
onFocus,
|
|
993
|
+
uiSchema
|
|
994
|
+
}) {
|
|
995
|
+
const {
|
|
996
|
+
enumOptions,
|
|
997
|
+
enumDisabled,
|
|
998
|
+
emptyValue
|
|
999
|
+
} = options;
|
|
1000
|
+
const chakraProps = getChakra({
|
|
1001
|
+
uiSchema
|
|
965
1002
|
});
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
};
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
return jsxRuntime.jsxs(react.FormControl,
|
|
980
|
-
mb: 1
|
|
981
|
-
|
|
1003
|
+
const _onChange = nextValue => onChange(utils.enumOptionsValueForIndex(nextValue, enumOptions, emptyValue));
|
|
1004
|
+
const _onBlur = ({
|
|
1005
|
+
target: {
|
|
1006
|
+
value
|
|
1007
|
+
}
|
|
1008
|
+
}) => onBlur(id, utils.enumOptionsValueForIndex(value, enumOptions, emptyValue));
|
|
1009
|
+
const _onFocus = ({
|
|
1010
|
+
target: {
|
|
1011
|
+
value
|
|
1012
|
+
}
|
|
1013
|
+
}) => onFocus(id, utils.enumOptionsValueForIndex(value, enumOptions, emptyValue));
|
|
1014
|
+
const row = options ? options.inline : false;
|
|
1015
|
+
const selectedIndex = utils.enumOptionsIndexForValue(value, enumOptions) ?? null;
|
|
1016
|
+
return jsxRuntime.jsxs(react.FormControl, {
|
|
1017
|
+
mb: 1,
|
|
1018
|
+
...chakraProps,
|
|
982
1019
|
isDisabled: disabled || readonly,
|
|
983
1020
|
isRequired: required,
|
|
984
1021
|
isReadOnly: readonly,
|
|
985
1022
|
children: [utils.labelValue(jsxRuntime.jsx(react.FormLabel, {
|
|
986
1023
|
htmlFor: id,
|
|
987
|
-
id: id
|
|
1024
|
+
id: `${id}-label`,
|
|
988
1025
|
children: label
|
|
989
1026
|
}), hideLabel || !label), jsxRuntime.jsx(react.RadioGroup, {
|
|
990
1027
|
onChange: _onChange,
|
|
@@ -995,8 +1032,8 @@ function RadioWidget(_ref) {
|
|
|
995
1032
|
"aria-describedby": utils.ariaDescribedByIds(id),
|
|
996
1033
|
children: jsxRuntime.jsx(react.Stack, {
|
|
997
1034
|
direction: row ? 'row' : 'column',
|
|
998
|
-
children: Array.isArray(enumOptions) && enumOptions.map(
|
|
999
|
-
|
|
1035
|
+
children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
1036
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
1000
1037
|
return jsxRuntime.jsx(react.Radio, {
|
|
1001
1038
|
value: String(index),
|
|
1002
1039
|
id: utils.optionId(id, index),
|
|
@@ -1006,48 +1043,51 @@ function RadioWidget(_ref) {
|
|
|
1006
1043
|
})
|
|
1007
1044
|
})
|
|
1008
1045
|
})]
|
|
1009
|
-
})
|
|
1046
|
+
});
|
|
1010
1047
|
}
|
|
1011
1048
|
|
|
1012
|
-
function RangeWidget(
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1049
|
+
function RangeWidget({
|
|
1050
|
+
value,
|
|
1051
|
+
readonly,
|
|
1052
|
+
disabled,
|
|
1053
|
+
onBlur,
|
|
1054
|
+
onFocus,
|
|
1055
|
+
options,
|
|
1056
|
+
schema,
|
|
1057
|
+
uiSchema,
|
|
1058
|
+
onChange,
|
|
1059
|
+
label,
|
|
1060
|
+
hideLabel,
|
|
1061
|
+
id
|
|
1062
|
+
}) {
|
|
1063
|
+
const chakraProps = getChakra({
|
|
1064
|
+
uiSchema
|
|
1027
1065
|
});
|
|
1028
|
-
|
|
1029
|
-
value
|
|
1030
|
-
label
|
|
1031
|
-
id
|
|
1032
|
-
|
|
1033
|
-
var _onChange = function _onChange(value) {
|
|
1034
|
-
return onChange(value === undefined ? options.emptyValue : value);
|
|
1035
|
-
};
|
|
1036
|
-
var _onBlur = function _onBlur(_ref2) {
|
|
1037
|
-
var value = _ref2.target.value;
|
|
1038
|
-
return onBlur(id, value);
|
|
1039
|
-
};
|
|
1040
|
-
var _onFocus = function _onFocus(_ref3) {
|
|
1041
|
-
var value = _ref3.target.value;
|
|
1042
|
-
return onFocus(id, value);
|
|
1066
|
+
const sliderWidgetProps = {
|
|
1067
|
+
value,
|
|
1068
|
+
label,
|
|
1069
|
+
id,
|
|
1070
|
+
...utils.rangeSpec(schema)
|
|
1043
1071
|
};
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1072
|
+
const _onChange = value => onChange(value === undefined ? options.emptyValue : value);
|
|
1073
|
+
const _onBlur = ({
|
|
1074
|
+
target: {
|
|
1075
|
+
value
|
|
1076
|
+
}
|
|
1077
|
+
}) => onBlur(id, value);
|
|
1078
|
+
const _onFocus = ({
|
|
1079
|
+
target: {
|
|
1080
|
+
value
|
|
1081
|
+
}
|
|
1082
|
+
}) => onFocus(id, value);
|
|
1083
|
+
return jsxRuntime.jsxs(react.FormControl, {
|
|
1084
|
+
mb: 1,
|
|
1085
|
+
...chakraProps,
|
|
1047
1086
|
children: [utils.labelValue(jsxRuntime.jsx(react.FormLabel, {
|
|
1048
1087
|
htmlFor: id,
|
|
1049
1088
|
children: label
|
|
1050
|
-
}), hideLabel || !label), jsxRuntime.jsxs(react.Slider,
|
|
1089
|
+
}), hideLabel || !label), jsxRuntime.jsxs(react.Slider, {
|
|
1090
|
+
...sliderWidgetProps,
|
|
1051
1091
|
id: id,
|
|
1052
1092
|
name: id,
|
|
1053
1093
|
isDisabled: disabled || readonly,
|
|
@@ -1058,82 +1098,89 @@ function RangeWidget(_ref) {
|
|
|
1058
1098
|
children: [jsxRuntime.jsx(react.SliderTrack, {
|
|
1059
1099
|
children: jsxRuntime.jsx(react.SliderFilledTrack, {})
|
|
1060
1100
|
}), jsxRuntime.jsx(react.SliderThumb, {})]
|
|
1061
|
-
})
|
|
1062
|
-
})
|
|
1101
|
+
})]
|
|
1102
|
+
});
|
|
1063
1103
|
}
|
|
1064
1104
|
|
|
1065
1105
|
function SelectWidget(props) {
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
rawErrors =
|
|
1082
|
-
uiSchema
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1106
|
+
const {
|
|
1107
|
+
id,
|
|
1108
|
+
options,
|
|
1109
|
+
label,
|
|
1110
|
+
hideLabel,
|
|
1111
|
+
placeholder,
|
|
1112
|
+
multiple,
|
|
1113
|
+
required,
|
|
1114
|
+
disabled,
|
|
1115
|
+
readonly,
|
|
1116
|
+
value,
|
|
1117
|
+
autofocus,
|
|
1118
|
+
onChange,
|
|
1119
|
+
onBlur,
|
|
1120
|
+
onFocus,
|
|
1121
|
+
rawErrors = [],
|
|
1122
|
+
uiSchema
|
|
1123
|
+
} = props;
|
|
1124
|
+
const {
|
|
1125
|
+
enumOptions,
|
|
1126
|
+
enumDisabled,
|
|
1127
|
+
emptyValue
|
|
1128
|
+
} = options;
|
|
1129
|
+
const chakraProps = getChakra({
|
|
1130
|
+
uiSchema
|
|
1088
1131
|
});
|
|
1089
|
-
|
|
1090
|
-
return onChange(utils.enumOptionsValueForIndex(e.map(
|
|
1132
|
+
const _onMultiChange = e => {
|
|
1133
|
+
return onChange(utils.enumOptionsValueForIndex(e.map(v => {
|
|
1091
1134
|
return v.value;
|
|
1092
1135
|
}), enumOptions, emptyValue));
|
|
1093
1136
|
};
|
|
1094
|
-
|
|
1137
|
+
const _onChange = e => {
|
|
1095
1138
|
return onChange(utils.enumOptionsValueForIndex(e.value, enumOptions, emptyValue));
|
|
1096
1139
|
};
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1140
|
+
const _onBlur = ({
|
|
1141
|
+
target: {
|
|
1142
|
+
value
|
|
1143
|
+
}
|
|
1144
|
+
}) => onBlur(id, utils.enumOptionsValueForIndex(value, enumOptions, emptyValue));
|
|
1145
|
+
const _onFocus = ({
|
|
1146
|
+
target: {
|
|
1147
|
+
value
|
|
1148
|
+
}
|
|
1149
|
+
}) => onFocus(id, utils.enumOptionsValueForIndex(value, enumOptions, emptyValue));
|
|
1150
|
+
const _valueLabelMap = {};
|
|
1151
|
+
const displayEnumOptions = Array.isArray(enumOptions) ? enumOptions.map((option, index) => {
|
|
1152
|
+
const {
|
|
1153
|
+
value,
|
|
1154
|
+
label
|
|
1155
|
+
} = option;
|
|
1109
1156
|
_valueLabelMap[index] = label || String(value);
|
|
1110
1157
|
return {
|
|
1111
|
-
label
|
|
1158
|
+
label,
|
|
1112
1159
|
value: String(index),
|
|
1113
1160
|
isDisabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1
|
|
1114
1161
|
};
|
|
1115
1162
|
}) : [];
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1163
|
+
const isMultiple = typeof multiple !== 'undefined' && Boolean(enumOptions);
|
|
1164
|
+
const selectedIndex = utils.enumOptionsIndexForValue(value, enumOptions, isMultiple);
|
|
1165
|
+
const formValue = isMultiple ? (selectedIndex || []).map(i => {
|
|
1119
1166
|
return {
|
|
1120
1167
|
label: _valueLabelMap[i],
|
|
1121
1168
|
value: i
|
|
1122
1169
|
};
|
|
1123
1170
|
}) : {
|
|
1124
1171
|
label: _valueLabelMap[selectedIndex] || '',
|
|
1125
|
-
selectedIndex
|
|
1172
|
+
selectedIndex
|
|
1126
1173
|
};
|
|
1127
|
-
return jsxRuntime.jsxs(react.FormControl,
|
|
1128
|
-
mb: 1
|
|
1129
|
-
|
|
1174
|
+
return jsxRuntime.jsxs(react.FormControl, {
|
|
1175
|
+
mb: 1,
|
|
1176
|
+
...chakraProps,
|
|
1130
1177
|
isDisabled: disabled || readonly,
|
|
1131
1178
|
isRequired: required,
|
|
1132
1179
|
isReadOnly: readonly,
|
|
1133
1180
|
isInvalid: rawErrors && rawErrors.length > 0,
|
|
1134
1181
|
children: [utils.labelValue(jsxRuntime.jsx(react.FormLabel, {
|
|
1135
1182
|
htmlFor: id,
|
|
1136
|
-
id: id
|
|
1183
|
+
id: `${id}-label`,
|
|
1137
1184
|
children: label
|
|
1138
1185
|
}), hideLabel || !label), jsxRuntime.jsx(chakraReactSelect.Select, {
|
|
1139
1186
|
inputId: id,
|
|
@@ -1149,43 +1196,47 @@ function SelectWidget(props) {
|
|
|
1149
1196
|
value: formValue,
|
|
1150
1197
|
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
1151
1198
|
})]
|
|
1152
|
-
})
|
|
1199
|
+
});
|
|
1153
1200
|
}
|
|
1154
1201
|
|
|
1155
|
-
function TextareaWidget(
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1202
|
+
function TextareaWidget({
|
|
1203
|
+
id,
|
|
1204
|
+
placeholder,
|
|
1205
|
+
value,
|
|
1206
|
+
label,
|
|
1207
|
+
hideLabel,
|
|
1208
|
+
disabled,
|
|
1209
|
+
autofocus,
|
|
1210
|
+
readonly,
|
|
1211
|
+
onBlur,
|
|
1212
|
+
onFocus,
|
|
1213
|
+
onChange,
|
|
1214
|
+
options,
|
|
1215
|
+
uiSchema,
|
|
1216
|
+
required,
|
|
1217
|
+
rawErrors
|
|
1218
|
+
}) {
|
|
1219
|
+
const chakraProps = getChakra({
|
|
1220
|
+
uiSchema
|
|
1173
1221
|
});
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
}
|
|
1222
|
+
const _onChange = ({
|
|
1223
|
+
target: {
|
|
1224
|
+
value
|
|
1225
|
+
}
|
|
1226
|
+
}) => onChange(value === '' ? options.emptyValue : value);
|
|
1227
|
+
const _onBlur = ({
|
|
1228
|
+
target: {
|
|
1229
|
+
value
|
|
1230
|
+
}
|
|
1231
|
+
}) => onBlur(id, value);
|
|
1232
|
+
const _onFocus = ({
|
|
1233
|
+
target: {
|
|
1234
|
+
value
|
|
1235
|
+
}
|
|
1236
|
+
}) => onFocus(id, value);
|
|
1237
|
+
return jsxRuntime.jsxs(react.FormControl, {
|
|
1238
|
+
mb: 1,
|
|
1239
|
+
...chakraProps,
|
|
1189
1240
|
isDisabled: disabled || readonly,
|
|
1190
1241
|
isRequired: required,
|
|
1191
1242
|
isReadOnly: readonly,
|
|
@@ -1196,7 +1247,7 @@ function TextareaWidget(_ref) {
|
|
|
1196
1247
|
}), hideLabel || !label), jsxRuntime.jsx(react.Textarea, {
|
|
1197
1248
|
id: id,
|
|
1198
1249
|
name: id,
|
|
1199
|
-
value: value
|
|
1250
|
+
value: value ?? '',
|
|
1200
1251
|
placeholder: placeholder,
|
|
1201
1252
|
autoFocus: autofocus,
|
|
1202
1253
|
onChange: _onChange,
|
|
@@ -1204,39 +1255,41 @@ function TextareaWidget(_ref) {
|
|
|
1204
1255
|
onFocus: _onFocus,
|
|
1205
1256
|
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
1206
1257
|
})]
|
|
1207
|
-
})
|
|
1258
|
+
});
|
|
1208
1259
|
}
|
|
1209
1260
|
|
|
1210
1261
|
function UpDownWidget(props) {
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1262
|
+
const {
|
|
1263
|
+
id,
|
|
1264
|
+
uiSchema,
|
|
1265
|
+
readonly,
|
|
1266
|
+
disabled,
|
|
1267
|
+
label,
|
|
1268
|
+
hideLabel,
|
|
1269
|
+
value,
|
|
1270
|
+
onChange,
|
|
1271
|
+
onBlur,
|
|
1272
|
+
onFocus,
|
|
1273
|
+
rawErrors,
|
|
1274
|
+
required
|
|
1275
|
+
} = props;
|
|
1276
|
+
const chakraProps = getChakra({
|
|
1277
|
+
uiSchema
|
|
1225
1278
|
});
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
};
|
|
1237
|
-
return jsxRuntime.jsxs(react.FormControl,
|
|
1238
|
-
mb: 1
|
|
1239
|
-
|
|
1279
|
+
const _onChange = value => onChange(value);
|
|
1280
|
+
const _onBlur = ({
|
|
1281
|
+
target: {
|
|
1282
|
+
value
|
|
1283
|
+
}
|
|
1284
|
+
}) => onBlur(id, value);
|
|
1285
|
+
const _onFocus = ({
|
|
1286
|
+
target: {
|
|
1287
|
+
value
|
|
1288
|
+
}
|
|
1289
|
+
}) => onFocus(id, value);
|
|
1290
|
+
return jsxRuntime.jsxs(react.FormControl, {
|
|
1291
|
+
mb: 1,
|
|
1292
|
+
...chakraProps,
|
|
1240
1293
|
isDisabled: disabled || readonly,
|
|
1241
1294
|
isRequired: required,
|
|
1242
1295
|
isReadOnly: readonly,
|
|
@@ -1245,7 +1298,7 @@ function UpDownWidget(props) {
|
|
|
1245
1298
|
htmlFor: id,
|
|
1246
1299
|
children: label
|
|
1247
1300
|
}), hideLabel || !label), jsxRuntime.jsxs(react.NumberInput, {
|
|
1248
|
-
value: value
|
|
1301
|
+
value: value ?? '',
|
|
1249
1302
|
onChange: _onChange,
|
|
1250
1303
|
onBlur: _onBlur,
|
|
1251
1304
|
onFocus: _onFocus,
|
|
@@ -1257,20 +1310,20 @@ function UpDownWidget(props) {
|
|
|
1257
1310
|
children: [jsxRuntime.jsx(react.NumberIncrementStepper, {}), jsxRuntime.jsx(react.NumberDecrementStepper, {})]
|
|
1258
1311
|
})]
|
|
1259
1312
|
})]
|
|
1260
|
-
})
|
|
1313
|
+
});
|
|
1261
1314
|
}
|
|
1262
1315
|
|
|
1263
1316
|
function generateWidgets() {
|
|
1264
1317
|
return {
|
|
1265
|
-
AltDateTimeWidget
|
|
1266
|
-
AltDateWidget
|
|
1267
|
-
CheckboxWidget
|
|
1268
|
-
CheckboxesWidget
|
|
1269
|
-
RadioWidget
|
|
1270
|
-
RangeWidget
|
|
1271
|
-
SelectWidget
|
|
1272
|
-
TextareaWidget
|
|
1273
|
-
UpDownWidget
|
|
1318
|
+
AltDateTimeWidget,
|
|
1319
|
+
AltDateWidget,
|
|
1320
|
+
CheckboxWidget,
|
|
1321
|
+
CheckboxesWidget,
|
|
1322
|
+
RadioWidget,
|
|
1323
|
+
RangeWidget,
|
|
1324
|
+
SelectWidget,
|
|
1325
|
+
TextareaWidget,
|
|
1326
|
+
UpDownWidget
|
|
1274
1327
|
};
|
|
1275
1328
|
}
|
|
1276
1329
|
var Widgets = /*#__PURE__*/generateWidgets();
|
|
@@ -1309,11 +1362,249 @@ var Form = /*#__PURE__*/generateForm();
|
|
|
1309
1362
|
|
|
1310
1363
|
It is located at the bottom of the styles string.
|
|
1311
1364
|
*/
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1365
|
+
const CSSReset = () => jsxRuntime.jsx(react$2.Global, {
|
|
1366
|
+
styles: `
|
|
1367
|
+
html {
|
|
1368
|
+
line-height: 1.5;
|
|
1369
|
+
-webkit-text-size-adjust: 100%;
|
|
1370
|
+
font-family: system-ui, sans-serif;
|
|
1371
|
+
-webkit-font-smoothing: antialiased;
|
|
1372
|
+
text-rendering: optimizeLegibility;
|
|
1373
|
+
-moz-osx-font-smoothing: grayscale;
|
|
1374
|
+
touch-action: manipulation;
|
|
1375
|
+
}
|
|
1376
|
+
body {
|
|
1377
|
+
position: relative;
|
|
1378
|
+
min-height: 100%;
|
|
1379
|
+
font-feature-settings: 'kern';
|
|
1380
|
+
}
|
|
1381
|
+
*,
|
|
1382
|
+
*::before,
|
|
1383
|
+
*::after {
|
|
1384
|
+
border-width: 0;
|
|
1385
|
+
border-style: solid;
|
|
1386
|
+
box-sizing: border-box;
|
|
1387
|
+
}
|
|
1388
|
+
main {
|
|
1389
|
+
display: block;
|
|
1390
|
+
}
|
|
1391
|
+
hr {
|
|
1392
|
+
border-top-width: 1px;
|
|
1393
|
+
box-sizing: content-box;
|
|
1394
|
+
height: 0;
|
|
1395
|
+
overflow: visible;
|
|
1396
|
+
}
|
|
1397
|
+
pre,
|
|
1398
|
+
code,
|
|
1399
|
+
kbd,
|
|
1400
|
+
samp {
|
|
1401
|
+
font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
1402
|
+
font-size: 1em;
|
|
1403
|
+
}
|
|
1404
|
+
a {
|
|
1405
|
+
background-color: transparent;
|
|
1406
|
+
color: inherit;
|
|
1407
|
+
text-decoration: inherit;
|
|
1408
|
+
}
|
|
1409
|
+
abbr[title] {
|
|
1410
|
+
border-bottom: none;
|
|
1411
|
+
text-decoration: underline;
|
|
1412
|
+
-webkit-text-decoration: underline dotted;
|
|
1413
|
+
text-decoration: underline dotted;
|
|
1414
|
+
}
|
|
1415
|
+
b,
|
|
1416
|
+
strong {
|
|
1417
|
+
font-weight: bold;
|
|
1418
|
+
}
|
|
1419
|
+
small {
|
|
1420
|
+
font-size: 80%;
|
|
1421
|
+
}
|
|
1422
|
+
sub,
|
|
1423
|
+
sup {
|
|
1424
|
+
font-size: 75%;
|
|
1425
|
+
line-height: 0;
|
|
1426
|
+
position: relative;
|
|
1427
|
+
vertical-align: baseline;
|
|
1428
|
+
}
|
|
1429
|
+
sub {
|
|
1430
|
+
bottom: -0.25em;
|
|
1431
|
+
}
|
|
1432
|
+
sup {
|
|
1433
|
+
top: -0.5em;
|
|
1434
|
+
}
|
|
1435
|
+
img {
|
|
1436
|
+
border-style: none;
|
|
1437
|
+
}
|
|
1438
|
+
button,
|
|
1439
|
+
input,
|
|
1440
|
+
optgroup,
|
|
1441
|
+
select,
|
|
1442
|
+
textarea {
|
|
1443
|
+
font-family: inherit;
|
|
1444
|
+
font-size: 100%;
|
|
1445
|
+
line-height: 1.15;
|
|
1446
|
+
margin: 0;
|
|
1447
|
+
}
|
|
1448
|
+
button,
|
|
1449
|
+
input {
|
|
1450
|
+
overflow: visible;
|
|
1451
|
+
}
|
|
1452
|
+
button,
|
|
1453
|
+
select {
|
|
1454
|
+
text-transform: none;
|
|
1455
|
+
}
|
|
1456
|
+
button::-moz-focus-inner,
|
|
1457
|
+
[type="button"]::-moz-focus-inner,
|
|
1458
|
+
[type="reset"]::-moz-focus-inner,
|
|
1459
|
+
[type="submit"]::-moz-focus-inner {
|
|
1460
|
+
border-style: none;
|
|
1461
|
+
padding: 0;
|
|
1462
|
+
}
|
|
1463
|
+
fieldset {
|
|
1464
|
+
padding: 0.35em 0.75em 0.625em;
|
|
1465
|
+
}
|
|
1466
|
+
legend {
|
|
1467
|
+
box-sizing: border-box;
|
|
1468
|
+
color: inherit;
|
|
1469
|
+
display: table;
|
|
1470
|
+
max-width: 100%;
|
|
1471
|
+
padding: 0;
|
|
1472
|
+
white-space: normal;
|
|
1473
|
+
}
|
|
1474
|
+
progress {
|
|
1475
|
+
vertical-align: baseline;
|
|
1476
|
+
}
|
|
1477
|
+
textarea {
|
|
1478
|
+
overflow: auto;
|
|
1479
|
+
}
|
|
1480
|
+
[type="checkbox"],
|
|
1481
|
+
[type="radio"] {
|
|
1482
|
+
box-sizing: border-box;
|
|
1483
|
+
padding: 0;
|
|
1484
|
+
}
|
|
1485
|
+
[type="number"]::-webkit-inner-spin-button,
|
|
1486
|
+
[type="number"]::-webkit-outer-spin-button {
|
|
1487
|
+
-webkit-appearance: none !important;
|
|
1488
|
+
}
|
|
1489
|
+
input[type="number"] {
|
|
1490
|
+
-moz-appearance: textfield;
|
|
1491
|
+
}
|
|
1492
|
+
[type="search"] {
|
|
1493
|
+
-webkit-appearance: textfield;
|
|
1494
|
+
outline-offset: -2px;
|
|
1495
|
+
}
|
|
1496
|
+
[type="search"]::-webkit-search-decoration {
|
|
1497
|
+
-webkit-appearance: none !important;
|
|
1498
|
+
}
|
|
1499
|
+
::-webkit-file-upload-button {
|
|
1500
|
+
-webkit-appearance: button;
|
|
1501
|
+
font: inherit;
|
|
1502
|
+
}
|
|
1503
|
+
details {
|
|
1504
|
+
display: block;
|
|
1505
|
+
}
|
|
1506
|
+
summary {
|
|
1507
|
+
display: list-item;
|
|
1508
|
+
}
|
|
1509
|
+
template {
|
|
1510
|
+
display: none;
|
|
1511
|
+
}
|
|
1512
|
+
[hidden] {
|
|
1513
|
+
display: none !important;
|
|
1514
|
+
}
|
|
1515
|
+
body,
|
|
1516
|
+
blockquote,
|
|
1517
|
+
dl,
|
|
1518
|
+
dd,
|
|
1519
|
+
h1,
|
|
1520
|
+
h2,
|
|
1521
|
+
h3,
|
|
1522
|
+
h4,
|
|
1523
|
+
h5,
|
|
1524
|
+
h6,
|
|
1525
|
+
hr,
|
|
1526
|
+
figure,
|
|
1527
|
+
p,
|
|
1528
|
+
pre {
|
|
1529
|
+
margin: 0;
|
|
1530
|
+
}
|
|
1531
|
+
button {
|
|
1532
|
+
background: transparent;
|
|
1533
|
+
padding: 0;
|
|
1534
|
+
}
|
|
1535
|
+
fieldset {
|
|
1536
|
+
margin: 0;
|
|
1537
|
+
padding: 0;
|
|
1538
|
+
}
|
|
1539
|
+
ol,
|
|
1540
|
+
ul {
|
|
1541
|
+
margin: 0;
|
|
1542
|
+
padding: 0;
|
|
1543
|
+
}
|
|
1544
|
+
textarea {
|
|
1545
|
+
resize: vertical;
|
|
1546
|
+
}
|
|
1547
|
+
button,
|
|
1548
|
+
[role="button"] {
|
|
1549
|
+
cursor: pointer;
|
|
1550
|
+
}
|
|
1551
|
+
button::-moz-focus-inner {
|
|
1552
|
+
border: 0 !important;
|
|
1553
|
+
}
|
|
1554
|
+
table {
|
|
1555
|
+
border-collapse: collapse;
|
|
1556
|
+
}
|
|
1557
|
+
h1,
|
|
1558
|
+
h2,
|
|
1559
|
+
h3,
|
|
1560
|
+
h4,
|
|
1561
|
+
h5,
|
|
1562
|
+
h6 {
|
|
1563
|
+
font-size: inherit;
|
|
1564
|
+
font-weight: inherit;
|
|
1565
|
+
}
|
|
1566
|
+
button,
|
|
1567
|
+
input,
|
|
1568
|
+
optgroup,
|
|
1569
|
+
select,
|
|
1570
|
+
textarea {
|
|
1571
|
+
padding: 0;
|
|
1572
|
+
line-height: inherit;
|
|
1573
|
+
color: inherit;
|
|
1574
|
+
}
|
|
1575
|
+
img,
|
|
1576
|
+
svg,
|
|
1577
|
+
video,
|
|
1578
|
+
canvas,
|
|
1579
|
+
audio,
|
|
1580
|
+
iframe,
|
|
1581
|
+
embed,
|
|
1582
|
+
object {
|
|
1583
|
+
display: block;
|
|
1584
|
+
}
|
|
1585
|
+
img,
|
|
1586
|
+
video {
|
|
1587
|
+
max-width: 100%;
|
|
1588
|
+
height: auto;
|
|
1589
|
+
}
|
|
1590
|
+
[data-js-focus-visible] :focus:not([data-focus-visible-added]) {
|
|
1591
|
+
outline: none;
|
|
1592
|
+
box-shadow: none;
|
|
1593
|
+
}
|
|
1594
|
+
select::-ms-expand {
|
|
1595
|
+
display: none;
|
|
1596
|
+
}
|
|
1597
|
+
input {
|
|
1598
|
+
border-width: revert;
|
|
1599
|
+
border-color: revert;
|
|
1600
|
+
border-style: revert;
|
|
1601
|
+
}
|
|
1602
|
+
.array-item > hr {
|
|
1603
|
+
margin-top: 16px;
|
|
1604
|
+
margin-bottom: 16px;
|
|
1605
|
+
}
|
|
1606
|
+
`
|
|
1607
|
+
});
|
|
1317
1608
|
|
|
1318
1609
|
/**
|
|
1319
1610
|
* __createChakraFrameProvider is used to ensure that <Global> emotion components
|
|
@@ -1329,29 +1620,28 @@ var CSSReset = function CSSReset() {
|
|
|
1329
1620
|
* From: https://codesandbox.io/s/p98y9o7jz0?file=/src/frame-provider.js:0-650
|
|
1330
1621
|
* Also see: https://github.com/emotion-js/emotion/issues/760#issuecomment-404353706
|
|
1331
1622
|
*/
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
container
|
|
1623
|
+
const memoizedCreateCacheWithContainer = /*#__PURE__*/weakMemoize__default["default"](container => {
|
|
1624
|
+
const newCache = createCache__default["default"]({
|
|
1625
|
+
container,
|
|
1335
1626
|
key: 'rjsf'
|
|
1336
1627
|
});
|
|
1337
1628
|
return newCache;
|
|
1338
1629
|
});
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
})
|
|
1630
|
+
const __createChakraFrameProvider = props => ({
|
|
1631
|
+
document
|
|
1632
|
+
}) => {
|
|
1633
|
+
return jsxRuntime.jsx("div", {
|
|
1634
|
+
style: {
|
|
1635
|
+
margin: 2
|
|
1636
|
+
},
|
|
1637
|
+
children: jsxRuntime.jsx(react$2.CacheProvider, {
|
|
1638
|
+
value: memoizedCreateCacheWithContainer(document.head),
|
|
1639
|
+
children: jsxRuntime.jsxs(react.ChakraProvider, {
|
|
1640
|
+
resetCSS: false,
|
|
1641
|
+
children: [jsxRuntime.jsx(CSSReset, {}), props.children]
|
|
1352
1642
|
})
|
|
1353
|
-
})
|
|
1354
|
-
};
|
|
1643
|
+
})
|
|
1644
|
+
});
|
|
1355
1645
|
};
|
|
1356
1646
|
|
|
1357
1647
|
exports.Form = Form;
|