@rjsf/semantic-ui 6.5.3 → 6.6.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/dist/index.cjs +158 -158
- package/dist/index.cjs.map +4 -4
- package/dist/semantic-ui.esm.js +157 -157
- package/dist/semantic-ui.esm.js.map +4 -4
- package/dist/semantic-ui.umd.js +109 -109
- package/lib/AddButton/AddButton.js +1 -1
- package/lib/AddButton/AddButton.js.map +1 -1
- package/lib/BaseInputTemplate/BaseInputTemplate.js +2 -2
- package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
- package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.js +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
- package/lib/DescriptionField/DescriptionField.js.map +1 -1
- package/lib/ErrorList/ErrorList.js +1 -1
- package/lib/ErrorList/ErrorList.js.map +1 -1
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js +1 -1
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -1
- package/lib/FieldTemplate/FieldTemplate.js.map +1 -1
- package/lib/GridTemplate/GridTemplate.js.map +1 -1
- package/lib/IconButton/IconButton.d.ts +1 -1
- package/lib/IconButton/IconButton.js +1 -1
- package/lib/IconButton/IconButton.js.map +1 -1
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +1 -1
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js +1 -1
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js.map +1 -1
- package/lib/RadioWidget/RadioWidget.js.map +1 -1
- package/lib/RangeWidget/RangeWidget.js +1 -1
- package/lib/RangeWidget/RangeWidget.js.map +1 -1
- package/lib/SelectWidget/SelectWidget.js.map +1 -1
- package/lib/SubmitButton/SubmitButton.js +1 -1
- package/lib/SubmitButton/SubmitButton.js.map +1 -1
- package/lib/Templates/Templates.js +1 -1
- package/lib/Templates/Templates.js.map +1 -1
- package/lib/TextareaWidget/TextareaWidget.js.map +1 -1
- package/lib/Theme/Theme.d.ts +1 -1
- package/lib/Widgets/Widgets.js +1 -1
- package/lib/Widgets/Widgets.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -12
- package/src/AddButton/AddButton.tsx +1 -1
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +4 -3
- package/src/CheckboxWidget/CheckboxWidget.tsx +1 -0
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +2 -1
- package/src/DescriptionField/DescriptionField.tsx +1 -1
- package/src/ErrorList/ErrorList.tsx +1 -1
- package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +1 -1
- package/src/FieldTemplate/FieldTemplate.tsx +1 -0
- package/src/GridTemplate/GridTemplate.tsx +1 -1
- package/src/IconButton/IconButton.tsx +1 -1
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +1 -1
- package/src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx +1 -1
- package/src/RadioWidget/RadioWidget.tsx +1 -0
- package/src/RangeWidget/RangeWidget.tsx +2 -1
- package/src/SelectWidget/SelectWidget.tsx +1 -0
- package/src/SubmitButton/SubmitButton.tsx +1 -1
- package/src/Templates/Templates.ts +1 -1
- package/src/TextareaWidget/TextareaWidget.tsx +1 -0
- package/src/Theme/Theme.ts +1 -1
- package/src/Widgets/Widgets.tsx +1 -1
- package/src/tsconfig.json +0 -1
package/dist/index.cjs
CHANGED
|
@@ -49,8 +49,8 @@ var import_core4 = require("@rjsf/core");
|
|
|
49
49
|
var import_semantic_ui_react20 = require("semantic-ui-react");
|
|
50
50
|
|
|
51
51
|
// src/AddButton/AddButton.tsx
|
|
52
|
-
var import_semantic_ui_react = require("semantic-ui-react");
|
|
53
52
|
var import_utils = require("@rjsf/utils");
|
|
53
|
+
var import_semantic_ui_react = require("semantic-ui-react");
|
|
54
54
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
55
55
|
function AddButton({
|
|
56
56
|
uiSchema,
|
|
@@ -244,9 +244,9 @@ function ArrayFieldTemplate(props) {
|
|
|
244
244
|
|
|
245
245
|
// src/BaseInputTemplate/BaseInputTemplate.tsx
|
|
246
246
|
var import_react = require("react");
|
|
247
|
-
var import_semantic_ui_react3 = require("semantic-ui-react");
|
|
248
|
-
var import_utils5 = require("@rjsf/utils");
|
|
249
247
|
var import_core = require("@rjsf/core");
|
|
248
|
+
var import_utils5 = require("@rjsf/utils");
|
|
249
|
+
var import_semantic_ui_react3 = require("semantic-ui-react");
|
|
250
250
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
251
251
|
function BaseInputTemplate(props) {
|
|
252
252
|
const {
|
|
@@ -329,8 +329,8 @@ function DescriptionField(props) {
|
|
|
329
329
|
}
|
|
330
330
|
|
|
331
331
|
// src/ErrorList/ErrorList.tsx
|
|
332
|
-
var import_semantic_ui_react4 = require("semantic-ui-react");
|
|
333
332
|
var import_utils6 = require("@rjsf/utils");
|
|
333
|
+
var import_semantic_ui_react4 = require("semantic-ui-react");
|
|
334
334
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
335
335
|
function ErrorList({
|
|
336
336
|
errors,
|
|
@@ -343,59 +343,11 @@ function ErrorList({
|
|
|
343
343
|
] });
|
|
344
344
|
}
|
|
345
345
|
|
|
346
|
-
// src/IconButton/IconButton.tsx
|
|
347
|
-
var import_semantic_ui_react5 = require("semantic-ui-react");
|
|
348
|
-
var import_utils7 = require("@rjsf/utils");
|
|
349
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
350
|
-
function IconButton(props) {
|
|
351
|
-
const { icon, iconType, color, className, uiSchema, registry, ...otherProps } = props;
|
|
352
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
353
|
-
import_semantic_ui_react5.Button,
|
|
354
|
-
{
|
|
355
|
-
icon,
|
|
356
|
-
size: iconType,
|
|
357
|
-
color,
|
|
358
|
-
className,
|
|
359
|
-
...otherProps
|
|
360
|
-
}
|
|
361
|
-
);
|
|
362
|
-
}
|
|
363
|
-
function CopyButton(props) {
|
|
364
|
-
const {
|
|
365
|
-
registry: { translateString }
|
|
366
|
-
} = props;
|
|
367
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(IconButton, { title: translateString(import_utils7.TranslatableString.CopyButton), ...props, icon: "copy" });
|
|
368
|
-
}
|
|
369
|
-
function MoveDownButton(props) {
|
|
370
|
-
const {
|
|
371
|
-
registry: { translateString }
|
|
372
|
-
} = props;
|
|
373
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(IconButton, { title: translateString(import_utils7.TranslatableString.MoveDownButton), ...props, icon: "angle down" });
|
|
374
|
-
}
|
|
375
|
-
function MoveUpButton(props) {
|
|
376
|
-
const {
|
|
377
|
-
registry: { translateString }
|
|
378
|
-
} = props;
|
|
379
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(IconButton, { title: translateString(import_utils7.TranslatableString.MoveUpButton), ...props, icon: "angle up" });
|
|
380
|
-
}
|
|
381
|
-
function RemoveButton(props) {
|
|
382
|
-
const {
|
|
383
|
-
registry: { translateString }
|
|
384
|
-
} = props;
|
|
385
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(IconButton, { title: translateString(import_utils7.TranslatableString.RemoveButton), ...props, icon: "trash" });
|
|
386
|
-
}
|
|
387
|
-
function ClearButton(props) {
|
|
388
|
-
const {
|
|
389
|
-
registry: { translateString }
|
|
390
|
-
} = props;
|
|
391
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(IconButton, { title: translateString(import_utils7.TranslatableString.ClearButton), ...props, icon: "close" });
|
|
392
|
-
}
|
|
393
|
-
|
|
394
346
|
// src/FieldErrorTemplate/FieldErrorTemplate.tsx
|
|
395
|
-
var
|
|
347
|
+
var import_utils7 = require("@rjsf/utils");
|
|
396
348
|
var import_uniqueId = __toESM(require("lodash/uniqueId"), 1);
|
|
397
|
-
var
|
|
398
|
-
var
|
|
349
|
+
var import_semantic_ui_react5 = require("semantic-ui-react");
|
|
350
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
399
351
|
var DEFAULT_OPTIONS = {
|
|
400
352
|
options: {
|
|
401
353
|
pointing: "above",
|
|
@@ -411,29 +363,29 @@ function FieldErrorTemplate({ errors, fieldPathId, uiSchema, registry }) {
|
|
|
411
363
|
});
|
|
412
364
|
const { pointing, size } = options;
|
|
413
365
|
if (errors && errors.length > 0) {
|
|
414
|
-
const id = (0,
|
|
415
|
-
return /* @__PURE__ */ (0,
|
|
366
|
+
const id = (0, import_utils7.errorId)(fieldPathId);
|
|
367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_semantic_ui_react5.Label, { id, color: "red", pointing: pointing || "above", size: size || "small", basic: true, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_semantic_ui_react5.List, { bulleted: true, children: errors.map((error) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_semantic_ui_react5.List.Item, { children: error }, (0, import_uniqueId.default)("field-error-"))) }) });
|
|
416
368
|
}
|
|
417
369
|
return null;
|
|
418
370
|
}
|
|
419
371
|
|
|
420
372
|
// src/FieldHelpTemplate/FieldHelpTemplate.tsx
|
|
421
|
-
var import_utils9 = require("@rjsf/utils");
|
|
422
373
|
var import_core3 = require("@rjsf/core");
|
|
423
|
-
var
|
|
424
|
-
var
|
|
374
|
+
var import_utils8 = require("@rjsf/utils");
|
|
375
|
+
var import_semantic_ui_react6 = require("semantic-ui-react");
|
|
376
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
425
377
|
function FieldHelpTemplate(props) {
|
|
426
378
|
const { fieldPathId, help, uiSchema, registry } = props;
|
|
427
379
|
if (help) {
|
|
428
|
-
return /* @__PURE__ */ (0,
|
|
380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_semantic_ui_react6.Message, { size: "mini", info: true, id: (0, import_utils8.helpId)(fieldPathId), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core3.RichHelp, { help, registry, uiSchema }) });
|
|
429
381
|
}
|
|
430
382
|
return null;
|
|
431
383
|
}
|
|
432
384
|
|
|
433
385
|
// src/FieldTemplate/FieldTemplate.tsx
|
|
434
|
-
var
|
|
435
|
-
var
|
|
436
|
-
var
|
|
386
|
+
var import_utils9 = require("@rjsf/utils");
|
|
387
|
+
var import_semantic_ui_react7 = require("semantic-ui-react");
|
|
388
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
437
389
|
function FieldTemplate(props) {
|
|
438
390
|
const {
|
|
439
391
|
id,
|
|
@@ -457,17 +409,17 @@ function FieldTemplate(props) {
|
|
|
457
409
|
formContext: registry.formContext
|
|
458
410
|
});
|
|
459
411
|
const { wrapLabel, wrapContent } = semanticProps;
|
|
460
|
-
const uiOptions = (0,
|
|
461
|
-
const WrapIfAdditionalTemplate2 = (0,
|
|
412
|
+
const uiOptions = (0, import_utils9.getUiOptions)(uiSchema);
|
|
413
|
+
const WrapIfAdditionalTemplate2 = (0, import_utils9.getTemplate)(
|
|
462
414
|
"WrapIfAdditionalTemplate",
|
|
463
415
|
registry,
|
|
464
416
|
uiOptions
|
|
465
417
|
);
|
|
466
418
|
if (hidden) {
|
|
467
|
-
return /* @__PURE__ */ (0,
|
|
419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { display: "none" }, children });
|
|
468
420
|
}
|
|
469
421
|
const isCheckbox = uiOptions.widget === "checkbox";
|
|
470
|
-
return /* @__PURE__ */ (0,
|
|
422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
471
423
|
WrapIfAdditionalTemplate2,
|
|
472
424
|
{
|
|
473
425
|
classNames,
|
|
@@ -480,9 +432,9 @@ function FieldTemplate(props) {
|
|
|
480
432
|
schema,
|
|
481
433
|
uiSchema,
|
|
482
434
|
...otherProps,
|
|
483
|
-
children: /* @__PURE__ */ (0,
|
|
435
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_semantic_ui_react7.Form.Group, { widths: "equal", grouped: true, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(MaybeWrap, { wrap: wrapContent, className: "sui-field-content", children: [
|
|
484
436
|
children,
|
|
485
|
-
displayLabel && rawDescription && !isCheckbox && /* @__PURE__ */ (0,
|
|
437
|
+
displayLabel && rawDescription && !isCheckbox && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MaybeWrap, { wrap: wrapLabel, className: "sui-field-label", children: description }),
|
|
486
438
|
help,
|
|
487
439
|
errors
|
|
488
440
|
] }) }, id)
|
|
@@ -491,14 +443,62 @@ function FieldTemplate(props) {
|
|
|
491
443
|
}
|
|
492
444
|
|
|
493
445
|
// src/GridTemplate/GridTemplate.tsx
|
|
494
|
-
var
|
|
495
|
-
var
|
|
446
|
+
var import_semantic_ui_react8 = require("semantic-ui-react");
|
|
447
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
496
448
|
function GridTemplate(props) {
|
|
497
449
|
const { children, column, ...rest } = props;
|
|
498
450
|
if (column) {
|
|
499
|
-
return /* @__PURE__ */ (0,
|
|
451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_semantic_ui_react8.Grid.Column, { ...rest, children });
|
|
500
452
|
}
|
|
501
|
-
return /* @__PURE__ */ (0,
|
|
453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_semantic_ui_react8.Grid, { ...rest, children });
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
// src/IconButton/IconButton.tsx
|
|
457
|
+
var import_utils10 = require("@rjsf/utils");
|
|
458
|
+
var import_semantic_ui_react9 = require("semantic-ui-react");
|
|
459
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
460
|
+
function IconButton(props) {
|
|
461
|
+
const { icon, iconType, color, className, uiSchema, registry, ...otherProps } = props;
|
|
462
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
463
|
+
import_semantic_ui_react9.Button,
|
|
464
|
+
{
|
|
465
|
+
icon,
|
|
466
|
+
size: iconType,
|
|
467
|
+
color,
|
|
468
|
+
className,
|
|
469
|
+
...otherProps
|
|
470
|
+
}
|
|
471
|
+
);
|
|
472
|
+
}
|
|
473
|
+
function CopyButton(props) {
|
|
474
|
+
const {
|
|
475
|
+
registry: { translateString }
|
|
476
|
+
} = props;
|
|
477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconButton, { title: translateString(import_utils10.TranslatableString.CopyButton), ...props, icon: "copy" });
|
|
478
|
+
}
|
|
479
|
+
function MoveDownButton(props) {
|
|
480
|
+
const {
|
|
481
|
+
registry: { translateString }
|
|
482
|
+
} = props;
|
|
483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconButton, { title: translateString(import_utils10.TranslatableString.MoveDownButton), ...props, icon: "angle down" });
|
|
484
|
+
}
|
|
485
|
+
function MoveUpButton(props) {
|
|
486
|
+
const {
|
|
487
|
+
registry: { translateString }
|
|
488
|
+
} = props;
|
|
489
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconButton, { title: translateString(import_utils10.TranslatableString.MoveUpButton), ...props, icon: "angle up" });
|
|
490
|
+
}
|
|
491
|
+
function RemoveButton(props) {
|
|
492
|
+
const {
|
|
493
|
+
registry: { translateString }
|
|
494
|
+
} = props;
|
|
495
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconButton, { title: translateString(import_utils10.TranslatableString.RemoveButton), ...props, icon: "trash" });
|
|
496
|
+
}
|
|
497
|
+
function ClearButton(props) {
|
|
498
|
+
const {
|
|
499
|
+
registry: { translateString }
|
|
500
|
+
} = props;
|
|
501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconButton, { title: translateString(import_utils10.TranslatableString.ClearButton), ...props, icon: "close" });
|
|
502
502
|
}
|
|
503
503
|
|
|
504
504
|
// src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx
|
|
@@ -512,8 +512,8 @@ function MultiSchemaFieldTemplate(props) {
|
|
|
512
512
|
}
|
|
513
513
|
|
|
514
514
|
// src/ObjectFieldTemplate/ObjectFieldTemplate.tsx
|
|
515
|
-
var import_semantic_ui_react10 = require("semantic-ui-react");
|
|
516
515
|
var import_utils11 = require("@rjsf/utils");
|
|
516
|
+
var import_semantic_ui_react10 = require("semantic-ui-react");
|
|
517
517
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
518
518
|
function ObjectFieldTemplate(props) {
|
|
519
519
|
const {
|
|
@@ -624,8 +624,8 @@ function OptionalDataControlsTemplate(props) {
|
|
|
624
624
|
}
|
|
625
625
|
|
|
626
626
|
// src/SubmitButton/SubmitButton.tsx
|
|
627
|
-
var import_semantic_ui_react11 = require("semantic-ui-react");
|
|
628
627
|
var import_utils12 = require("@rjsf/utils");
|
|
628
|
+
var import_semantic_ui_react11 = require("semantic-ui-react");
|
|
629
629
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
630
630
|
function SubmitButton({ uiSchema }) {
|
|
631
631
|
const { submitText, norender, props: submitButtonProps = {} } = (0, import_utils12.getSubmitButtonOptions)(uiSchema);
|
|
@@ -759,10 +759,81 @@ function generateTemplates() {
|
|
|
759
759
|
}
|
|
760
760
|
var Templates_default = generateTemplates();
|
|
761
761
|
|
|
762
|
-
// src/
|
|
762
|
+
// src/CheckboxesWidget/CheckboxesWidget.tsx
|
|
763
763
|
var import_utils14 = require("@rjsf/utils");
|
|
764
764
|
var import_semantic_ui_react14 = require("semantic-ui-react");
|
|
765
765
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
766
|
+
function CheckboxesWidget(props) {
|
|
767
|
+
const {
|
|
768
|
+
id,
|
|
769
|
+
htmlName,
|
|
770
|
+
disabled,
|
|
771
|
+
options,
|
|
772
|
+
value,
|
|
773
|
+
autofocus,
|
|
774
|
+
readonly,
|
|
775
|
+
label,
|
|
776
|
+
hideLabel,
|
|
777
|
+
onChange,
|
|
778
|
+
onBlur,
|
|
779
|
+
onFocus,
|
|
780
|
+
schema,
|
|
781
|
+
uiSchema,
|
|
782
|
+
rawErrors = [],
|
|
783
|
+
registry
|
|
784
|
+
} = props;
|
|
785
|
+
const TitleFieldTemplate = (0, import_utils14.getTemplate)("TitleFieldTemplate", registry, options);
|
|
786
|
+
const { enumOptions, enumDisabled, inline } = options;
|
|
787
|
+
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
788
|
+
const semanticProps = getSemanticProps({
|
|
789
|
+
options,
|
|
790
|
+
formContext: registry.formContext,
|
|
791
|
+
uiSchema,
|
|
792
|
+
defaultSchemaProps: {
|
|
793
|
+
inverted: "false"
|
|
794
|
+
}
|
|
795
|
+
});
|
|
796
|
+
const _onChange = (index) => ({ target: { checked } }) => {
|
|
797
|
+
if (checked) {
|
|
798
|
+
onChange((0, import_utils14.enumOptionsSelectValue)(index, checkboxesValues, enumOptions));
|
|
799
|
+
} else {
|
|
800
|
+
onChange((0, import_utils14.enumOptionsDeselectValue)(index, checkboxesValues, enumOptions));
|
|
801
|
+
}
|
|
802
|
+
};
|
|
803
|
+
const _onBlur = () => onBlur(id, value);
|
|
804
|
+
const _onFocus = () => onFocus(id, value);
|
|
805
|
+
const inlineOption = inline ? { inline: true } : { grouped: true };
|
|
806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
807
|
+
!hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TitleFieldTemplate, { id: (0, import_utils14.titleId)(id), title: label, schema, uiSchema, registry }),
|
|
808
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_semantic_ui_react14.Form.Group, { id, name: htmlName || id, ...inlineOption, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
809
|
+
const checked = (0, import_utils14.enumOptionsIsSelected)(option.value, checkboxesValues);
|
|
810
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
811
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
812
|
+
import_semantic_ui_react14.Form.Checkbox,
|
|
813
|
+
{
|
|
814
|
+
id: (0, import_utils14.optionId)(id, index),
|
|
815
|
+
name: htmlName || id,
|
|
816
|
+
label: option.label,
|
|
817
|
+
...semanticProps,
|
|
818
|
+
checked,
|
|
819
|
+
error: rawErrors.length > 0,
|
|
820
|
+
disabled: disabled || itemDisabled || readonly,
|
|
821
|
+
autoFocus: autofocus && index === 0,
|
|
822
|
+
onChange: _onChange(index),
|
|
823
|
+
onBlur: _onBlur,
|
|
824
|
+
onFocus: _onFocus,
|
|
825
|
+
"aria-describedby": (0, import_utils14.ariaDescribedByIds)(id)
|
|
826
|
+
},
|
|
827
|
+
index
|
|
828
|
+
);
|
|
829
|
+
}) })
|
|
830
|
+
] });
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
// src/CheckboxWidget/CheckboxWidget.tsx
|
|
834
|
+
var import_utils15 = require("@rjsf/utils");
|
|
835
|
+
var import_semantic_ui_react15 = require("semantic-ui-react");
|
|
836
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
766
837
|
function CheckboxWidget(props) {
|
|
767
838
|
const {
|
|
768
839
|
id,
|
|
@@ -790,30 +861,30 @@ function CheckboxWidget(props) {
|
|
|
790
861
|
inverted: "false"
|
|
791
862
|
}
|
|
792
863
|
});
|
|
793
|
-
const DescriptionFieldTemplate = (0,
|
|
864
|
+
const DescriptionFieldTemplate = (0, import_utils15.getTemplate)(
|
|
794
865
|
"DescriptionFieldTemplate",
|
|
795
866
|
registry,
|
|
796
867
|
options
|
|
797
868
|
);
|
|
798
|
-
const required = (0,
|
|
869
|
+
const required = (0, import_utils15.schemaRequiresTrueValue)(schema);
|
|
799
870
|
const checked = value == "true" || value == true;
|
|
800
871
|
const _onChange = (_, data) => onChange && onChange(data.checked);
|
|
801
872
|
const _onBlur = () => onBlur && onBlur(id, value);
|
|
802
873
|
const _onFocus = () => onFocus && onFocus(id, value);
|
|
803
874
|
const description = options.description ?? schema.description;
|
|
804
|
-
return /* @__PURE__ */ (0,
|
|
805
|
-
!hideLabel && description && /* @__PURE__ */ (0,
|
|
875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
876
|
+
!hideLabel && description && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
806
877
|
DescriptionFieldTemplate,
|
|
807
878
|
{
|
|
808
|
-
id: (0,
|
|
879
|
+
id: (0, import_utils15.descriptionId)(id),
|
|
809
880
|
description,
|
|
810
881
|
schema,
|
|
811
882
|
uiSchema,
|
|
812
883
|
registry
|
|
813
884
|
}
|
|
814
885
|
),
|
|
815
|
-
/* @__PURE__ */ (0,
|
|
816
|
-
|
|
886
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
887
|
+
import_semantic_ui_react15.Form.Checkbox,
|
|
817
888
|
{
|
|
818
889
|
id,
|
|
819
890
|
name: htmlName || id,
|
|
@@ -826,84 +897,13 @@ function CheckboxWidget(props) {
|
|
|
826
897
|
onBlur: _onBlur,
|
|
827
898
|
onFocus: _onFocus,
|
|
828
899
|
required,
|
|
829
|
-
label: (0,
|
|
830
|
-
"aria-describedby": (0,
|
|
900
|
+
label: (0, import_utils15.labelValue)(label, hideLabel, false),
|
|
901
|
+
"aria-describedby": (0, import_utils15.ariaDescribedByIds)(id)
|
|
831
902
|
}
|
|
832
903
|
)
|
|
833
904
|
] });
|
|
834
905
|
}
|
|
835
906
|
|
|
836
|
-
// src/CheckboxesWidget/CheckboxesWidget.tsx
|
|
837
|
-
var import_semantic_ui_react15 = require("semantic-ui-react");
|
|
838
|
-
var import_utils15 = require("@rjsf/utils");
|
|
839
|
-
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
840
|
-
function CheckboxesWidget(props) {
|
|
841
|
-
const {
|
|
842
|
-
id,
|
|
843
|
-
htmlName,
|
|
844
|
-
disabled,
|
|
845
|
-
options,
|
|
846
|
-
value,
|
|
847
|
-
autofocus,
|
|
848
|
-
readonly,
|
|
849
|
-
label,
|
|
850
|
-
hideLabel,
|
|
851
|
-
onChange,
|
|
852
|
-
onBlur,
|
|
853
|
-
onFocus,
|
|
854
|
-
schema,
|
|
855
|
-
uiSchema,
|
|
856
|
-
rawErrors = [],
|
|
857
|
-
registry
|
|
858
|
-
} = props;
|
|
859
|
-
const TitleFieldTemplate = (0, import_utils15.getTemplate)("TitleFieldTemplate", registry, options);
|
|
860
|
-
const { enumOptions, enumDisabled, inline } = options;
|
|
861
|
-
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
862
|
-
const semanticProps = getSemanticProps({
|
|
863
|
-
options,
|
|
864
|
-
formContext: registry.formContext,
|
|
865
|
-
uiSchema,
|
|
866
|
-
defaultSchemaProps: {
|
|
867
|
-
inverted: "false"
|
|
868
|
-
}
|
|
869
|
-
});
|
|
870
|
-
const _onChange = (index) => ({ target: { checked } }) => {
|
|
871
|
-
if (checked) {
|
|
872
|
-
onChange((0, import_utils15.enumOptionsSelectValue)(index, checkboxesValues, enumOptions));
|
|
873
|
-
} else {
|
|
874
|
-
onChange((0, import_utils15.enumOptionsDeselectValue)(index, checkboxesValues, enumOptions));
|
|
875
|
-
}
|
|
876
|
-
};
|
|
877
|
-
const _onBlur = () => onBlur(id, value);
|
|
878
|
-
const _onFocus = () => onFocus(id, value);
|
|
879
|
-
const inlineOption = inline ? { inline: true } : { grouped: true };
|
|
880
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
881
|
-
!hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TitleFieldTemplate, { id: (0, import_utils15.titleId)(id), title: label, schema, uiSchema, registry }),
|
|
882
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_semantic_ui_react15.Form.Group, { id, name: htmlName || id, ...inlineOption, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
883
|
-
const checked = (0, import_utils15.enumOptionsIsSelected)(option.value, checkboxesValues);
|
|
884
|
-
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
885
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
886
|
-
import_semantic_ui_react15.Form.Checkbox,
|
|
887
|
-
{
|
|
888
|
-
id: (0, import_utils15.optionId)(id, index),
|
|
889
|
-
name: htmlName || id,
|
|
890
|
-
label: option.label,
|
|
891
|
-
...semanticProps,
|
|
892
|
-
checked,
|
|
893
|
-
error: rawErrors.length > 0,
|
|
894
|
-
disabled: disabled || itemDisabled || readonly,
|
|
895
|
-
autoFocus: autofocus && index === 0,
|
|
896
|
-
onChange: _onChange(index),
|
|
897
|
-
onBlur: _onBlur,
|
|
898
|
-
onFocus: _onFocus,
|
|
899
|
-
"aria-describedby": (0, import_utils15.ariaDescribedByIds)(id)
|
|
900
|
-
},
|
|
901
|
-
index
|
|
902
|
-
);
|
|
903
|
-
}) })
|
|
904
|
-
] });
|
|
905
|
-
}
|
|
906
|
-
|
|
907
907
|
// src/RadioWidget/RadioWidget.tsx
|
|
908
908
|
var import_utils16 = require("@rjsf/utils");
|
|
909
909
|
var import_semantic_ui_react16 = require("semantic-ui-react");
|
|
@@ -965,8 +965,8 @@ function RadioWidget(props) {
|
|
|
965
965
|
}
|
|
966
966
|
|
|
967
967
|
// src/RangeWidget/RangeWidget.tsx
|
|
968
|
-
var import_semantic_ui_react17 = require("semantic-ui-react");
|
|
969
968
|
var import_utils17 = require("@rjsf/utils");
|
|
969
|
+
var import_semantic_ui_react17 = require("semantic-ui-react");
|
|
970
970
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
971
971
|
function RangeWidget(props) {
|
|
972
972
|
const {
|