@rjsf/semantic-ui 6.6.1 → 6.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +201 -0
- package/dist/index.cjs +268 -241
- package/dist/index.cjs.map +4 -4
- package/dist/semantic-ui.esm.js +209 -218
- package/dist/semantic-ui.esm.js.map +4 -4
- package/dist/semantic-ui.umd.js +117 -96
- package/lib/AddButton/AddButton.d.ts +3 -3
- package/lib/AddButton/AddButton.js.map +1 -1
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +2 -2
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +1 -1
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +2 -2
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
- package/lib/BaseInputTemplate/BaseInputTemplate.d.ts +2 -2
- package/lib/BaseInputTemplate/BaseInputTemplate.js +6 -6
- package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
- package/lib/CheckboxWidget/CheckboxWidget.d.ts +2 -2
- package/lib/CheckboxWidget/CheckboxWidget.js +7 -7
- package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.d.ts +2 -2
- package/lib/CheckboxesWidget/CheckboxesWidget.js +6 -6
- package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
- package/lib/CyclicSchemaExpandTemplate/CyclicSchemaExpandTemplate.d.ts +6 -0
- package/lib/CyclicSchemaExpandTemplate/CyclicSchemaExpandTemplate.js +14 -0
- package/lib/CyclicSchemaExpandTemplate/CyclicSchemaExpandTemplate.js.map +1 -0
- package/lib/CyclicSchemaExpandTemplate/index.d.ts +2 -0
- package/lib/CyclicSchemaExpandTemplate/index.js +3 -0
- package/lib/CyclicSchemaExpandTemplate/index.js.map +1 -0
- package/lib/DescriptionField/DescriptionField.d.ts +2 -2
- package/lib/ErrorList/ErrorList.d.ts +2 -2
- package/lib/ErrorList/ErrorList.js.map +1 -1
- package/lib/FieldErrorTemplate/FieldErrorTemplate.d.ts +2 -2
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -1
- package/lib/FieldHelpTemplate/FieldHelpTemplate.d.ts +2 -2
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -1
- package/lib/FieldTemplate/FieldTemplate.d.ts +2 -2
- package/lib/FieldTemplate/FieldTemplate.js +1 -1
- package/lib/FieldTemplate/FieldTemplate.js.map +1 -1
- package/lib/GridTemplate/GridTemplate.d.ts +2 -2
- package/lib/IconButton/IconButton.d.ts +15 -8
- package/lib/IconButton/IconButton.js +14 -6
- package/lib/IconButton/IconButton.js.map +1 -1
- package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.d.ts +2 -2
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +2 -2
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +1 -1
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.d.ts +2 -2
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js +1 -1
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js.map +1 -1
- package/lib/RadioWidget/RadioWidget.d.ts +2 -2
- package/lib/RadioWidget/RadioWidget.js +5 -7
- package/lib/RadioWidget/RadioWidget.js.map +1 -1
- package/lib/RangeWidget/RangeWidget.d.ts +2 -2
- package/lib/RangeWidget/RangeWidget.js +5 -5
- package/lib/RangeWidget/RangeWidget.js.map +1 -1
- package/lib/SelectWidget/SelectWidget.d.ts +2 -2
- package/lib/SelectWidget/SelectWidget.js +8 -8
- package/lib/SelectWidget/SelectWidget.js.map +1 -1
- package/lib/SemanticUIForm/SemanticUIForm.d.ts +3 -3
- package/lib/SemanticUIForm/SemanticUIForm.js.map +1 -1
- package/lib/SubmitButton/SubmitButton.d.ts +2 -2
- package/lib/SubmitButton/SubmitButton.js.map +1 -1
- package/lib/Templates/Templates.d.ts +1 -1
- package/lib/Templates/Templates.js +2 -0
- package/lib/Templates/Templates.js.map +1 -1
- package/lib/TextareaWidget/TextareaWidget.d.ts +2 -2
- package/lib/TextareaWidget/TextareaWidget.js +6 -6
- package/lib/TextareaWidget/TextareaWidget.js.map +1 -1
- package/lib/Theme/Theme.d.ts +2 -2
- package/lib/TitleField/TitleField.d.ts +2 -2
- package/lib/Widgets/Widgets.d.ts +1 -1
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.d.ts +2 -2
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +2 -2
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/util.d.ts +7 -7
- package/lib/util.js +13 -6
- package/lib/util.js.map +1 -1
- package/package.json +25 -23
- package/src/AddButton/AddButton.tsx +5 -3
- package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +2 -8
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +2 -10
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +13 -20
- package/src/CheckboxWidget/CheckboxWidget.tsx +13 -21
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +11 -14
- package/src/CyclicSchemaExpandTemplate/CyclicSchemaExpandTemplate.tsx +25 -0
- package/src/CyclicSchemaExpandTemplate/index.ts +2 -0
- package/src/DescriptionField/DescriptionField.tsx +1 -1
- package/src/ErrorList/ErrorList.tsx +3 -1
- package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +2 -1
- package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +2 -1
- package/src/FieldTemplate/FieldTemplate.tsx +2 -8
- package/src/GridTemplate/GridTemplate.tsx +1 -1
- package/src/IconButton/IconButton.tsx +18 -8
- package/src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx +1 -1
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +2 -12
- package/src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx +3 -2
- package/src/RadioWidget/RadioWidget.tsx +13 -16
- package/src/RangeWidget/RangeWidget.tsx +11 -10
- package/src/SelectWidget/SelectWidget.tsx +45 -37
- package/src/SemanticUIForm/SemanticUIForm.ts +4 -3
- package/src/SubmitButton/SubmitButton.tsx +2 -1
- package/src/Templates/Templates.ts +3 -1
- package/src/TextareaWidget/TextareaWidget.tsx +11 -17
- package/src/Theme/Theme.ts +2 -2
- package/src/TitleField/TitleField.tsx +1 -1
- package/src/Widgets/Widgets.tsx +1 -1
- package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +6 -13
- package/src/util.tsx +20 -21
package/dist/semantic-ui.esm.js
CHANGED
|
@@ -29,16 +29,11 @@ function AddButton({
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
// src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx
|
|
32
|
-
import {
|
|
33
|
-
getUiOptions as getUiOptions2,
|
|
34
|
-
getTemplate
|
|
35
|
-
} from "@rjsf/utils";
|
|
32
|
+
import { getUiOptions as getUiOptions2, getTemplate } from "@rjsf/utils";
|
|
36
33
|
import { Button as Button2, Grid, Segment } from "semantic-ui-react";
|
|
37
34
|
|
|
38
35
|
// src/util.tsx
|
|
39
|
-
import {
|
|
40
|
-
getUiOptions
|
|
41
|
-
} from "@rjsf/utils";
|
|
36
|
+
import { getUiOptions } from "@rjsf/utils";
|
|
42
37
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
43
38
|
function getSemanticProps({
|
|
44
39
|
formContext = {},
|
|
@@ -50,14 +45,13 @@ function getSemanticProps({
|
|
|
50
45
|
const formContextProps = formContext.semantic;
|
|
51
46
|
const schemaProps = getUiOptions(uiSchema).semantic;
|
|
52
47
|
const optionProps = options.semantic;
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
);
|
|
48
|
+
return {
|
|
49
|
+
...defaultSchemaProps,
|
|
50
|
+
...defaultContextProps,
|
|
51
|
+
...schemaProps,
|
|
52
|
+
...optionProps,
|
|
53
|
+
...formContextProps
|
|
54
|
+
};
|
|
61
55
|
}
|
|
62
56
|
function getSemanticErrorProps({
|
|
63
57
|
formContext = {},
|
|
@@ -65,11 +59,11 @@ function getSemanticErrorProps({
|
|
|
65
59
|
options = {},
|
|
66
60
|
defaultProps = { size: "small", pointing: "above" }
|
|
67
61
|
}) {
|
|
68
|
-
const formContextProps = formContext.semantic
|
|
62
|
+
const formContextProps = formContext.semantic?.errorOptions;
|
|
69
63
|
const semanticOptions = getUiOptions(uiSchema).semantic;
|
|
70
|
-
const schemaProps = semanticOptions
|
|
71
|
-
const optionProps = options.semantic
|
|
72
|
-
return
|
|
64
|
+
const schemaProps = semanticOptions?.errorOptions;
|
|
65
|
+
const optionProps = options.semantic?.errorOptions;
|
|
66
|
+
return { ...defaultProps, ...schemaProps, ...optionProps, ...formContextProps };
|
|
73
67
|
}
|
|
74
68
|
function cleanClassNames(classNameArr, omit = []) {
|
|
75
69
|
const classList = classNameArr.filter(Boolean).reduce((previous, current) => previous.concat(current.trim().split(/\s+/)), []);
|
|
@@ -115,12 +109,7 @@ function ArrayFieldItemTemplate(props) {
|
|
|
115
109
|
}
|
|
116
110
|
|
|
117
111
|
// src/ArrayFieldTemplate/ArrayFieldTemplate.tsx
|
|
118
|
-
import {
|
|
119
|
-
getTemplate as getTemplate2,
|
|
120
|
-
getUiOptions as getUiOptions3,
|
|
121
|
-
isFixedItems,
|
|
122
|
-
buttonId
|
|
123
|
-
} from "@rjsf/utils";
|
|
112
|
+
import { getTemplate as getTemplate2, getUiOptions as getUiOptions3, isFixedItems, buttonId } from "@rjsf/utils";
|
|
124
113
|
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
125
114
|
function ArrayFieldTemplate(props) {
|
|
126
115
|
const {
|
|
@@ -211,12 +200,7 @@ function ArrayFieldTemplate(props) {
|
|
|
211
200
|
// src/BaseInputTemplate/BaseInputTemplate.tsx
|
|
212
201
|
import { useCallback } from "react";
|
|
213
202
|
import { SchemaExamples } from "@rjsf/core";
|
|
214
|
-
import {
|
|
215
|
-
ariaDescribedByIds,
|
|
216
|
-
examplesId,
|
|
217
|
-
getInputProps,
|
|
218
|
-
labelValue
|
|
219
|
-
} from "@rjsf/utils";
|
|
203
|
+
import { ariaDescribedByIds, examplesId, getInputProps, labelValue } from "@rjsf/utils";
|
|
220
204
|
import { Form } from "semantic-ui-react";
|
|
221
205
|
import { Fragment, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
222
206
|
function BaseInputTemplate(props) {
|
|
@@ -249,10 +233,10 @@ function BaseInputTemplate(props) {
|
|
|
249
233
|
formContext: registry.formContext,
|
|
250
234
|
options
|
|
251
235
|
});
|
|
252
|
-
const
|
|
253
|
-
const
|
|
254
|
-
const
|
|
255
|
-
const
|
|
236
|
+
const handleChange = ({ target: { value: newValue } }) => onChange(newValue === "" ? options.emptyValue : newValue);
|
|
237
|
+
const handleBlur = () => onBlur?.(id, value);
|
|
238
|
+
const handleFocus = () => onFocus?.(id, value);
|
|
239
|
+
const handleClear = useCallback(
|
|
256
240
|
(e) => {
|
|
257
241
|
e.preventDefault();
|
|
258
242
|
e.stopPropagation();
|
|
@@ -276,41 +260,58 @@ function BaseInputTemplate(props) {
|
|
|
276
260
|
...semanticProps,
|
|
277
261
|
value: value || value === 0 ? value : "",
|
|
278
262
|
error: rawErrors.length > 0,
|
|
279
|
-
onChange: onChangeOverride ||
|
|
280
|
-
onBlur:
|
|
281
|
-
onFocus:
|
|
263
|
+
onChange: onChangeOverride || handleChange,
|
|
264
|
+
onBlur: handleBlur,
|
|
265
|
+
onFocus: handleFocus,
|
|
282
266
|
"aria-describedby": ariaDescribedByIds(id, !!schema.examples)
|
|
283
267
|
},
|
|
284
268
|
id
|
|
285
269
|
),
|
|
286
|
-
options.allowClearTextInputs && !readonly && !disabled && value && /* @__PURE__ */ jsx5(ClearButton2, { registry, onClick:
|
|
270
|
+
options.allowClearTextInputs && !readonly && !disabled && value && /* @__PURE__ */ jsx5(ClearButton2, { registry, onClick: handleClear }),
|
|
287
271
|
/* @__PURE__ */ jsx5(SchemaExamples, { id, schema })
|
|
288
272
|
] });
|
|
289
273
|
}
|
|
290
274
|
|
|
275
|
+
// src/CyclicSchemaExpandTemplate/CyclicSchemaExpandTemplate.tsx
|
|
276
|
+
import { ID_KEY, TranslatableString as TranslatableString2 } from "@rjsf/utils";
|
|
277
|
+
import { Button as Button3 } from "semantic-ui-react";
|
|
278
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
279
|
+
function CyclicSchemaExpandTemplate(props) {
|
|
280
|
+
const { name, fieldPathId, registry, onExpand } = props;
|
|
281
|
+
const { translateString } = registry;
|
|
282
|
+
const buttonId4 = `${fieldPathId[ID_KEY]}-button`;
|
|
283
|
+
return /* @__PURE__ */ jsxs4("div", { style: { marginTop: "1rem", marginBottom: "1rem" }, children: [
|
|
284
|
+
/* @__PURE__ */ jsx6("p", { style: { color: "red" }, children: translateString(TranslatableString2.CycleDetected, [name]) }),
|
|
285
|
+
/* @__PURE__ */ jsx6(Button3, { id: buttonId4, type: "button", size: "mini", onClick: () => onExpand(fieldPathId[ID_KEY]), children: translateString(TranslatableString2.ExpandButton) })
|
|
286
|
+
] });
|
|
287
|
+
}
|
|
288
|
+
|
|
291
289
|
// src/DescriptionField/DescriptionField.tsx
|
|
292
290
|
import { RichDescription } from "@rjsf/core";
|
|
293
|
-
import { jsx as
|
|
291
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
294
292
|
function DescriptionField(props) {
|
|
295
293
|
const { id, description, registry, uiSchema } = props;
|
|
296
294
|
if (!description) {
|
|
297
295
|
return null;
|
|
298
296
|
}
|
|
299
|
-
return /* @__PURE__ */
|
|
297
|
+
return /* @__PURE__ */ jsx7("p", { id, className: "sui-description", children: /* @__PURE__ */ jsx7(RichDescription, { description, registry, uiSchema }) });
|
|
300
298
|
}
|
|
301
299
|
|
|
302
300
|
// src/ErrorList/ErrorList.tsx
|
|
303
|
-
import { TranslatableString as
|
|
301
|
+
import { TranslatableString as TranslatableString3 } from "@rjsf/utils";
|
|
304
302
|
import { Message } from "semantic-ui-react";
|
|
305
|
-
import { jsx as
|
|
303
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
306
304
|
function ErrorList({
|
|
307
305
|
errors,
|
|
308
306
|
registry
|
|
309
307
|
}) {
|
|
310
308
|
const { translateString } = registry;
|
|
311
|
-
return /* @__PURE__ */
|
|
312
|
-
/* @__PURE__ */
|
|
313
|
-
/* @__PURE__ */
|
|
309
|
+
return /* @__PURE__ */ jsxs5(Message, { negative: true, children: [
|
|
310
|
+
/* @__PURE__ */ jsx8(Message.Header, { children: translateString(TranslatableString3.ErrorsLabel) }),
|
|
311
|
+
/* @__PURE__ */ jsx8(Message.List, { children: errors.map((error, index) => (
|
|
312
|
+
// oxlint-disable-next-line react/no-array-index-key
|
|
313
|
+
/* @__PURE__ */ jsx8(Message.Item, { children: error.stack }, `error-${index}`)
|
|
314
|
+
)) })
|
|
314
315
|
] });
|
|
315
316
|
}
|
|
316
317
|
|
|
@@ -318,7 +319,7 @@ function ErrorList({
|
|
|
318
319
|
import { errorId } from "@rjsf/utils";
|
|
319
320
|
import uniqueId from "lodash/uniqueId";
|
|
320
321
|
import { Label, List } from "semantic-ui-react";
|
|
321
|
-
import { jsx as
|
|
322
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
322
323
|
var DEFAULT_OPTIONS = {
|
|
323
324
|
options: {
|
|
324
325
|
pointing: "above",
|
|
@@ -335,7 +336,7 @@ function FieldErrorTemplate({ errors, fieldPathId, uiSchema, registry }) {
|
|
|
335
336
|
const { pointing, size } = options;
|
|
336
337
|
if (errors && errors.length > 0) {
|
|
337
338
|
const id = errorId(fieldPathId);
|
|
338
|
-
return /* @__PURE__ */
|
|
339
|
+
return /* @__PURE__ */ jsx9(Label, { id, color: "red", pointing: pointing || "above", size: size || "small", basic: true, children: /* @__PURE__ */ jsx9(List, { bulleted: true, children: errors.map((error) => /* @__PURE__ */ jsx9(List.Item, { children: error }, uniqueId("field-error-"))) }) });
|
|
339
340
|
}
|
|
340
341
|
return null;
|
|
341
342
|
}
|
|
@@ -344,22 +345,19 @@ function FieldErrorTemplate({ errors, fieldPathId, uiSchema, registry }) {
|
|
|
344
345
|
import { RichHelp } from "@rjsf/core";
|
|
345
346
|
import { helpId } from "@rjsf/utils";
|
|
346
347
|
import { Message as Message2 } from "semantic-ui-react";
|
|
347
|
-
import { jsx as
|
|
348
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
348
349
|
function FieldHelpTemplate(props) {
|
|
349
350
|
const { fieldPathId, help, uiSchema, registry } = props;
|
|
350
351
|
if (help) {
|
|
351
|
-
return /* @__PURE__ */
|
|
352
|
+
return /* @__PURE__ */ jsx10(Message2, { size: "mini", info: true, id: helpId(fieldPathId), children: /* @__PURE__ */ jsx10(RichHelp, { help, registry, uiSchema }) });
|
|
352
353
|
}
|
|
353
354
|
return null;
|
|
354
355
|
}
|
|
355
356
|
|
|
356
357
|
// src/FieldTemplate/FieldTemplate.tsx
|
|
357
|
-
import {
|
|
358
|
-
getTemplate as getTemplate3,
|
|
359
|
-
getUiOptions as getUiOptions4
|
|
360
|
-
} from "@rjsf/utils";
|
|
358
|
+
import { getTemplate as getTemplate3, getUiOptions as getUiOptions4 } from "@rjsf/utils";
|
|
361
359
|
import { Form as Form2 } from "semantic-ui-react";
|
|
362
|
-
import { jsx as
|
|
360
|
+
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
363
361
|
function FieldTemplate(props) {
|
|
364
362
|
const {
|
|
365
363
|
id,
|
|
@@ -390,10 +388,10 @@ function FieldTemplate(props) {
|
|
|
390
388
|
uiOptions
|
|
391
389
|
);
|
|
392
390
|
if (hidden) {
|
|
393
|
-
return /* @__PURE__ */
|
|
391
|
+
return /* @__PURE__ */ jsx11("div", { style: { display: "none" }, children });
|
|
394
392
|
}
|
|
395
393
|
const isCheckbox = uiOptions.widget === "checkbox";
|
|
396
|
-
return /* @__PURE__ */
|
|
394
|
+
return /* @__PURE__ */ jsx11(
|
|
397
395
|
WrapIfAdditionalTemplate2,
|
|
398
396
|
{
|
|
399
397
|
classNames,
|
|
@@ -406,9 +404,9 @@ function FieldTemplate(props) {
|
|
|
406
404
|
schema,
|
|
407
405
|
uiSchema,
|
|
408
406
|
...otherProps,
|
|
409
|
-
children: /* @__PURE__ */
|
|
407
|
+
children: /* @__PURE__ */ jsx11(Form2.Group, { widths: "equal", grouped: true, children: /* @__PURE__ */ jsxs6(MaybeWrap, { wrap: wrapContent, className: "sui-field-content", children: [
|
|
410
408
|
children,
|
|
411
|
-
displayLabel && rawDescription && !isCheckbox && /* @__PURE__ */
|
|
409
|
+
displayLabel && rawDescription && !isCheckbox && /* @__PURE__ */ jsx11(MaybeWrap, { wrap: wrapLabel, className: "sui-field-label", children: description }),
|
|
412
410
|
help,
|
|
413
411
|
errors
|
|
414
412
|
] }) }, id)
|
|
@@ -418,23 +416,24 @@ function FieldTemplate(props) {
|
|
|
418
416
|
|
|
419
417
|
// src/GridTemplate/GridTemplate.tsx
|
|
420
418
|
import { Grid as Grid2 } from "semantic-ui-react";
|
|
421
|
-
import { jsx as
|
|
419
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
422
420
|
function GridTemplate(props) {
|
|
423
421
|
const { children, column, ...rest } = props;
|
|
424
422
|
if (column) {
|
|
425
|
-
return /* @__PURE__ */
|
|
423
|
+
return /* @__PURE__ */ jsx12(Grid2.Column, { ...rest, children });
|
|
426
424
|
}
|
|
427
|
-
return /* @__PURE__ */
|
|
425
|
+
return /* @__PURE__ */ jsx12(Grid2, { ...rest, children });
|
|
428
426
|
}
|
|
429
427
|
|
|
430
428
|
// src/IconButton/IconButton.tsx
|
|
431
|
-
import {
|
|
432
|
-
import {
|
|
433
|
-
import {
|
|
434
|
-
|
|
429
|
+
import { memo } from "react";
|
|
430
|
+
import { TranslatableString as TranslatableString4 } from "@rjsf/utils";
|
|
431
|
+
import { Button as Button4 } from "semantic-ui-react";
|
|
432
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
433
|
+
function IconButtonFn(props) {
|
|
435
434
|
const { icon, iconType, color, className, uiSchema, registry, ...otherProps } = props;
|
|
436
|
-
return /* @__PURE__ */
|
|
437
|
-
|
|
435
|
+
return /* @__PURE__ */ jsx13(
|
|
436
|
+
Button4,
|
|
438
437
|
{
|
|
439
438
|
icon,
|
|
440
439
|
size: iconType,
|
|
@@ -444,58 +443,57 @@ function IconButton(props) {
|
|
|
444
443
|
}
|
|
445
444
|
);
|
|
446
445
|
}
|
|
447
|
-
|
|
446
|
+
var IconButton = memo(IconButtonFn);
|
|
447
|
+
function CopyButtonFn(props) {
|
|
448
448
|
const {
|
|
449
449
|
registry: { translateString }
|
|
450
450
|
} = props;
|
|
451
|
-
return /* @__PURE__ */
|
|
451
|
+
return /* @__PURE__ */ jsx13(IconButton, { title: translateString(TranslatableString4.CopyButton), ...props, icon: "copy" });
|
|
452
452
|
}
|
|
453
|
-
|
|
453
|
+
var CopyButton = memo(CopyButtonFn);
|
|
454
|
+
function MoveDownButtonFn(props) {
|
|
454
455
|
const {
|
|
455
456
|
registry: { translateString }
|
|
456
457
|
} = props;
|
|
457
|
-
return /* @__PURE__ */
|
|
458
|
+
return /* @__PURE__ */ jsx13(IconButton, { title: translateString(TranslatableString4.MoveDownButton), ...props, icon: "angle down" });
|
|
458
459
|
}
|
|
459
|
-
|
|
460
|
+
var MoveDownButton = memo(MoveDownButtonFn);
|
|
461
|
+
function MoveUpButtonFn(props) {
|
|
460
462
|
const {
|
|
461
463
|
registry: { translateString }
|
|
462
464
|
} = props;
|
|
463
|
-
return /* @__PURE__ */
|
|
465
|
+
return /* @__PURE__ */ jsx13(IconButton, { title: translateString(TranslatableString4.MoveUpButton), ...props, icon: "angle up" });
|
|
464
466
|
}
|
|
465
|
-
|
|
467
|
+
var MoveUpButton = memo(MoveUpButtonFn);
|
|
468
|
+
function RemoveButtonFn(props) {
|
|
466
469
|
const {
|
|
467
470
|
registry: { translateString }
|
|
468
471
|
} = props;
|
|
469
|
-
return /* @__PURE__ */
|
|
472
|
+
return /* @__PURE__ */ jsx13(IconButton, { title: translateString(TranslatableString4.RemoveButton), ...props, icon: "trash" });
|
|
470
473
|
}
|
|
471
|
-
|
|
474
|
+
var RemoveButton = memo(RemoveButtonFn);
|
|
475
|
+
function ClearButtonFn(props) {
|
|
472
476
|
const {
|
|
473
477
|
registry: { translateString }
|
|
474
478
|
} = props;
|
|
475
|
-
return /* @__PURE__ */
|
|
479
|
+
return /* @__PURE__ */ jsx13(IconButton, { title: translateString(TranslatableString4.ClearButton), ...props, icon: "close" });
|
|
476
480
|
}
|
|
481
|
+
var ClearButton = memo(ClearButtonFn);
|
|
477
482
|
|
|
478
483
|
// src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx
|
|
479
|
-
import { jsx as
|
|
484
|
+
import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
480
485
|
function MultiSchemaFieldTemplate(props) {
|
|
481
486
|
const { selector, optionSchemaField } = props;
|
|
482
|
-
return /* @__PURE__ */
|
|
483
|
-
/* @__PURE__ */
|
|
487
|
+
return /* @__PURE__ */ jsxs7("div", { children: [
|
|
488
|
+
/* @__PURE__ */ jsx14("div", { children: selector }),
|
|
484
489
|
optionSchemaField
|
|
485
490
|
] });
|
|
486
491
|
}
|
|
487
492
|
|
|
488
493
|
// src/ObjectFieldTemplate/ObjectFieldTemplate.tsx
|
|
489
|
-
import {
|
|
490
|
-
canExpand,
|
|
491
|
-
descriptionId,
|
|
492
|
-
getTemplate as getTemplate4,
|
|
493
|
-
getUiOptions as getUiOptions5,
|
|
494
|
-
titleId,
|
|
495
|
-
buttonId as buttonId2
|
|
496
|
-
} from "@rjsf/utils";
|
|
494
|
+
import { canExpand, descriptionId, getTemplate as getTemplate4, getUiOptions as getUiOptions5, titleId, buttonId as buttonId2 } from "@rjsf/utils";
|
|
497
495
|
import { Grid as Grid3 } from "semantic-ui-react";
|
|
498
|
-
import { Fragment as Fragment2, jsx as
|
|
496
|
+
import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
499
497
|
function ObjectFieldTemplate(props) {
|
|
500
498
|
const {
|
|
501
499
|
description,
|
|
@@ -523,8 +521,8 @@ function ObjectFieldTemplate(props) {
|
|
|
523
521
|
const {
|
|
524
522
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
525
523
|
} = registry.templates;
|
|
526
|
-
return /* @__PURE__ */
|
|
527
|
-
title && /* @__PURE__ */
|
|
524
|
+
return /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
525
|
+
title && /* @__PURE__ */ jsx15(
|
|
528
526
|
TitleFieldTemplate,
|
|
529
527
|
{
|
|
530
528
|
id: titleId(fieldPathId),
|
|
@@ -536,7 +534,7 @@ function ObjectFieldTemplate(props) {
|
|
|
536
534
|
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
537
535
|
}
|
|
538
536
|
),
|
|
539
|
-
description && /* @__PURE__ */
|
|
537
|
+
description && /* @__PURE__ */ jsx15(
|
|
540
538
|
DescriptionFieldTemplate,
|
|
541
539
|
{
|
|
542
540
|
id: descriptionId(fieldPathId),
|
|
@@ -548,7 +546,7 @@ function ObjectFieldTemplate(props) {
|
|
|
548
546
|
),
|
|
549
547
|
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
550
548
|
properties.map((prop) => prop.content),
|
|
551
|
-
canExpand(schema, uiSchema, formData) && /* @__PURE__ */
|
|
549
|
+
canExpand(schema, uiSchema, formData) && /* @__PURE__ */ jsx15(Grid3.Column, { width: 16, verticalAlign: "middle", children: /* @__PURE__ */ jsx15(Grid3.Row, { children: /* @__PURE__ */ jsx15(
|
|
552
550
|
"div",
|
|
553
551
|
{
|
|
554
552
|
style: {
|
|
@@ -556,7 +554,7 @@ function ObjectFieldTemplate(props) {
|
|
|
556
554
|
position: "relative",
|
|
557
555
|
textAlign: "right"
|
|
558
556
|
},
|
|
559
|
-
children: /* @__PURE__ */
|
|
557
|
+
children: /* @__PURE__ */ jsx15(
|
|
560
558
|
AddButton2,
|
|
561
559
|
{
|
|
562
560
|
id: buttonId2(fieldPathId, "add"),
|
|
@@ -573,11 +571,11 @@ function ObjectFieldTemplate(props) {
|
|
|
573
571
|
}
|
|
574
572
|
|
|
575
573
|
// src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx
|
|
576
|
-
import { jsx as
|
|
574
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
577
575
|
function OptionalDataControlsTemplate(props) {
|
|
578
576
|
const { id, registry, label, onAddClick, onRemoveClick } = props;
|
|
579
577
|
if (onAddClick) {
|
|
580
|
-
return /* @__PURE__ */
|
|
578
|
+
return /* @__PURE__ */ jsx16(
|
|
581
579
|
AddButton,
|
|
582
580
|
{
|
|
583
581
|
id,
|
|
@@ -588,8 +586,9 @@ function OptionalDataControlsTemplate(props) {
|
|
|
588
586
|
size: "mini"
|
|
589
587
|
}
|
|
590
588
|
);
|
|
591
|
-
}
|
|
592
|
-
|
|
589
|
+
}
|
|
590
|
+
if (onRemoveClick) {
|
|
591
|
+
return /* @__PURE__ */ jsx16(
|
|
593
592
|
RemoveButton,
|
|
594
593
|
{
|
|
595
594
|
id,
|
|
@@ -601,24 +600,24 @@ function OptionalDataControlsTemplate(props) {
|
|
|
601
600
|
}
|
|
602
601
|
);
|
|
603
602
|
}
|
|
604
|
-
return /* @__PURE__ */
|
|
603
|
+
return /* @__PURE__ */ jsx16("em", { id, children: label });
|
|
605
604
|
}
|
|
606
605
|
|
|
607
606
|
// src/SubmitButton/SubmitButton.tsx
|
|
608
607
|
import { getSubmitButtonOptions } from "@rjsf/utils";
|
|
609
|
-
import { Button as
|
|
610
|
-
import { jsx as
|
|
608
|
+
import { Button as Button5 } from "semantic-ui-react";
|
|
609
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
611
610
|
function SubmitButton({ uiSchema }) {
|
|
612
611
|
const { submitText, norender, props: submitButtonProps = {} } = getSubmitButtonOptions(uiSchema);
|
|
613
612
|
if (norender) {
|
|
614
613
|
return null;
|
|
615
614
|
}
|
|
616
|
-
return /* @__PURE__ */
|
|
615
|
+
return /* @__PURE__ */ jsx17(Button5, { type: "submit", primary: true, ...submitButtonProps, children: submitText });
|
|
617
616
|
}
|
|
618
617
|
|
|
619
618
|
// src/TitleField/TitleField.tsx
|
|
620
619
|
import { Grid as Grid4, Header } from "semantic-ui-react";
|
|
621
|
-
import { jsx as
|
|
620
|
+
import { jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
622
621
|
var DEFAULT_OPTIONS2 = {
|
|
623
622
|
inverted: false,
|
|
624
623
|
dividing: true
|
|
@@ -633,24 +632,20 @@ function TitleField({
|
|
|
633
632
|
uiSchema,
|
|
634
633
|
defaultSchemaProps: DEFAULT_OPTIONS2
|
|
635
634
|
});
|
|
636
|
-
let heading = title ? /* @__PURE__ */
|
|
635
|
+
let heading = title ? /* @__PURE__ */ jsx18(Header, { id, ...semanticProps, as: "h5", children: title }) : null;
|
|
637
636
|
if (optionalDataControl) {
|
|
638
|
-
heading = /* @__PURE__ */
|
|
639
|
-
/* @__PURE__ */
|
|
640
|
-
/* @__PURE__ */
|
|
637
|
+
heading = /* @__PURE__ */ jsxs9(Grid4, { colums: 2, relaxed: true, children: [
|
|
638
|
+
/* @__PURE__ */ jsx18(Grid4.Column, { width: 14, style: { paddingRight: 0 }, children: heading }),
|
|
639
|
+
/* @__PURE__ */ jsx18(Grid4.Column, { width: 2, children: optionalDataControl })
|
|
641
640
|
] });
|
|
642
641
|
}
|
|
643
642
|
return heading;
|
|
644
643
|
}
|
|
645
644
|
|
|
646
645
|
// src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx
|
|
647
|
-
import {
|
|
648
|
-
ADDITIONAL_PROPERTY_FLAG,
|
|
649
|
-
buttonId as buttonId3,
|
|
650
|
-
TranslatableString as TranslatableString4
|
|
651
|
-
} from "@rjsf/utils";
|
|
646
|
+
import { ADDITIONAL_PROPERTY_FLAG, buttonId as buttonId3, TranslatableString as TranslatableString5 } from "@rjsf/utils";
|
|
652
647
|
import { Form as Form3, Grid as Grid5 } from "semantic-ui-react";
|
|
653
|
-
import { jsx as
|
|
648
|
+
import { jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
654
649
|
function WrapIfAdditionalTemplate(props) {
|
|
655
650
|
const {
|
|
656
651
|
children,
|
|
@@ -671,35 +666,35 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
671
666
|
} = props;
|
|
672
667
|
const { templates, translateString } = registry;
|
|
673
668
|
const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
|
|
674
|
-
const keyLabel = translateString(
|
|
669
|
+
const keyLabel = translateString(TranslatableString5.KeyLabel, [label]);
|
|
675
670
|
const { readonlyAsDisabled = true, wrapperStyle } = registry.formContext;
|
|
676
671
|
const additional = ADDITIONAL_PROPERTY_FLAG in schema;
|
|
677
672
|
const margin = rawDescription ? 4 : 24;
|
|
678
673
|
if (!additional) {
|
|
679
|
-
return /* @__PURE__ */
|
|
674
|
+
return /* @__PURE__ */ jsx19("div", { className: classNames, style, children });
|
|
680
675
|
}
|
|
681
|
-
return /* @__PURE__ */
|
|
682
|
-
/* @__PURE__ */
|
|
676
|
+
return /* @__PURE__ */ jsx19("div", { className: classNames, style, children: /* @__PURE__ */ jsx19(Grid5, { children: /* @__PURE__ */ jsxs10(Grid5.Row, { children: [
|
|
677
|
+
/* @__PURE__ */ jsx19(Grid5.Column, { width: 7, className: "form-additional", children: /* @__PURE__ */ jsx19(Form3.Group, { widths: "equal", grouped: true, children: /* @__PURE__ */ jsx19(
|
|
683
678
|
Form3.Input,
|
|
684
679
|
{
|
|
685
680
|
className: "form-group",
|
|
686
681
|
hasFeedback: true,
|
|
687
682
|
fluid: true,
|
|
688
|
-
htmlFor:
|
|
683
|
+
htmlFor: id,
|
|
689
684
|
label: displayLabel ? keyLabel : void 0,
|
|
690
685
|
required,
|
|
691
686
|
defaultValue: label,
|
|
692
687
|
disabled: disabled || readonlyAsDisabled && readonly,
|
|
693
|
-
id
|
|
694
|
-
name:
|
|
688
|
+
id,
|
|
689
|
+
name: id,
|
|
695
690
|
onBlur: !readonly ? onKeyRenameBlur : void 0,
|
|
696
691
|
style: wrapperStyle,
|
|
697
692
|
type: "text"
|
|
698
693
|
},
|
|
699
694
|
label
|
|
700
695
|
) }) }),
|
|
701
|
-
/* @__PURE__ */
|
|
702
|
-
/* @__PURE__ */
|
|
696
|
+
/* @__PURE__ */ jsx19(Grid5.Column, { width: 7, className: "form-additional", verticalAlign: "middle", children }),
|
|
697
|
+
/* @__PURE__ */ jsx19(Grid5.Column, { verticalAlign: "middle", style: displayLabel ? { marginTop: `${margin}px` } : void 0, children: /* @__PURE__ */ jsx19(
|
|
703
698
|
RemoveButton2,
|
|
704
699
|
{
|
|
705
700
|
id: buttonId3(id, "remove"),
|
|
@@ -720,6 +715,7 @@ function generateTemplates() {
|
|
|
720
715
|
ArrayFieldItemTemplate,
|
|
721
716
|
ArrayFieldTemplate,
|
|
722
717
|
BaseInputTemplate,
|
|
718
|
+
CyclicSchemaExpandTemplate,
|
|
723
719
|
ButtonTemplates: {
|
|
724
720
|
AddButton,
|
|
725
721
|
CopyButton,
|
|
@@ -755,7 +751,7 @@ import {
|
|
|
755
751
|
titleId as titleId2
|
|
756
752
|
} from "@rjsf/utils";
|
|
757
753
|
import { Form as Form4 } from "semantic-ui-react";
|
|
758
|
-
import { Fragment as Fragment3, jsx as
|
|
754
|
+
import { Fragment as Fragment3, jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
759
755
|
function CheckboxesWidget(props) {
|
|
760
756
|
const {
|
|
761
757
|
id,
|
|
@@ -786,22 +782,22 @@ function CheckboxesWidget(props) {
|
|
|
786
782
|
inverted: "false"
|
|
787
783
|
}
|
|
788
784
|
});
|
|
789
|
-
const
|
|
785
|
+
const handleChange = (index) => ({ target: { checked } }) => {
|
|
790
786
|
if (checked) {
|
|
791
787
|
onChange(enumOptionsSelectValue(index, checkboxesValues, enumOptions));
|
|
792
788
|
} else {
|
|
793
789
|
onChange(enumOptionsDeselectValue(index, checkboxesValues, enumOptions));
|
|
794
790
|
}
|
|
795
791
|
};
|
|
796
|
-
const
|
|
797
|
-
const
|
|
792
|
+
const handleBlur = () => onBlur(id, value);
|
|
793
|
+
const handleFocus = () => onFocus(id, value);
|
|
798
794
|
const inlineOption = inline ? { inline: true } : { grouped: true };
|
|
799
|
-
return /* @__PURE__ */
|
|
800
|
-
!hideLabel && !!label && /* @__PURE__ */
|
|
801
|
-
/* @__PURE__ */
|
|
795
|
+
return /* @__PURE__ */ jsxs11(Fragment3, { children: [
|
|
796
|
+
!hideLabel && !!label && /* @__PURE__ */ jsx20(TitleFieldTemplate, { id: titleId2(id), title: label, schema, uiSchema, registry }),
|
|
797
|
+
/* @__PURE__ */ jsx20(Form4.Group, { id, name: htmlName || id, ...inlineOption, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
802
798
|
const checked = enumOptionsIsSelected(option.value, checkboxesValues);
|
|
803
|
-
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.
|
|
804
|
-
return /* @__PURE__ */
|
|
799
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.includes(option.value);
|
|
800
|
+
return /* @__PURE__ */ jsx20(
|
|
805
801
|
Form4.Checkbox,
|
|
806
802
|
{
|
|
807
803
|
id: optionId(id, index),
|
|
@@ -812,27 +808,21 @@ function CheckboxesWidget(props) {
|
|
|
812
808
|
error: rawErrors.length > 0,
|
|
813
809
|
disabled: disabled || itemDisabled || readonly,
|
|
814
810
|
autoFocus: autofocus && index === 0,
|
|
815
|
-
onChange:
|
|
816
|
-
onBlur:
|
|
817
|
-
onFocus:
|
|
811
|
+
onChange: handleChange(index),
|
|
812
|
+
onBlur: handleBlur,
|
|
813
|
+
onFocus: handleFocus,
|
|
818
814
|
"aria-describedby": ariaDescribedByIds2(id)
|
|
819
815
|
},
|
|
820
|
-
|
|
816
|
+
String(option.value)
|
|
821
817
|
);
|
|
822
818
|
}) })
|
|
823
819
|
] });
|
|
824
820
|
}
|
|
825
821
|
|
|
826
822
|
// src/CheckboxWidget/CheckboxWidget.tsx
|
|
827
|
-
import {
|
|
828
|
-
ariaDescribedByIds as ariaDescribedByIds3,
|
|
829
|
-
descriptionId as descriptionId2,
|
|
830
|
-
getTemplate as getTemplate6,
|
|
831
|
-
labelValue as labelValue2,
|
|
832
|
-
schemaRequiresTrueValue
|
|
833
|
-
} from "@rjsf/utils";
|
|
823
|
+
import { ariaDescribedByIds as ariaDescribedByIds3, descriptionId as descriptionId2, getTemplate as getTemplate6, labelValue as labelValue2, schemaRequiresTrueValue } from "@rjsf/utils";
|
|
834
824
|
import { Form as Form5 } from "semantic-ui-react";
|
|
835
|
-
import { Fragment as Fragment4, jsx as
|
|
825
|
+
import { Fragment as Fragment4, jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
836
826
|
function CheckboxWidget(props) {
|
|
837
827
|
const {
|
|
838
828
|
id,
|
|
@@ -840,7 +830,7 @@ function CheckboxWidget(props) {
|
|
|
840
830
|
value,
|
|
841
831
|
disabled,
|
|
842
832
|
readonly,
|
|
843
|
-
label
|
|
833
|
+
label,
|
|
844
834
|
hideLabel,
|
|
845
835
|
autofocus,
|
|
846
836
|
onChange,
|
|
@@ -866,13 +856,13 @@ function CheckboxWidget(props) {
|
|
|
866
856
|
options
|
|
867
857
|
);
|
|
868
858
|
const required = schemaRequiresTrueValue(schema);
|
|
869
|
-
const checked = value
|
|
870
|
-
const
|
|
871
|
-
const
|
|
872
|
-
const
|
|
859
|
+
const checked = value === "true" || value === true;
|
|
860
|
+
const handleChange = (_, data) => onChange?.(data.checked);
|
|
861
|
+
const handleBlur = () => onBlur?.(id, value);
|
|
862
|
+
const handleFocus = () => onFocus?.(id, value);
|
|
873
863
|
const description = options.description ?? schema.description;
|
|
874
|
-
return /* @__PURE__ */
|
|
875
|
-
!hideLabel && description && /* @__PURE__ */
|
|
864
|
+
return /* @__PURE__ */ jsxs12(Fragment4, { children: [
|
|
865
|
+
!hideLabel && description && /* @__PURE__ */ jsx21(
|
|
876
866
|
DescriptionFieldTemplate,
|
|
877
867
|
{
|
|
878
868
|
id: descriptionId2(id),
|
|
@@ -882,7 +872,7 @@ function CheckboxWidget(props) {
|
|
|
882
872
|
registry
|
|
883
873
|
}
|
|
884
874
|
),
|
|
885
|
-
/* @__PURE__ */
|
|
875
|
+
/* @__PURE__ */ jsx21(
|
|
886
876
|
Form5.Checkbox,
|
|
887
877
|
{
|
|
888
878
|
id,
|
|
@@ -892,9 +882,9 @@ function CheckboxWidget(props) {
|
|
|
892
882
|
...semanticProps,
|
|
893
883
|
checked: typeof value === "undefined" ? false : checked,
|
|
894
884
|
error: rawErrors.length > 0,
|
|
895
|
-
onChange:
|
|
896
|
-
onBlur:
|
|
897
|
-
onFocus:
|
|
885
|
+
onChange: handleChange,
|
|
886
|
+
onBlur: handleBlur,
|
|
887
|
+
onFocus: handleFocus,
|
|
898
888
|
required,
|
|
899
889
|
label: labelValue2(label, hideLabel, false),
|
|
900
890
|
"aria-describedby": ariaDescribedByIds3(id)
|
|
@@ -913,7 +903,7 @@ import {
|
|
|
913
903
|
optionId as optionId2
|
|
914
904
|
} from "@rjsf/utils";
|
|
915
905
|
import { Form as Form6, Radio } from "semantic-ui-react";
|
|
916
|
-
import { jsx as
|
|
906
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
917
907
|
import { createElement } from "react";
|
|
918
908
|
function RadioWidget(props) {
|
|
919
909
|
const {
|
|
@@ -938,15 +928,13 @@ function RadioWidget(props) {
|
|
|
938
928
|
options,
|
|
939
929
|
uiSchema
|
|
940
930
|
});
|
|
941
|
-
const
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
const _onBlur = () => onBlur(id, value);
|
|
945
|
-
const _onFocus = () => onFocus(id, value);
|
|
931
|
+
const handleChange = (_, { value: eventValue }) => onChange(enumOptionValueDecoder(String(eventValue), enumOptions, optionValueFormat, emptyValue));
|
|
932
|
+
const handleBlur = () => onBlur(id, value);
|
|
933
|
+
const handleFocus = () => onFocus(id, value);
|
|
946
934
|
const inlineOption = options.inline ? { inline: true } : { grouped: true };
|
|
947
|
-
return /* @__PURE__ */
|
|
935
|
+
return /* @__PURE__ */ jsx22(Form6.Group, { ...inlineOption, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
948
936
|
const checked = enumOptionsIsSelected2(option.value, value);
|
|
949
|
-
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.
|
|
937
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.includes(option.value);
|
|
950
938
|
return /* @__PURE__ */ createElement(
|
|
951
939
|
Form6.Field,
|
|
952
940
|
{
|
|
@@ -955,13 +943,13 @@ function RadioWidget(props) {
|
|
|
955
943
|
id: optionId2(id, index),
|
|
956
944
|
name: htmlName || id,
|
|
957
945
|
...semanticProps,
|
|
958
|
-
onFocus:
|
|
959
|
-
onBlur:
|
|
960
|
-
onChange:
|
|
946
|
+
onFocus: handleFocus,
|
|
947
|
+
onBlur: handleBlur,
|
|
948
|
+
onChange: handleChange,
|
|
961
949
|
label: option.label,
|
|
962
950
|
value: enumOptionValueEncoder(option.value, index, optionValueFormat),
|
|
963
951
|
error: rawErrors.length > 0,
|
|
964
|
-
key:
|
|
952
|
+
key: String(option.value),
|
|
965
953
|
checked,
|
|
966
954
|
disabled: disabled || itemDisabled || readonly,
|
|
967
955
|
"aria-describedby": ariaDescribedByIds4(id)
|
|
@@ -973,7 +961,7 @@ function RadioWidget(props) {
|
|
|
973
961
|
// src/RangeWidget/RangeWidget.tsx
|
|
974
962
|
import { ariaDescribedByIds as ariaDescribedByIds5, rangeSpec } from "@rjsf/utils";
|
|
975
963
|
import { Input } from "semantic-ui-react";
|
|
976
|
-
import { Fragment as Fragment5, jsx as
|
|
964
|
+
import { Fragment as Fragment5, jsx as jsx23, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
977
965
|
function RangeWidget(props) {
|
|
978
966
|
const {
|
|
979
967
|
id,
|
|
@@ -998,11 +986,11 @@ function RangeWidget(props) {
|
|
|
998
986
|
fluid: true
|
|
999
987
|
}
|
|
1000
988
|
});
|
|
1001
|
-
const
|
|
1002
|
-
const
|
|
1003
|
-
const
|
|
1004
|
-
return /* @__PURE__ */
|
|
1005
|
-
/* @__PURE__ */
|
|
989
|
+
const handleChange = ({ target: { value: value2 } }) => onChange?.(value2 === "" ? options.emptyValue : value2);
|
|
990
|
+
const handleBlur = () => onBlur?.(id, value);
|
|
991
|
+
const handleFocus = () => onFocus?.(id, value);
|
|
992
|
+
return /* @__PURE__ */ jsxs13(Fragment5, { children: [
|
|
993
|
+
/* @__PURE__ */ jsx23(
|
|
1006
994
|
Input,
|
|
1007
995
|
{
|
|
1008
996
|
id,
|
|
@@ -1014,14 +1002,14 @@ function RangeWidget(props) {
|
|
|
1014
1002
|
...semanticProps,
|
|
1015
1003
|
value: value || "",
|
|
1016
1004
|
error: rawErrors.length > 0,
|
|
1017
|
-
onChange:
|
|
1018
|
-
onBlur:
|
|
1019
|
-
onFocus:
|
|
1005
|
+
onChange: handleChange,
|
|
1006
|
+
onBlur: handleBlur,
|
|
1007
|
+
onFocus: handleFocus,
|
|
1020
1008
|
"aria-describedby": ariaDescribedByIds5(id)
|
|
1021
1009
|
},
|
|
1022
1010
|
id
|
|
1023
1011
|
),
|
|
1024
|
-
/* @__PURE__ */
|
|
1012
|
+
/* @__PURE__ */ jsx23("span", { children: value })
|
|
1025
1013
|
] });
|
|
1026
1014
|
}
|
|
1027
1015
|
|
|
@@ -1032,15 +1020,17 @@ import {
|
|
|
1032
1020
|
enumOptionValueDecoder as enumOptionValueDecoder2,
|
|
1033
1021
|
enumOptionValueEncoder as enumOptionValueEncoder2,
|
|
1034
1022
|
getOptionValueFormat as getOptionValueFormat2,
|
|
1035
|
-
labelValue as labelValue3
|
|
1023
|
+
labelValue as labelValue3,
|
|
1024
|
+
logUnsupportedDefaultForEnum,
|
|
1025
|
+
SelectedOptionDescription
|
|
1036
1026
|
} from "@rjsf/utils";
|
|
1037
1027
|
import map from "lodash/map";
|
|
1038
1028
|
import { Form as Form7 } from "semantic-ui-react";
|
|
1039
|
-
import { jsx as
|
|
1029
|
+
import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1040
1030
|
function createDefaultValueOptionsForDropDown(enumOptions, enumDisabled, showPlaceholderOption, placeholder, format = "indexed") {
|
|
1041
1031
|
const disabledOptions = enumDisabled || [];
|
|
1042
1032
|
const options = map(enumOptions, ({ label, value }, index) => ({
|
|
1043
|
-
disabled: disabledOptions.
|
|
1033
|
+
disabled: disabledOptions.includes(value),
|
|
1044
1034
|
key: label,
|
|
1045
1035
|
text: label,
|
|
1046
1036
|
value: enumOptionValueEncoder2(value, index, format)
|
|
@@ -1088,6 +1078,7 @@ function SelectWidget(props) {
|
|
|
1088
1078
|
const emptyValue = multiple ? [] : "";
|
|
1089
1079
|
const optionValueFormat = getOptionValueFormat2(options);
|
|
1090
1080
|
const showPlaceholderOption = !multiple && schema.default === void 0;
|
|
1081
|
+
logUnsupportedDefaultForEnum(id, schema, enumOptions, multiple);
|
|
1091
1082
|
const dropdownOptions = createDefaultValueOptionsForDropDown(
|
|
1092
1083
|
enumOptions,
|
|
1093
1084
|
enumDisabled,
|
|
@@ -1095,41 +1086,41 @@ function SelectWidget(props) {
|
|
|
1095
1086
|
placeholder,
|
|
1096
1087
|
optionValueFormat
|
|
1097
1088
|
);
|
|
1098
|
-
const
|
|
1099
|
-
const
|
|
1100
|
-
const
|
|
1101
|
-
return /* @__PURE__ */
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1089
|
+
const handleChange = (_, { value: enumValue }) => onChange(enumOptionValueDecoder2(enumValue, enumOptions, optionValueFormat, optEmptyVal));
|
|
1090
|
+
const handleBlur = (_, { target }) => onBlur(id, enumOptionValueDecoder2(target?.value, enumOptions, optionValueFormat, optEmptyVal));
|
|
1091
|
+
const handleFocus = (_, { target }) => onFocus(id, enumOptionValueDecoder2(target?.value, enumOptions, optionValueFormat, optEmptyVal));
|
|
1092
|
+
return /* @__PURE__ */ jsxs14(Fragment6, { children: [
|
|
1093
|
+
/* @__PURE__ */ jsx24(
|
|
1094
|
+
Form7.Dropdown,
|
|
1095
|
+
{
|
|
1096
|
+
id,
|
|
1097
|
+
name: htmlName || id,
|
|
1098
|
+
label: labelValue3(label || void 0, hideLabel, false),
|
|
1099
|
+
multiple: typeof multiple === "undefined" ? false : multiple,
|
|
1100
|
+
value: enumOptionSelectedValue(value, enumOptions, !!multiple, optionValueFormat, emptyValue),
|
|
1101
|
+
error: rawErrors.length > 0,
|
|
1102
|
+
disabled,
|
|
1103
|
+
placeholder,
|
|
1104
|
+
...semanticProps,
|
|
1105
|
+
required,
|
|
1106
|
+
autoFocus: autofocus,
|
|
1107
|
+
readOnly: readonly,
|
|
1108
|
+
options: dropdownOptions,
|
|
1109
|
+
onChange: handleChange,
|
|
1110
|
+
onBlur: handleBlur,
|
|
1111
|
+
onFocus: handleFocus,
|
|
1112
|
+
"aria-describedby": ariaDescribedByIds6(id)
|
|
1113
|
+
},
|
|
1114
|
+
id
|
|
1115
|
+
),
|
|
1116
|
+
/* @__PURE__ */ jsx24(SelectedOptionDescription, { ...props })
|
|
1117
|
+
] });
|
|
1124
1118
|
}
|
|
1125
1119
|
|
|
1126
1120
|
// src/TextareaWidget/TextareaWidget.tsx
|
|
1127
|
-
import {
|
|
1128
|
-
ariaDescribedByIds as ariaDescribedByIds7,
|
|
1129
|
-
labelValue as labelValue4
|
|
1130
|
-
} from "@rjsf/utils";
|
|
1121
|
+
import { ariaDescribedByIds as ariaDescribedByIds7, labelValue as labelValue4 } from "@rjsf/utils";
|
|
1131
1122
|
import { Form as Form8 } from "semantic-ui-react";
|
|
1132
|
-
import { jsx as
|
|
1123
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1133
1124
|
function TextareaWidget(props) {
|
|
1134
1125
|
const {
|
|
1135
1126
|
id,
|
|
@@ -1154,10 +1145,10 @@ function TextareaWidget(props) {
|
|
|
1154
1145
|
options,
|
|
1155
1146
|
defaultSchemaProps: { inverted: "false" }
|
|
1156
1147
|
});
|
|
1157
|
-
const
|
|
1158
|
-
const
|
|
1159
|
-
const
|
|
1160
|
-
return /* @__PURE__ */
|
|
1148
|
+
const handleChange = ({ target: { value: value2 } }) => onChange?.(value2 === "" ? options.emptyValue : value2);
|
|
1149
|
+
const handleBlur = () => onBlur?.(id, value);
|
|
1150
|
+
const handleFocus = () => onFocus?.(id, value);
|
|
1151
|
+
return /* @__PURE__ */ jsx25(
|
|
1161
1152
|
Form8.TextArea,
|
|
1162
1153
|
{
|
|
1163
1154
|
id,
|
|
@@ -1171,9 +1162,9 @@ function TextareaWidget(props) {
|
|
|
1171
1162
|
value: value || "",
|
|
1172
1163
|
error: rawErrors.length > 0,
|
|
1173
1164
|
rows: options.rows || 5,
|
|
1174
|
-
onChange:
|
|
1175
|
-
onBlur:
|
|
1176
|
-
onFocus:
|
|
1165
|
+
onChange: handleChange,
|
|
1166
|
+
onBlur: handleBlur,
|
|
1167
|
+
onFocus: handleFocus,
|
|
1177
1168
|
"aria-describedby": ariaDescribedByIds7(id)
|
|
1178
1169
|
},
|
|
1179
1170
|
id
|