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