@rjsf/semantic-ui 6.6.2 → 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 +206 -187
- package/dist/index.cjs.map +4 -4
- package/dist/semantic-ui.esm.js +139 -118
- package/dist/semantic-ui.esm.js.map +4 -4
- package/dist/semantic-ui.umd.js +54 -40
- package/lib/AddButton/AddButton.d.ts +1 -1
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +1 -1
- package/lib/BaseInputTemplate/BaseInputTemplate.d.ts +1 -1
- package/lib/BaseInputTemplate/BaseInputTemplate.js +2 -2
- package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
- package/lib/CheckboxWidget/CheckboxWidget.d.ts +1 -1
- package/lib/CheckboxWidget/CheckboxWidget.js +4 -4
- package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.d.ts +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 +1 -1
- package/lib/ErrorList/ErrorList.d.ts +1 -1
- package/lib/FieldErrorTemplate/FieldErrorTemplate.d.ts +1 -1
- package/lib/FieldHelpTemplate/FieldHelpTemplate.d.ts +1 -1
- package/lib/FieldTemplate/FieldTemplate.d.ts +1 -1
- package/lib/GridTemplate/GridTemplate.d.ts +1 -1
- package/lib/IconButton/IconButton.d.ts +6 -6
- package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.d.ts +1 -1
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +1 -1
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.d.ts +1 -1
- package/lib/RadioWidget/RadioWidget.d.ts +1 -1
- package/lib/RangeWidget/RangeWidget.d.ts +1 -1
- package/lib/RangeWidget/RangeWidget.js +3 -3
- package/lib/RangeWidget/RangeWidget.js.map +1 -1
- package/lib/SelectWidget/SelectWidget.d.ts +1 -1
- package/lib/SelectWidget/SelectWidget.js +6 -5
- package/lib/SelectWidget/SelectWidget.js.map +1 -1
- package/lib/SubmitButton/SubmitButton.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 +1 -1
- package/lib/TextareaWidget/TextareaWidget.js +3 -3
- package/lib/TextareaWidget/TextareaWidget.js.map +1 -1
- package/lib/TitleField/TitleField.d.ts +1 -1
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.d.ts +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/util.js +4 -3
- package/lib/util.js.map +1 -1
- package/package.json +25 -23
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +2 -2
- package/src/CheckboxWidget/CheckboxWidget.tsx +4 -4
- package/src/CyclicSchemaExpandTemplate/CyclicSchemaExpandTemplate.tsx +25 -0
- package/src/CyclicSchemaExpandTemplate/index.ts +2 -0
- package/src/RangeWidget/RangeWidget.tsx +3 -3
- package/src/SelectWidget/SelectWidget.tsx +28 -22
- package/src/Templates/Templates.ts +2 -0
- package/src/TextareaWidget/TextareaWidget.tsx +3 -3
- package/src/util.tsx +3 -3
package/dist/semantic-ui.esm.js
CHANGED
|
@@ -59,10 +59,10 @@ function getSemanticErrorProps({
|
|
|
59
59
|
options = {},
|
|
60
60
|
defaultProps = { size: "small", pointing: "above" }
|
|
61
61
|
}) {
|
|
62
|
-
const formContextProps = formContext.semantic
|
|
62
|
+
const formContextProps = formContext.semantic?.errorOptions;
|
|
63
63
|
const semanticOptions = getUiOptions(uiSchema).semantic;
|
|
64
|
-
const schemaProps = semanticOptions
|
|
65
|
-
const optionProps = options.semantic
|
|
64
|
+
const schemaProps = semanticOptions?.errorOptions;
|
|
65
|
+
const optionProps = options.semantic?.errorOptions;
|
|
66
66
|
return { ...defaultProps, ...schemaProps, ...optionProps, ...formContextProps };
|
|
67
67
|
}
|
|
68
68
|
function cleanClassNames(classNameArr, omit = []) {
|
|
@@ -234,8 +234,8 @@ function BaseInputTemplate(props) {
|
|
|
234
234
|
options
|
|
235
235
|
});
|
|
236
236
|
const handleChange = ({ target: { value: newValue } }) => onChange(newValue === "" ? options.emptyValue : newValue);
|
|
237
|
-
const handleBlur = () => onBlur
|
|
238
|
-
const handleFocus = () => onFocus
|
|
237
|
+
const handleBlur = () => onBlur?.(id, value);
|
|
238
|
+
const handleFocus = () => onFocus?.(id, value);
|
|
239
239
|
const handleClear = useCallback(
|
|
240
240
|
(e) => {
|
|
241
241
|
e.preventDefault();
|
|
@@ -272,31 +272,45 @@ function BaseInputTemplate(props) {
|
|
|
272
272
|
] });
|
|
273
273
|
}
|
|
274
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
|
+
|
|
275
289
|
// src/DescriptionField/DescriptionField.tsx
|
|
276
290
|
import { RichDescription } from "@rjsf/core";
|
|
277
|
-
import { jsx as
|
|
291
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
278
292
|
function DescriptionField(props) {
|
|
279
293
|
const { id, description, registry, uiSchema } = props;
|
|
280
294
|
if (!description) {
|
|
281
295
|
return null;
|
|
282
296
|
}
|
|
283
|
-
return /* @__PURE__ */
|
|
297
|
+
return /* @__PURE__ */ jsx7("p", { id, className: "sui-description", children: /* @__PURE__ */ jsx7(RichDescription, { description, registry, uiSchema }) });
|
|
284
298
|
}
|
|
285
299
|
|
|
286
300
|
// src/ErrorList/ErrorList.tsx
|
|
287
|
-
import { TranslatableString as
|
|
301
|
+
import { TranslatableString as TranslatableString3 } from "@rjsf/utils";
|
|
288
302
|
import { Message } from "semantic-ui-react";
|
|
289
|
-
import { jsx as
|
|
303
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
290
304
|
function ErrorList({
|
|
291
305
|
errors,
|
|
292
306
|
registry
|
|
293
307
|
}) {
|
|
294
308
|
const { translateString } = registry;
|
|
295
|
-
return /* @__PURE__ */
|
|
296
|
-
/* @__PURE__ */
|
|
297
|
-
/* @__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) => (
|
|
298
312
|
// oxlint-disable-next-line react/no-array-index-key
|
|
299
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ jsx8(Message.Item, { children: error.stack }, `error-${index}`)
|
|
300
314
|
)) })
|
|
301
315
|
] });
|
|
302
316
|
}
|
|
@@ -305,7 +319,7 @@ function ErrorList({
|
|
|
305
319
|
import { errorId } from "@rjsf/utils";
|
|
306
320
|
import uniqueId from "lodash/uniqueId";
|
|
307
321
|
import { Label, List } from "semantic-ui-react";
|
|
308
|
-
import { jsx as
|
|
322
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
309
323
|
var DEFAULT_OPTIONS = {
|
|
310
324
|
options: {
|
|
311
325
|
pointing: "above",
|
|
@@ -322,7 +336,7 @@ function FieldErrorTemplate({ errors, fieldPathId, uiSchema, registry }) {
|
|
|
322
336
|
const { pointing, size } = options;
|
|
323
337
|
if (errors && errors.length > 0) {
|
|
324
338
|
const id = errorId(fieldPathId);
|
|
325
|
-
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-"))) }) });
|
|
326
340
|
}
|
|
327
341
|
return null;
|
|
328
342
|
}
|
|
@@ -331,11 +345,11 @@ function FieldErrorTemplate({ errors, fieldPathId, uiSchema, registry }) {
|
|
|
331
345
|
import { RichHelp } from "@rjsf/core";
|
|
332
346
|
import { helpId } from "@rjsf/utils";
|
|
333
347
|
import { Message as Message2 } from "semantic-ui-react";
|
|
334
|
-
import { jsx as
|
|
348
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
335
349
|
function FieldHelpTemplate(props) {
|
|
336
350
|
const { fieldPathId, help, uiSchema, registry } = props;
|
|
337
351
|
if (help) {
|
|
338
|
-
return /* @__PURE__ */
|
|
352
|
+
return /* @__PURE__ */ jsx10(Message2, { size: "mini", info: true, id: helpId(fieldPathId), children: /* @__PURE__ */ jsx10(RichHelp, { help, registry, uiSchema }) });
|
|
339
353
|
}
|
|
340
354
|
return null;
|
|
341
355
|
}
|
|
@@ -343,7 +357,7 @@ function FieldHelpTemplate(props) {
|
|
|
343
357
|
// src/FieldTemplate/FieldTemplate.tsx
|
|
344
358
|
import { getTemplate as getTemplate3, getUiOptions as getUiOptions4 } from "@rjsf/utils";
|
|
345
359
|
import { Form as Form2 } from "semantic-ui-react";
|
|
346
|
-
import { jsx as
|
|
360
|
+
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
347
361
|
function FieldTemplate(props) {
|
|
348
362
|
const {
|
|
349
363
|
id,
|
|
@@ -374,10 +388,10 @@ function FieldTemplate(props) {
|
|
|
374
388
|
uiOptions
|
|
375
389
|
);
|
|
376
390
|
if (hidden) {
|
|
377
|
-
return /* @__PURE__ */
|
|
391
|
+
return /* @__PURE__ */ jsx11("div", { style: { display: "none" }, children });
|
|
378
392
|
}
|
|
379
393
|
const isCheckbox = uiOptions.widget === "checkbox";
|
|
380
|
-
return /* @__PURE__ */
|
|
394
|
+
return /* @__PURE__ */ jsx11(
|
|
381
395
|
WrapIfAdditionalTemplate2,
|
|
382
396
|
{
|
|
383
397
|
classNames,
|
|
@@ -390,9 +404,9 @@ function FieldTemplate(props) {
|
|
|
390
404
|
schema,
|
|
391
405
|
uiSchema,
|
|
392
406
|
...otherProps,
|
|
393
|
-
children: /* @__PURE__ */
|
|
407
|
+
children: /* @__PURE__ */ jsx11(Form2.Group, { widths: "equal", grouped: true, children: /* @__PURE__ */ jsxs6(MaybeWrap, { wrap: wrapContent, className: "sui-field-content", children: [
|
|
394
408
|
children,
|
|
395
|
-
displayLabel && rawDescription && !isCheckbox && /* @__PURE__ */
|
|
409
|
+
displayLabel && rawDescription && !isCheckbox && /* @__PURE__ */ jsx11(MaybeWrap, { wrap: wrapLabel, className: "sui-field-label", children: description }),
|
|
396
410
|
help,
|
|
397
411
|
errors
|
|
398
412
|
] }) }, id)
|
|
@@ -402,24 +416,24 @@ function FieldTemplate(props) {
|
|
|
402
416
|
|
|
403
417
|
// src/GridTemplate/GridTemplate.tsx
|
|
404
418
|
import { Grid as Grid2 } from "semantic-ui-react";
|
|
405
|
-
import { jsx as
|
|
419
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
406
420
|
function GridTemplate(props) {
|
|
407
421
|
const { children, column, ...rest } = props;
|
|
408
422
|
if (column) {
|
|
409
|
-
return /* @__PURE__ */
|
|
423
|
+
return /* @__PURE__ */ jsx12(Grid2.Column, { ...rest, children });
|
|
410
424
|
}
|
|
411
|
-
return /* @__PURE__ */
|
|
425
|
+
return /* @__PURE__ */ jsx12(Grid2, { ...rest, children });
|
|
412
426
|
}
|
|
413
427
|
|
|
414
428
|
// src/IconButton/IconButton.tsx
|
|
415
429
|
import { memo } from "react";
|
|
416
|
-
import { TranslatableString as
|
|
417
|
-
import { Button as
|
|
418
|
-
import { jsx as
|
|
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";
|
|
419
433
|
function IconButtonFn(props) {
|
|
420
434
|
const { icon, iconType, color, className, uiSchema, registry, ...otherProps } = props;
|
|
421
|
-
return /* @__PURE__ */
|
|
422
|
-
|
|
435
|
+
return /* @__PURE__ */ jsx13(
|
|
436
|
+
Button4,
|
|
423
437
|
{
|
|
424
438
|
icon,
|
|
425
439
|
size: iconType,
|
|
@@ -434,44 +448,44 @@ function CopyButtonFn(props) {
|
|
|
434
448
|
const {
|
|
435
449
|
registry: { translateString }
|
|
436
450
|
} = props;
|
|
437
|
-
return /* @__PURE__ */
|
|
451
|
+
return /* @__PURE__ */ jsx13(IconButton, { title: translateString(TranslatableString4.CopyButton), ...props, icon: "copy" });
|
|
438
452
|
}
|
|
439
453
|
var CopyButton = memo(CopyButtonFn);
|
|
440
454
|
function MoveDownButtonFn(props) {
|
|
441
455
|
const {
|
|
442
456
|
registry: { translateString }
|
|
443
457
|
} = props;
|
|
444
|
-
return /* @__PURE__ */
|
|
458
|
+
return /* @__PURE__ */ jsx13(IconButton, { title: translateString(TranslatableString4.MoveDownButton), ...props, icon: "angle down" });
|
|
445
459
|
}
|
|
446
460
|
var MoveDownButton = memo(MoveDownButtonFn);
|
|
447
461
|
function MoveUpButtonFn(props) {
|
|
448
462
|
const {
|
|
449
463
|
registry: { translateString }
|
|
450
464
|
} = props;
|
|
451
|
-
return /* @__PURE__ */
|
|
465
|
+
return /* @__PURE__ */ jsx13(IconButton, { title: translateString(TranslatableString4.MoveUpButton), ...props, icon: "angle up" });
|
|
452
466
|
}
|
|
453
467
|
var MoveUpButton = memo(MoveUpButtonFn);
|
|
454
468
|
function RemoveButtonFn(props) {
|
|
455
469
|
const {
|
|
456
470
|
registry: { translateString }
|
|
457
471
|
} = props;
|
|
458
|
-
return /* @__PURE__ */
|
|
472
|
+
return /* @__PURE__ */ jsx13(IconButton, { title: translateString(TranslatableString4.RemoveButton), ...props, icon: "trash" });
|
|
459
473
|
}
|
|
460
474
|
var RemoveButton = memo(RemoveButtonFn);
|
|
461
475
|
function ClearButtonFn(props) {
|
|
462
476
|
const {
|
|
463
477
|
registry: { translateString }
|
|
464
478
|
} = props;
|
|
465
|
-
return /* @__PURE__ */
|
|
479
|
+
return /* @__PURE__ */ jsx13(IconButton, { title: translateString(TranslatableString4.ClearButton), ...props, icon: "close" });
|
|
466
480
|
}
|
|
467
481
|
var ClearButton = memo(ClearButtonFn);
|
|
468
482
|
|
|
469
483
|
// src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx
|
|
470
|
-
import { jsx as
|
|
484
|
+
import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
471
485
|
function MultiSchemaFieldTemplate(props) {
|
|
472
486
|
const { selector, optionSchemaField } = props;
|
|
473
|
-
return /* @__PURE__ */
|
|
474
|
-
/* @__PURE__ */
|
|
487
|
+
return /* @__PURE__ */ jsxs7("div", { children: [
|
|
488
|
+
/* @__PURE__ */ jsx14("div", { children: selector }),
|
|
475
489
|
optionSchemaField
|
|
476
490
|
] });
|
|
477
491
|
}
|
|
@@ -479,7 +493,7 @@ function MultiSchemaFieldTemplate(props) {
|
|
|
479
493
|
// src/ObjectFieldTemplate/ObjectFieldTemplate.tsx
|
|
480
494
|
import { canExpand, descriptionId, getTemplate as getTemplate4, getUiOptions as getUiOptions5, titleId, buttonId as buttonId2 } from "@rjsf/utils";
|
|
481
495
|
import { Grid as Grid3 } from "semantic-ui-react";
|
|
482
|
-
import { Fragment as Fragment2, jsx as
|
|
496
|
+
import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
483
497
|
function ObjectFieldTemplate(props) {
|
|
484
498
|
const {
|
|
485
499
|
description,
|
|
@@ -507,8 +521,8 @@ function ObjectFieldTemplate(props) {
|
|
|
507
521
|
const {
|
|
508
522
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
509
523
|
} = registry.templates;
|
|
510
|
-
return /* @__PURE__ */
|
|
511
|
-
title && /* @__PURE__ */
|
|
524
|
+
return /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
525
|
+
title && /* @__PURE__ */ jsx15(
|
|
512
526
|
TitleFieldTemplate,
|
|
513
527
|
{
|
|
514
528
|
id: titleId(fieldPathId),
|
|
@@ -520,7 +534,7 @@ function ObjectFieldTemplate(props) {
|
|
|
520
534
|
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
521
535
|
}
|
|
522
536
|
),
|
|
523
|
-
description && /* @__PURE__ */
|
|
537
|
+
description && /* @__PURE__ */ jsx15(
|
|
524
538
|
DescriptionFieldTemplate,
|
|
525
539
|
{
|
|
526
540
|
id: descriptionId(fieldPathId),
|
|
@@ -532,7 +546,7 @@ function ObjectFieldTemplate(props) {
|
|
|
532
546
|
),
|
|
533
547
|
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
534
548
|
properties.map((prop) => prop.content),
|
|
535
|
-
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(
|
|
536
550
|
"div",
|
|
537
551
|
{
|
|
538
552
|
style: {
|
|
@@ -540,7 +554,7 @@ function ObjectFieldTemplate(props) {
|
|
|
540
554
|
position: "relative",
|
|
541
555
|
textAlign: "right"
|
|
542
556
|
},
|
|
543
|
-
children: /* @__PURE__ */
|
|
557
|
+
children: /* @__PURE__ */ jsx15(
|
|
544
558
|
AddButton2,
|
|
545
559
|
{
|
|
546
560
|
id: buttonId2(fieldPathId, "add"),
|
|
@@ -557,11 +571,11 @@ function ObjectFieldTemplate(props) {
|
|
|
557
571
|
}
|
|
558
572
|
|
|
559
573
|
// src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx
|
|
560
|
-
import { jsx as
|
|
574
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
561
575
|
function OptionalDataControlsTemplate(props) {
|
|
562
576
|
const { id, registry, label, onAddClick, onRemoveClick } = props;
|
|
563
577
|
if (onAddClick) {
|
|
564
|
-
return /* @__PURE__ */
|
|
578
|
+
return /* @__PURE__ */ jsx16(
|
|
565
579
|
AddButton,
|
|
566
580
|
{
|
|
567
581
|
id,
|
|
@@ -574,7 +588,7 @@ function OptionalDataControlsTemplate(props) {
|
|
|
574
588
|
);
|
|
575
589
|
}
|
|
576
590
|
if (onRemoveClick) {
|
|
577
|
-
return /* @__PURE__ */
|
|
591
|
+
return /* @__PURE__ */ jsx16(
|
|
578
592
|
RemoveButton,
|
|
579
593
|
{
|
|
580
594
|
id,
|
|
@@ -586,24 +600,24 @@ function OptionalDataControlsTemplate(props) {
|
|
|
586
600
|
}
|
|
587
601
|
);
|
|
588
602
|
}
|
|
589
|
-
return /* @__PURE__ */
|
|
603
|
+
return /* @__PURE__ */ jsx16("em", { id, children: label });
|
|
590
604
|
}
|
|
591
605
|
|
|
592
606
|
// src/SubmitButton/SubmitButton.tsx
|
|
593
607
|
import { getSubmitButtonOptions } from "@rjsf/utils";
|
|
594
|
-
import { Button as
|
|
595
|
-
import { jsx as
|
|
608
|
+
import { Button as Button5 } from "semantic-ui-react";
|
|
609
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
596
610
|
function SubmitButton({ uiSchema }) {
|
|
597
611
|
const { submitText, norender, props: submitButtonProps = {} } = getSubmitButtonOptions(uiSchema);
|
|
598
612
|
if (norender) {
|
|
599
613
|
return null;
|
|
600
614
|
}
|
|
601
|
-
return /* @__PURE__ */
|
|
615
|
+
return /* @__PURE__ */ jsx17(Button5, { type: "submit", primary: true, ...submitButtonProps, children: submitText });
|
|
602
616
|
}
|
|
603
617
|
|
|
604
618
|
// src/TitleField/TitleField.tsx
|
|
605
619
|
import { Grid as Grid4, Header } from "semantic-ui-react";
|
|
606
|
-
import { jsx as
|
|
620
|
+
import { jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
607
621
|
var DEFAULT_OPTIONS2 = {
|
|
608
622
|
inverted: false,
|
|
609
623
|
dividing: true
|
|
@@ -618,20 +632,20 @@ function TitleField({
|
|
|
618
632
|
uiSchema,
|
|
619
633
|
defaultSchemaProps: DEFAULT_OPTIONS2
|
|
620
634
|
});
|
|
621
|
-
let heading = title ? /* @__PURE__ */
|
|
635
|
+
let heading = title ? /* @__PURE__ */ jsx18(Header, { id, ...semanticProps, as: "h5", children: title }) : null;
|
|
622
636
|
if (optionalDataControl) {
|
|
623
|
-
heading = /* @__PURE__ */
|
|
624
|
-
/* @__PURE__ */
|
|
625
|
-
/* @__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 })
|
|
626
640
|
] });
|
|
627
641
|
}
|
|
628
642
|
return heading;
|
|
629
643
|
}
|
|
630
644
|
|
|
631
645
|
// src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx
|
|
632
|
-
import { ADDITIONAL_PROPERTY_FLAG, buttonId as buttonId3, TranslatableString as
|
|
646
|
+
import { ADDITIONAL_PROPERTY_FLAG, buttonId as buttonId3, TranslatableString as TranslatableString5 } from "@rjsf/utils";
|
|
633
647
|
import { Form as Form3, Grid as Grid5 } from "semantic-ui-react";
|
|
634
|
-
import { jsx as
|
|
648
|
+
import { jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
635
649
|
function WrapIfAdditionalTemplate(props) {
|
|
636
650
|
const {
|
|
637
651
|
children,
|
|
@@ -652,15 +666,15 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
652
666
|
} = props;
|
|
653
667
|
const { templates, translateString } = registry;
|
|
654
668
|
const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
|
|
655
|
-
const keyLabel = translateString(
|
|
669
|
+
const keyLabel = translateString(TranslatableString5.KeyLabel, [label]);
|
|
656
670
|
const { readonlyAsDisabled = true, wrapperStyle } = registry.formContext;
|
|
657
671
|
const additional = ADDITIONAL_PROPERTY_FLAG in schema;
|
|
658
672
|
const margin = rawDescription ? 4 : 24;
|
|
659
673
|
if (!additional) {
|
|
660
|
-
return /* @__PURE__ */
|
|
674
|
+
return /* @__PURE__ */ jsx19("div", { className: classNames, style, children });
|
|
661
675
|
}
|
|
662
|
-
return /* @__PURE__ */
|
|
663
|
-
/* @__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(
|
|
664
678
|
Form3.Input,
|
|
665
679
|
{
|
|
666
680
|
className: "form-group",
|
|
@@ -679,8 +693,8 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
679
693
|
},
|
|
680
694
|
label
|
|
681
695
|
) }) }),
|
|
682
|
-
/* @__PURE__ */
|
|
683
|
-
/* @__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(
|
|
684
698
|
RemoveButton2,
|
|
685
699
|
{
|
|
686
700
|
id: buttonId3(id, "remove"),
|
|
@@ -701,6 +715,7 @@ function generateTemplates() {
|
|
|
701
715
|
ArrayFieldItemTemplate,
|
|
702
716
|
ArrayFieldTemplate,
|
|
703
717
|
BaseInputTemplate,
|
|
718
|
+
CyclicSchemaExpandTemplate,
|
|
704
719
|
ButtonTemplates: {
|
|
705
720
|
AddButton,
|
|
706
721
|
CopyButton,
|
|
@@ -736,7 +751,7 @@ import {
|
|
|
736
751
|
titleId as titleId2
|
|
737
752
|
} from "@rjsf/utils";
|
|
738
753
|
import { Form as Form4 } from "semantic-ui-react";
|
|
739
|
-
import { Fragment as Fragment3, jsx as
|
|
754
|
+
import { Fragment as Fragment3, jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
740
755
|
function CheckboxesWidget(props) {
|
|
741
756
|
const {
|
|
742
757
|
id,
|
|
@@ -777,12 +792,12 @@ function CheckboxesWidget(props) {
|
|
|
777
792
|
const handleBlur = () => onBlur(id, value);
|
|
778
793
|
const handleFocus = () => onFocus(id, value);
|
|
779
794
|
const inlineOption = inline ? { inline: true } : { grouped: true };
|
|
780
|
-
return /* @__PURE__ */
|
|
781
|
-
!hideLabel && !!label && /* @__PURE__ */
|
|
782
|
-
/* @__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) => {
|
|
783
798
|
const checked = enumOptionsIsSelected(option.value, checkboxesValues);
|
|
784
799
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.includes(option.value);
|
|
785
|
-
return /* @__PURE__ */
|
|
800
|
+
return /* @__PURE__ */ jsx20(
|
|
786
801
|
Form4.Checkbox,
|
|
787
802
|
{
|
|
788
803
|
id: optionId(id, index),
|
|
@@ -807,7 +822,7 @@ function CheckboxesWidget(props) {
|
|
|
807
822
|
// src/CheckboxWidget/CheckboxWidget.tsx
|
|
808
823
|
import { ariaDescribedByIds as ariaDescribedByIds3, descriptionId as descriptionId2, getTemplate as getTemplate6, labelValue as labelValue2, schemaRequiresTrueValue } from "@rjsf/utils";
|
|
809
824
|
import { Form as Form5 } from "semantic-ui-react";
|
|
810
|
-
import { Fragment as Fragment4, jsx as
|
|
825
|
+
import { Fragment as Fragment4, jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
811
826
|
function CheckboxWidget(props) {
|
|
812
827
|
const {
|
|
813
828
|
id,
|
|
@@ -815,7 +830,7 @@ function CheckboxWidget(props) {
|
|
|
815
830
|
value,
|
|
816
831
|
disabled,
|
|
817
832
|
readonly,
|
|
818
|
-
label
|
|
833
|
+
label,
|
|
819
834
|
hideLabel,
|
|
820
835
|
autofocus,
|
|
821
836
|
onChange,
|
|
@@ -842,12 +857,12 @@ function CheckboxWidget(props) {
|
|
|
842
857
|
);
|
|
843
858
|
const required = schemaRequiresTrueValue(schema);
|
|
844
859
|
const checked = value === "true" || value === true;
|
|
845
|
-
const handleChange = (_, data) => onChange
|
|
846
|
-
const handleBlur = () => onBlur
|
|
847
|
-
const handleFocus = () => onFocus
|
|
860
|
+
const handleChange = (_, data) => onChange?.(data.checked);
|
|
861
|
+
const handleBlur = () => onBlur?.(id, value);
|
|
862
|
+
const handleFocus = () => onFocus?.(id, value);
|
|
848
863
|
const description = options.description ?? schema.description;
|
|
849
|
-
return /* @__PURE__ */
|
|
850
|
-
!hideLabel && description && /* @__PURE__ */
|
|
864
|
+
return /* @__PURE__ */ jsxs12(Fragment4, { children: [
|
|
865
|
+
!hideLabel && description && /* @__PURE__ */ jsx21(
|
|
851
866
|
DescriptionFieldTemplate,
|
|
852
867
|
{
|
|
853
868
|
id: descriptionId2(id),
|
|
@@ -857,7 +872,7 @@ function CheckboxWidget(props) {
|
|
|
857
872
|
registry
|
|
858
873
|
}
|
|
859
874
|
),
|
|
860
|
-
/* @__PURE__ */
|
|
875
|
+
/* @__PURE__ */ jsx21(
|
|
861
876
|
Form5.Checkbox,
|
|
862
877
|
{
|
|
863
878
|
id,
|
|
@@ -888,7 +903,7 @@ import {
|
|
|
888
903
|
optionId as optionId2
|
|
889
904
|
} from "@rjsf/utils";
|
|
890
905
|
import { Form as Form6, Radio } from "semantic-ui-react";
|
|
891
|
-
import { jsx as
|
|
906
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
892
907
|
import { createElement } from "react";
|
|
893
908
|
function RadioWidget(props) {
|
|
894
909
|
const {
|
|
@@ -917,7 +932,7 @@ function RadioWidget(props) {
|
|
|
917
932
|
const handleBlur = () => onBlur(id, value);
|
|
918
933
|
const handleFocus = () => onFocus(id, value);
|
|
919
934
|
const inlineOption = options.inline ? { inline: true } : { grouped: true };
|
|
920
|
-
return /* @__PURE__ */
|
|
935
|
+
return /* @__PURE__ */ jsx22(Form6.Group, { ...inlineOption, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
921
936
|
const checked = enumOptionsIsSelected2(option.value, value);
|
|
922
937
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.includes(option.value);
|
|
923
938
|
return /* @__PURE__ */ createElement(
|
|
@@ -946,7 +961,7 @@ function RadioWidget(props) {
|
|
|
946
961
|
// src/RangeWidget/RangeWidget.tsx
|
|
947
962
|
import { ariaDescribedByIds as ariaDescribedByIds5, rangeSpec } from "@rjsf/utils";
|
|
948
963
|
import { Input } from "semantic-ui-react";
|
|
949
|
-
import { Fragment as Fragment5, jsx as
|
|
964
|
+
import { Fragment as Fragment5, jsx as jsx23, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
950
965
|
function RangeWidget(props) {
|
|
951
966
|
const {
|
|
952
967
|
id,
|
|
@@ -971,11 +986,11 @@ function RangeWidget(props) {
|
|
|
971
986
|
fluid: true
|
|
972
987
|
}
|
|
973
988
|
});
|
|
974
|
-
const handleChange = ({ target: { value: value2 } }) => onChange
|
|
975
|
-
const handleBlur = () => onBlur
|
|
976
|
-
const handleFocus = () => onFocus
|
|
977
|
-
return /* @__PURE__ */
|
|
978
|
-
/* @__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(
|
|
979
994
|
Input,
|
|
980
995
|
{
|
|
981
996
|
id,
|
|
@@ -994,7 +1009,7 @@ function RangeWidget(props) {
|
|
|
994
1009
|
},
|
|
995
1010
|
id
|
|
996
1011
|
),
|
|
997
|
-
/* @__PURE__ */
|
|
1012
|
+
/* @__PURE__ */ jsx23("span", { children: value })
|
|
998
1013
|
] });
|
|
999
1014
|
}
|
|
1000
1015
|
|
|
@@ -1005,11 +1020,13 @@ import {
|
|
|
1005
1020
|
enumOptionValueDecoder as enumOptionValueDecoder2,
|
|
1006
1021
|
enumOptionValueEncoder as enumOptionValueEncoder2,
|
|
1007
1022
|
getOptionValueFormat as getOptionValueFormat2,
|
|
1008
|
-
labelValue as labelValue3
|
|
1023
|
+
labelValue as labelValue3,
|
|
1024
|
+
logUnsupportedDefaultForEnum,
|
|
1025
|
+
SelectedOptionDescription
|
|
1009
1026
|
} from "@rjsf/utils";
|
|
1010
1027
|
import map from "lodash/map";
|
|
1011
1028
|
import { Form as Form7 } from "semantic-ui-react";
|
|
1012
|
-
import { jsx as
|
|
1029
|
+
import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1013
1030
|
function createDefaultValueOptionsForDropDown(enumOptions, enumDisabled, showPlaceholderOption, placeholder, format = "indexed") {
|
|
1014
1031
|
const disabledOptions = enumDisabled || [];
|
|
1015
1032
|
const options = map(enumOptions, ({ label, value }, index) => ({
|
|
@@ -1061,6 +1078,7 @@ function SelectWidget(props) {
|
|
|
1061
1078
|
const emptyValue = multiple ? [] : "";
|
|
1062
1079
|
const optionValueFormat = getOptionValueFormat2(options);
|
|
1063
1080
|
const showPlaceholderOption = !multiple && schema.default === void 0;
|
|
1081
|
+
logUnsupportedDefaultForEnum(id, schema, enumOptions, multiple);
|
|
1064
1082
|
const dropdownOptions = createDefaultValueOptionsForDropDown(
|
|
1065
1083
|
enumOptions,
|
|
1066
1084
|
enumDisabled,
|
|
@@ -1069,37 +1087,40 @@ function SelectWidget(props) {
|
|
|
1069
1087
|
optionValueFormat
|
|
1070
1088
|
);
|
|
1071
1089
|
const handleChange = (_, { value: enumValue }) => onChange(enumOptionValueDecoder2(enumValue, enumOptions, optionValueFormat, optEmptyVal));
|
|
1072
|
-
const handleBlur = (_, { target }) => onBlur(id, enumOptionValueDecoder2(target
|
|
1073
|
-
const handleFocus = (_, { target }) => onFocus(id, enumOptionValueDecoder2(target
|
|
1074
|
-
return /* @__PURE__ */
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
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
|
+
] });
|
|
1097
1118
|
}
|
|
1098
1119
|
|
|
1099
1120
|
// src/TextareaWidget/TextareaWidget.tsx
|
|
1100
1121
|
import { ariaDescribedByIds as ariaDescribedByIds7, labelValue as labelValue4 } from "@rjsf/utils";
|
|
1101
1122
|
import { Form as Form8 } from "semantic-ui-react";
|
|
1102
|
-
import { jsx as
|
|
1123
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1103
1124
|
function TextareaWidget(props) {
|
|
1104
1125
|
const {
|
|
1105
1126
|
id,
|
|
@@ -1124,10 +1145,10 @@ function TextareaWidget(props) {
|
|
|
1124
1145
|
options,
|
|
1125
1146
|
defaultSchemaProps: { inverted: "false" }
|
|
1126
1147
|
});
|
|
1127
|
-
const handleChange = ({ target: { value: value2 } }) => onChange
|
|
1128
|
-
const handleBlur = () => onBlur
|
|
1129
|
-
const handleFocus = () => onFocus
|
|
1130
|
-
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(
|
|
1131
1152
|
Form8.TextArea,
|
|
1132
1153
|
{
|
|
1133
1154
|
id,
|