@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/semantic-ui.esm.js
CHANGED
|
@@ -5,8 +5,8 @@ import { withTheme } from "@rjsf/core";
|
|
|
5
5
|
import { Form as SuiForm } from "semantic-ui-react";
|
|
6
6
|
|
|
7
7
|
// src/AddButton/AddButton.tsx
|
|
8
|
-
import { Button, Icon } from "semantic-ui-react";
|
|
9
8
|
import { TranslatableString } from "@rjsf/utils";
|
|
9
|
+
import { Button, Icon } from "semantic-ui-react";
|
|
10
10
|
import { jsx } from "react/jsx-runtime";
|
|
11
11
|
function AddButton({
|
|
12
12
|
uiSchema,
|
|
@@ -210,14 +210,14 @@ function ArrayFieldTemplate(props) {
|
|
|
210
210
|
|
|
211
211
|
// src/BaseInputTemplate/BaseInputTemplate.tsx
|
|
212
212
|
import { useCallback } from "react";
|
|
213
|
-
import {
|
|
213
|
+
import { SchemaExamples } from "@rjsf/core";
|
|
214
214
|
import {
|
|
215
215
|
ariaDescribedByIds,
|
|
216
216
|
examplesId,
|
|
217
217
|
getInputProps,
|
|
218
218
|
labelValue
|
|
219
219
|
} from "@rjsf/utils";
|
|
220
|
-
import {
|
|
220
|
+
import { Form } from "semantic-ui-react";
|
|
221
221
|
import { Fragment, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
222
222
|
function BaseInputTemplate(props) {
|
|
223
223
|
const {
|
|
@@ -300,8 +300,8 @@ function DescriptionField(props) {
|
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
// src/ErrorList/ErrorList.tsx
|
|
303
|
-
import { Message } from "semantic-ui-react";
|
|
304
303
|
import { TranslatableString as TranslatableString2 } from "@rjsf/utils";
|
|
304
|
+
import { Message } from "semantic-ui-react";
|
|
305
305
|
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
306
306
|
function ErrorList({
|
|
307
307
|
errors,
|
|
@@ -314,59 +314,11 @@ function ErrorList({
|
|
|
314
314
|
] });
|
|
315
315
|
}
|
|
316
316
|
|
|
317
|
-
// src/IconButton/IconButton.tsx
|
|
318
|
-
import { Button as Button3 } from "semantic-ui-react";
|
|
319
|
-
import { TranslatableString as TranslatableString3 } from "@rjsf/utils";
|
|
320
|
-
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
321
|
-
function IconButton(props) {
|
|
322
|
-
const { icon, iconType, color, className, uiSchema, registry, ...otherProps } = props;
|
|
323
|
-
return /* @__PURE__ */ jsx8(
|
|
324
|
-
Button3,
|
|
325
|
-
{
|
|
326
|
-
icon,
|
|
327
|
-
size: iconType,
|
|
328
|
-
color,
|
|
329
|
-
className,
|
|
330
|
-
...otherProps
|
|
331
|
-
}
|
|
332
|
-
);
|
|
333
|
-
}
|
|
334
|
-
function CopyButton(props) {
|
|
335
|
-
const {
|
|
336
|
-
registry: { translateString }
|
|
337
|
-
} = props;
|
|
338
|
-
return /* @__PURE__ */ jsx8(IconButton, { title: translateString(TranslatableString3.CopyButton), ...props, icon: "copy" });
|
|
339
|
-
}
|
|
340
|
-
function MoveDownButton(props) {
|
|
341
|
-
const {
|
|
342
|
-
registry: { translateString }
|
|
343
|
-
} = props;
|
|
344
|
-
return /* @__PURE__ */ jsx8(IconButton, { title: translateString(TranslatableString3.MoveDownButton), ...props, icon: "angle down" });
|
|
345
|
-
}
|
|
346
|
-
function MoveUpButton(props) {
|
|
347
|
-
const {
|
|
348
|
-
registry: { translateString }
|
|
349
|
-
} = props;
|
|
350
|
-
return /* @__PURE__ */ jsx8(IconButton, { title: translateString(TranslatableString3.MoveUpButton), ...props, icon: "angle up" });
|
|
351
|
-
}
|
|
352
|
-
function RemoveButton(props) {
|
|
353
|
-
const {
|
|
354
|
-
registry: { translateString }
|
|
355
|
-
} = props;
|
|
356
|
-
return /* @__PURE__ */ jsx8(IconButton, { title: translateString(TranslatableString3.RemoveButton), ...props, icon: "trash" });
|
|
357
|
-
}
|
|
358
|
-
function ClearButton(props) {
|
|
359
|
-
const {
|
|
360
|
-
registry: { translateString }
|
|
361
|
-
} = props;
|
|
362
|
-
return /* @__PURE__ */ jsx8(IconButton, { title: translateString(TranslatableString3.ClearButton), ...props, icon: "close" });
|
|
363
|
-
}
|
|
364
|
-
|
|
365
317
|
// src/FieldErrorTemplate/FieldErrorTemplate.tsx
|
|
366
318
|
import { errorId } from "@rjsf/utils";
|
|
367
319
|
import uniqueId from "lodash/uniqueId";
|
|
368
320
|
import { Label, List } from "semantic-ui-react";
|
|
369
|
-
import { jsx as
|
|
321
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
370
322
|
var DEFAULT_OPTIONS = {
|
|
371
323
|
options: {
|
|
372
324
|
pointing: "above",
|
|
@@ -383,20 +335,20 @@ function FieldErrorTemplate({ errors, fieldPathId, uiSchema, registry }) {
|
|
|
383
335
|
const { pointing, size } = options;
|
|
384
336
|
if (errors && errors.length > 0) {
|
|
385
337
|
const id = errorId(fieldPathId);
|
|
386
|
-
return /* @__PURE__ */
|
|
338
|
+
return /* @__PURE__ */ jsx8(Label, { id, color: "red", pointing: pointing || "above", size: size || "small", basic: true, children: /* @__PURE__ */ jsx8(List, { bulleted: true, children: errors.map((error) => /* @__PURE__ */ jsx8(List.Item, { children: error }, uniqueId("field-error-"))) }) });
|
|
387
339
|
}
|
|
388
340
|
return null;
|
|
389
341
|
}
|
|
390
342
|
|
|
391
343
|
// src/FieldHelpTemplate/FieldHelpTemplate.tsx
|
|
392
|
-
import { helpId } from "@rjsf/utils";
|
|
393
344
|
import { RichHelp } from "@rjsf/core";
|
|
345
|
+
import { helpId } from "@rjsf/utils";
|
|
394
346
|
import { Message as Message2 } from "semantic-ui-react";
|
|
395
|
-
import { jsx as
|
|
347
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
396
348
|
function FieldHelpTemplate(props) {
|
|
397
349
|
const { fieldPathId, help, uiSchema, registry } = props;
|
|
398
350
|
if (help) {
|
|
399
|
-
return /* @__PURE__ */
|
|
351
|
+
return /* @__PURE__ */ jsx9(Message2, { size: "mini", info: true, id: helpId(fieldPathId), children: /* @__PURE__ */ jsx9(RichHelp, { help, registry, uiSchema }) });
|
|
400
352
|
}
|
|
401
353
|
return null;
|
|
402
354
|
}
|
|
@@ -407,7 +359,7 @@ import {
|
|
|
407
359
|
getUiOptions as getUiOptions4
|
|
408
360
|
} from "@rjsf/utils";
|
|
409
361
|
import { Form as Form2 } from "semantic-ui-react";
|
|
410
|
-
import { jsx as
|
|
362
|
+
import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
411
363
|
function FieldTemplate(props) {
|
|
412
364
|
const {
|
|
413
365
|
id,
|
|
@@ -438,10 +390,10 @@ function FieldTemplate(props) {
|
|
|
438
390
|
uiOptions
|
|
439
391
|
);
|
|
440
392
|
if (hidden) {
|
|
441
|
-
return /* @__PURE__ */
|
|
393
|
+
return /* @__PURE__ */ jsx10("div", { style: { display: "none" }, children });
|
|
442
394
|
}
|
|
443
395
|
const isCheckbox = uiOptions.widget === "checkbox";
|
|
444
|
-
return /* @__PURE__ */
|
|
396
|
+
return /* @__PURE__ */ jsx10(
|
|
445
397
|
WrapIfAdditionalTemplate2,
|
|
446
398
|
{
|
|
447
399
|
classNames,
|
|
@@ -454,9 +406,9 @@ function FieldTemplate(props) {
|
|
|
454
406
|
schema,
|
|
455
407
|
uiSchema,
|
|
456
408
|
...otherProps,
|
|
457
|
-
children: /* @__PURE__ */
|
|
409
|
+
children: /* @__PURE__ */ jsx10(Form2.Group, { widths: "equal", grouped: true, children: /* @__PURE__ */ jsxs5(MaybeWrap, { wrap: wrapContent, className: "sui-field-content", children: [
|
|
458
410
|
children,
|
|
459
|
-
displayLabel && rawDescription && !isCheckbox && /* @__PURE__ */
|
|
411
|
+
displayLabel && rawDescription && !isCheckbox && /* @__PURE__ */ jsx10(MaybeWrap, { wrap: wrapLabel, className: "sui-field-label", children: description }),
|
|
460
412
|
help,
|
|
461
413
|
errors
|
|
462
414
|
] }) }, id)
|
|
@@ -466,13 +418,61 @@ function FieldTemplate(props) {
|
|
|
466
418
|
|
|
467
419
|
// src/GridTemplate/GridTemplate.tsx
|
|
468
420
|
import { Grid as Grid2 } from "semantic-ui-react";
|
|
469
|
-
import { jsx as
|
|
421
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
470
422
|
function GridTemplate(props) {
|
|
471
423
|
const { children, column, ...rest } = props;
|
|
472
424
|
if (column) {
|
|
473
|
-
return /* @__PURE__ */
|
|
425
|
+
return /* @__PURE__ */ jsx11(Grid2.Column, { ...rest, children });
|
|
474
426
|
}
|
|
475
|
-
return /* @__PURE__ */
|
|
427
|
+
return /* @__PURE__ */ jsx11(Grid2, { ...rest, children });
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// src/IconButton/IconButton.tsx
|
|
431
|
+
import { TranslatableString as TranslatableString3 } from "@rjsf/utils";
|
|
432
|
+
import { Button as Button3 } from "semantic-ui-react";
|
|
433
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
434
|
+
function IconButton(props) {
|
|
435
|
+
const { icon, iconType, color, className, uiSchema, registry, ...otherProps } = props;
|
|
436
|
+
return /* @__PURE__ */ jsx12(
|
|
437
|
+
Button3,
|
|
438
|
+
{
|
|
439
|
+
icon,
|
|
440
|
+
size: iconType,
|
|
441
|
+
color,
|
|
442
|
+
className,
|
|
443
|
+
...otherProps
|
|
444
|
+
}
|
|
445
|
+
);
|
|
446
|
+
}
|
|
447
|
+
function CopyButton(props) {
|
|
448
|
+
const {
|
|
449
|
+
registry: { translateString }
|
|
450
|
+
} = props;
|
|
451
|
+
return /* @__PURE__ */ jsx12(IconButton, { title: translateString(TranslatableString3.CopyButton), ...props, icon: "copy" });
|
|
452
|
+
}
|
|
453
|
+
function MoveDownButton(props) {
|
|
454
|
+
const {
|
|
455
|
+
registry: { translateString }
|
|
456
|
+
} = props;
|
|
457
|
+
return /* @__PURE__ */ jsx12(IconButton, { title: translateString(TranslatableString3.MoveDownButton), ...props, icon: "angle down" });
|
|
458
|
+
}
|
|
459
|
+
function MoveUpButton(props) {
|
|
460
|
+
const {
|
|
461
|
+
registry: { translateString }
|
|
462
|
+
} = props;
|
|
463
|
+
return /* @__PURE__ */ jsx12(IconButton, { title: translateString(TranslatableString3.MoveUpButton), ...props, icon: "angle up" });
|
|
464
|
+
}
|
|
465
|
+
function RemoveButton(props) {
|
|
466
|
+
const {
|
|
467
|
+
registry: { translateString }
|
|
468
|
+
} = props;
|
|
469
|
+
return /* @__PURE__ */ jsx12(IconButton, { title: translateString(TranslatableString3.RemoveButton), ...props, icon: "trash" });
|
|
470
|
+
}
|
|
471
|
+
function ClearButton(props) {
|
|
472
|
+
const {
|
|
473
|
+
registry: { translateString }
|
|
474
|
+
} = props;
|
|
475
|
+
return /* @__PURE__ */ jsx12(IconButton, { title: translateString(TranslatableString3.ClearButton), ...props, icon: "close" });
|
|
476
476
|
}
|
|
477
477
|
|
|
478
478
|
// src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx
|
|
@@ -486,7 +486,6 @@ function MultiSchemaFieldTemplate(props) {
|
|
|
486
486
|
}
|
|
487
487
|
|
|
488
488
|
// src/ObjectFieldTemplate/ObjectFieldTemplate.tsx
|
|
489
|
-
import { Grid as Grid3 } from "semantic-ui-react";
|
|
490
489
|
import {
|
|
491
490
|
canExpand,
|
|
492
491
|
descriptionId,
|
|
@@ -495,6 +494,7 @@ import {
|
|
|
495
494
|
titleId,
|
|
496
495
|
buttonId as buttonId2
|
|
497
496
|
} from "@rjsf/utils";
|
|
497
|
+
import { Grid as Grid3 } from "semantic-ui-react";
|
|
498
498
|
import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
499
499
|
function ObjectFieldTemplate(props) {
|
|
500
500
|
const {
|
|
@@ -605,8 +605,8 @@ function OptionalDataControlsTemplate(props) {
|
|
|
605
605
|
}
|
|
606
606
|
|
|
607
607
|
// src/SubmitButton/SubmitButton.tsx
|
|
608
|
-
import { Button as Button4 } from "semantic-ui-react";
|
|
609
608
|
import { getSubmitButtonOptions } from "@rjsf/utils";
|
|
609
|
+
import { Button as Button4 } from "semantic-ui-react";
|
|
610
610
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
611
611
|
function SubmitButton({ uiSchema }) {
|
|
612
612
|
const { submitText, norender, props: submitButtonProps = {} } = getSubmitButtonOptions(uiSchema);
|
|
@@ -744,16 +744,95 @@ function generateTemplates() {
|
|
|
744
744
|
}
|
|
745
745
|
var Templates_default = generateTemplates();
|
|
746
746
|
|
|
747
|
-
// src/
|
|
747
|
+
// src/CheckboxesWidget/CheckboxesWidget.tsx
|
|
748
748
|
import {
|
|
749
749
|
ariaDescribedByIds as ariaDescribedByIds2,
|
|
750
|
-
|
|
750
|
+
enumOptionsDeselectValue,
|
|
751
|
+
enumOptionsIsSelected,
|
|
752
|
+
enumOptionsSelectValue,
|
|
751
753
|
getTemplate as getTemplate5,
|
|
752
|
-
|
|
753
|
-
|
|
754
|
+
optionId,
|
|
755
|
+
titleId as titleId2
|
|
754
756
|
} from "@rjsf/utils";
|
|
755
757
|
import { Form as Form4 } from "semantic-ui-react";
|
|
756
758
|
import { Fragment as Fragment3, jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
759
|
+
function CheckboxesWidget(props) {
|
|
760
|
+
const {
|
|
761
|
+
id,
|
|
762
|
+
htmlName,
|
|
763
|
+
disabled,
|
|
764
|
+
options,
|
|
765
|
+
value,
|
|
766
|
+
autofocus,
|
|
767
|
+
readonly,
|
|
768
|
+
label,
|
|
769
|
+
hideLabel,
|
|
770
|
+
onChange,
|
|
771
|
+
onBlur,
|
|
772
|
+
onFocus,
|
|
773
|
+
schema,
|
|
774
|
+
uiSchema,
|
|
775
|
+
rawErrors = [],
|
|
776
|
+
registry
|
|
777
|
+
} = props;
|
|
778
|
+
const TitleFieldTemplate = getTemplate5("TitleFieldTemplate", registry, options);
|
|
779
|
+
const { enumOptions, enumDisabled, inline } = options;
|
|
780
|
+
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
781
|
+
const semanticProps = getSemanticProps({
|
|
782
|
+
options,
|
|
783
|
+
formContext: registry.formContext,
|
|
784
|
+
uiSchema,
|
|
785
|
+
defaultSchemaProps: {
|
|
786
|
+
inverted: "false"
|
|
787
|
+
}
|
|
788
|
+
});
|
|
789
|
+
const _onChange = (index) => ({ target: { checked } }) => {
|
|
790
|
+
if (checked) {
|
|
791
|
+
onChange(enumOptionsSelectValue(index, checkboxesValues, enumOptions));
|
|
792
|
+
} else {
|
|
793
|
+
onChange(enumOptionsDeselectValue(index, checkboxesValues, enumOptions));
|
|
794
|
+
}
|
|
795
|
+
};
|
|
796
|
+
const _onBlur = () => onBlur(id, value);
|
|
797
|
+
const _onFocus = () => onFocus(id, value);
|
|
798
|
+
const inlineOption = inline ? { inline: true } : { grouped: true };
|
|
799
|
+
return /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
800
|
+
!hideLabel && !!label && /* @__PURE__ */ jsx19(TitleFieldTemplate, { id: titleId2(id), title: label, schema, uiSchema, registry }),
|
|
801
|
+
/* @__PURE__ */ jsx19(Form4.Group, { id, name: htmlName || id, ...inlineOption, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
802
|
+
const checked = enumOptionsIsSelected(option.value, checkboxesValues);
|
|
803
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
804
|
+
return /* @__PURE__ */ jsx19(
|
|
805
|
+
Form4.Checkbox,
|
|
806
|
+
{
|
|
807
|
+
id: optionId(id, index),
|
|
808
|
+
name: htmlName || id,
|
|
809
|
+
label: option.label,
|
|
810
|
+
...semanticProps,
|
|
811
|
+
checked,
|
|
812
|
+
error: rawErrors.length > 0,
|
|
813
|
+
disabled: disabled || itemDisabled || readonly,
|
|
814
|
+
autoFocus: autofocus && index === 0,
|
|
815
|
+
onChange: _onChange(index),
|
|
816
|
+
onBlur: _onBlur,
|
|
817
|
+
onFocus: _onFocus,
|
|
818
|
+
"aria-describedby": ariaDescribedByIds2(id)
|
|
819
|
+
},
|
|
820
|
+
index
|
|
821
|
+
);
|
|
822
|
+
}) })
|
|
823
|
+
] });
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
// 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";
|
|
834
|
+
import { Form as Form5 } from "semantic-ui-react";
|
|
835
|
+
import { Fragment as Fragment4, jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
757
836
|
function CheckboxWidget(props) {
|
|
758
837
|
const {
|
|
759
838
|
id,
|
|
@@ -781,7 +860,7 @@ function CheckboxWidget(props) {
|
|
|
781
860
|
inverted: "false"
|
|
782
861
|
}
|
|
783
862
|
});
|
|
784
|
-
const DescriptionFieldTemplate =
|
|
863
|
+
const DescriptionFieldTemplate = getTemplate6(
|
|
785
864
|
"DescriptionFieldTemplate",
|
|
786
865
|
registry,
|
|
787
866
|
options
|
|
@@ -792,8 +871,8 @@ function CheckboxWidget(props) {
|
|
|
792
871
|
const _onBlur = () => onBlur && onBlur(id, value);
|
|
793
872
|
const _onFocus = () => onFocus && onFocus(id, value);
|
|
794
873
|
const description = options.description ?? schema.description;
|
|
795
|
-
return /* @__PURE__ */
|
|
796
|
-
!hideLabel && description && /* @__PURE__ */
|
|
874
|
+
return /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
875
|
+
!hideLabel && description && /* @__PURE__ */ jsx20(
|
|
797
876
|
DescriptionFieldTemplate,
|
|
798
877
|
{
|
|
799
878
|
id: descriptionId2(id),
|
|
@@ -803,8 +882,8 @@ function CheckboxWidget(props) {
|
|
|
803
882
|
registry
|
|
804
883
|
}
|
|
805
884
|
),
|
|
806
|
-
/* @__PURE__ */
|
|
807
|
-
|
|
885
|
+
/* @__PURE__ */ jsx20(
|
|
886
|
+
Form5.Checkbox,
|
|
808
887
|
{
|
|
809
888
|
id,
|
|
810
889
|
name: htmlName || id,
|
|
@@ -818,91 +897,12 @@ function CheckboxWidget(props) {
|
|
|
818
897
|
onFocus: _onFocus,
|
|
819
898
|
required,
|
|
820
899
|
label: labelValue2(label, hideLabel, false),
|
|
821
|
-
"aria-describedby":
|
|
900
|
+
"aria-describedby": ariaDescribedByIds3(id)
|
|
822
901
|
}
|
|
823
902
|
)
|
|
824
903
|
] });
|
|
825
904
|
}
|
|
826
905
|
|
|
827
|
-
// src/CheckboxesWidget/CheckboxesWidget.tsx
|
|
828
|
-
import { Form as Form5 } from "semantic-ui-react";
|
|
829
|
-
import {
|
|
830
|
-
ariaDescribedByIds as ariaDescribedByIds3,
|
|
831
|
-
enumOptionsDeselectValue,
|
|
832
|
-
enumOptionsIsSelected,
|
|
833
|
-
enumOptionsSelectValue,
|
|
834
|
-
getTemplate as getTemplate6,
|
|
835
|
-
optionId,
|
|
836
|
-
titleId as titleId2
|
|
837
|
-
} from "@rjsf/utils";
|
|
838
|
-
import { Fragment as Fragment4, jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
839
|
-
function CheckboxesWidget(props) {
|
|
840
|
-
const {
|
|
841
|
-
id,
|
|
842
|
-
htmlName,
|
|
843
|
-
disabled,
|
|
844
|
-
options,
|
|
845
|
-
value,
|
|
846
|
-
autofocus,
|
|
847
|
-
readonly,
|
|
848
|
-
label,
|
|
849
|
-
hideLabel,
|
|
850
|
-
onChange,
|
|
851
|
-
onBlur,
|
|
852
|
-
onFocus,
|
|
853
|
-
schema,
|
|
854
|
-
uiSchema,
|
|
855
|
-
rawErrors = [],
|
|
856
|
-
registry
|
|
857
|
-
} = props;
|
|
858
|
-
const TitleFieldTemplate = getTemplate6("TitleFieldTemplate", registry, options);
|
|
859
|
-
const { enumOptions, enumDisabled, inline } = options;
|
|
860
|
-
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
861
|
-
const semanticProps = getSemanticProps({
|
|
862
|
-
options,
|
|
863
|
-
formContext: registry.formContext,
|
|
864
|
-
uiSchema,
|
|
865
|
-
defaultSchemaProps: {
|
|
866
|
-
inverted: "false"
|
|
867
|
-
}
|
|
868
|
-
});
|
|
869
|
-
const _onChange = (index) => ({ target: { checked } }) => {
|
|
870
|
-
if (checked) {
|
|
871
|
-
onChange(enumOptionsSelectValue(index, checkboxesValues, enumOptions));
|
|
872
|
-
} else {
|
|
873
|
-
onChange(enumOptionsDeselectValue(index, checkboxesValues, enumOptions));
|
|
874
|
-
}
|
|
875
|
-
};
|
|
876
|
-
const _onBlur = () => onBlur(id, value);
|
|
877
|
-
const _onFocus = () => onFocus(id, value);
|
|
878
|
-
const inlineOption = inline ? { inline: true } : { grouped: true };
|
|
879
|
-
return /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
880
|
-
!hideLabel && !!label && /* @__PURE__ */ jsx20(TitleFieldTemplate, { id: titleId2(id), title: label, schema, uiSchema, registry }),
|
|
881
|
-
/* @__PURE__ */ jsx20(Form5.Group, { id, name: htmlName || id, ...inlineOption, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
882
|
-
const checked = enumOptionsIsSelected(option.value, checkboxesValues);
|
|
883
|
-
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
884
|
-
return /* @__PURE__ */ jsx20(
|
|
885
|
-
Form5.Checkbox,
|
|
886
|
-
{
|
|
887
|
-
id: optionId(id, index),
|
|
888
|
-
name: htmlName || id,
|
|
889
|
-
label: option.label,
|
|
890
|
-
...semanticProps,
|
|
891
|
-
checked,
|
|
892
|
-
error: rawErrors.length > 0,
|
|
893
|
-
disabled: disabled || itemDisabled || readonly,
|
|
894
|
-
autoFocus: autofocus && index === 0,
|
|
895
|
-
onChange: _onChange(index),
|
|
896
|
-
onBlur: _onBlur,
|
|
897
|
-
onFocus: _onFocus,
|
|
898
|
-
"aria-describedby": ariaDescribedByIds3(id)
|
|
899
|
-
},
|
|
900
|
-
index
|
|
901
|
-
);
|
|
902
|
-
}) })
|
|
903
|
-
] });
|
|
904
|
-
}
|
|
905
|
-
|
|
906
906
|
// src/RadioWidget/RadioWidget.tsx
|
|
907
907
|
import {
|
|
908
908
|
ariaDescribedByIds as ariaDescribedByIds4,
|
|
@@ -971,8 +971,8 @@ function RadioWidget(props) {
|
|
|
971
971
|
}
|
|
972
972
|
|
|
973
973
|
// src/RangeWidget/RangeWidget.tsx
|
|
974
|
-
import { Input } from "semantic-ui-react";
|
|
975
974
|
import { ariaDescribedByIds as ariaDescribedByIds5, rangeSpec } from "@rjsf/utils";
|
|
975
|
+
import { Input } from "semantic-ui-react";
|
|
976
976
|
import { Fragment as Fragment5, jsx as jsx22, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
977
977
|
function RangeWidget(props) {
|
|
978
978
|
const {
|