@rjsf/mantine 6.0.0-beta.20 → 6.0.0-beta.22
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 +187 -139
- package/dist/index.cjs.map +4 -4
- package/dist/mantine.esm.js +186 -138
- package/dist/mantine.esm.js.map +4 -4
- package/dist/mantine.umd.js +75 -29
- package/lib/templates/ArrayFieldItemTemplate.d.ts +3 -3
- package/lib/templates/ArrayFieldItemTemplate.js +1 -1
- package/lib/templates/ArrayFieldItemTemplate.js.map +1 -1
- package/lib/templates/ArrayFieldTemplate.d.ts +1 -1
- package/lib/templates/ArrayFieldTemplate.js +5 -6
- package/lib/templates/ArrayFieldTemplate.js.map +1 -1
- package/lib/templates/BaseInputTemplate.js +2 -2
- package/lib/templates/BaseInputTemplate.js.map +1 -1
- package/lib/templates/ObjectFieldTemplate.js +5 -4
- package/lib/templates/ObjectFieldTemplate.js.map +1 -1
- package/lib/templates/OptionalDataControlsTemplate.d.ts +10 -0
- package/lib/templates/OptionalDataControlsTemplate.js +22 -0
- package/lib/templates/OptionalDataControlsTemplate.js.map +1 -0
- package/lib/templates/TitleField.js +8 -4
- package/lib/templates/TitleField.js.map +1 -1
- package/lib/templates/WrapIfAdditionalTemplate.js +2 -4
- package/lib/templates/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/templates/index.js +2 -0
- package/lib/templates/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/widgets/CheckboxWidget.js +2 -2
- package/lib/widgets/CheckboxWidget.js.map +1 -1
- package/lib/widgets/CheckboxesWidget.js +2 -2
- package/lib/widgets/CheckboxesWidget.js.map +1 -1
- package/lib/widgets/RadioWidget.js +2 -2
- package/lib/widgets/RadioWidget.js.map +1 -1
- package/lib/widgets/SelectWidget.js +2 -2
- package/lib/widgets/SelectWidget.js.map +1 -1
- package/lib/widgets/TextareaWidget.js +2 -2
- package/lib/widgets/TextareaWidget.js.map +1 -1
- package/package.json +7 -7
- package/src/templates/ArrayFieldItemTemplate.tsx +3 -3
- package/src/templates/ArrayFieldTemplate.tsx +6 -13
- package/src/templates/BaseInputTemplate.tsx +3 -2
- package/src/templates/ObjectFieldTemplate.tsx +6 -3
- package/src/templates/OptionalDataControlsTemplate.tsx +44 -0
- package/src/templates/TitleField.tsx +12 -3
- package/src/templates/WrapIfAdditionalTemplate.tsx +4 -10
- package/src/templates/index.ts +2 -0
- package/src/widgets/CheckboxWidget.tsx +2 -1
- package/src/widgets/CheckboxesWidget.tsx +2 -1
- package/src/widgets/RadioWidget.tsx +2 -1
- package/src/widgets/SelectWidget.tsx +2 -1
- package/src/widgets/TextareaWidget.tsx +2 -1
package/dist/mantine.umd.js
CHANGED
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
disabled,
|
|
26
26
|
fieldPathId,
|
|
27
27
|
items,
|
|
28
|
+
optionalDataControl,
|
|
28
29
|
onAddClick,
|
|
29
30
|
readonly,
|
|
30
31
|
required,
|
|
@@ -39,16 +40,12 @@
|
|
|
39
40
|
registry,
|
|
40
41
|
uiOptions
|
|
41
42
|
);
|
|
42
|
-
const ArrayFieldItemTemplate2 = utils.getTemplate(
|
|
43
|
-
"ArrayFieldItemTemplate",
|
|
44
|
-
registry,
|
|
45
|
-
uiOptions
|
|
46
|
-
);
|
|
47
43
|
const ArrayFieldTitleTemplate2 = utils.getTemplate(
|
|
48
44
|
"ArrayFieldTitleTemplate",
|
|
49
45
|
registry,
|
|
50
46
|
uiOptions
|
|
51
47
|
);
|
|
48
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
52
49
|
const {
|
|
53
50
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
54
51
|
} = registry.templates;
|
|
@@ -60,7 +57,8 @@
|
|
|
60
57
|
title: uiOptions.title || title,
|
|
61
58
|
schema,
|
|
62
59
|
uiSchema,
|
|
63
|
-
registry
|
|
60
|
+
registry,
|
|
61
|
+
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
64
62
|
}
|
|
65
63
|
);
|
|
66
64
|
return /* @__PURE__ */ jsxRuntime.jsxs(core.Fieldset, { legend, className, id: fieldPathId.$id, children: [
|
|
@@ -74,7 +72,10 @@
|
|
|
74
72
|
registry
|
|
75
73
|
}
|
|
76
74
|
),
|
|
77
|
-
/* @__PURE__ */ jsxRuntime.
|
|
75
|
+
/* @__PURE__ */ jsxRuntime.jsxs(core.Box, { className: "row rjsf-array-item-list", children: [
|
|
76
|
+
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
77
|
+
items
|
|
78
|
+
] }),
|
|
78
79
|
canAdd && /* @__PURE__ */ jsxRuntime.jsx(core.Group, { justify: "flex-end", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
79
80
|
AddButton2,
|
|
80
81
|
{
|
|
@@ -137,6 +138,7 @@
|
|
|
137
138
|
function BaseInputTemplate(props) {
|
|
138
139
|
const {
|
|
139
140
|
id,
|
|
141
|
+
htmlName,
|
|
140
142
|
type,
|
|
141
143
|
schema,
|
|
142
144
|
value,
|
|
@@ -182,7 +184,7 @@
|
|
|
182
184
|
core.NumberInput,
|
|
183
185
|
{
|
|
184
186
|
id,
|
|
185
|
-
name: id,
|
|
187
|
+
name: htmlName || id,
|
|
186
188
|
label: utils.labelValue(label || void 0, hideLabel, false),
|
|
187
189
|
required,
|
|
188
190
|
autoFocus: autofocus,
|
|
@@ -204,7 +206,7 @@
|
|
|
204
206
|
core.TextInput,
|
|
205
207
|
{
|
|
206
208
|
id,
|
|
207
|
-
name: id,
|
|
209
|
+
name: htmlName || id,
|
|
208
210
|
label: utils.labelValue(label || void 0, hideLabel, false),
|
|
209
211
|
required,
|
|
210
212
|
autoFocus: autofocus,
|
|
@@ -556,7 +558,8 @@
|
|
|
556
558
|
description,
|
|
557
559
|
disabled,
|
|
558
560
|
properties,
|
|
559
|
-
|
|
561
|
+
optionalDataControl,
|
|
562
|
+
onAddProperty,
|
|
560
563
|
readonly,
|
|
561
564
|
required,
|
|
562
565
|
schema,
|
|
@@ -572,6 +575,7 @@
|
|
|
572
575
|
registry,
|
|
573
576
|
uiOptions
|
|
574
577
|
);
|
|
578
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
575
579
|
const {
|
|
576
580
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
577
581
|
} = registry.templates;
|
|
@@ -587,7 +591,8 @@
|
|
|
587
591
|
required,
|
|
588
592
|
schema,
|
|
589
593
|
uiSchema,
|
|
590
|
-
registry
|
|
594
|
+
registry,
|
|
595
|
+
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
591
596
|
}
|
|
592
597
|
),
|
|
593
598
|
description && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -600,14 +605,17 @@
|
|
|
600
605
|
registry
|
|
601
606
|
}
|
|
602
607
|
),
|
|
603
|
-
/* @__PURE__ */ jsxRuntime.
|
|
608
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
604
609
|
core.SimpleGrid,
|
|
605
610
|
{
|
|
606
611
|
cols: gridCols,
|
|
607
612
|
spacing: gridSpacing,
|
|
608
613
|
verticalSpacing: gridVerticalSpacing,
|
|
609
614
|
mb: "sm",
|
|
610
|
-
children:
|
|
615
|
+
children: [
|
|
616
|
+
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
617
|
+
properties.filter((e) => !e.hidden).map((element) => /* @__PURE__ */ jsxRuntime.jsx(core.Box, { children: element.content }, element.name))
|
|
618
|
+
]
|
|
611
619
|
}
|
|
612
620
|
),
|
|
613
621
|
utils.canExpand(schema, uiSchema, formData) && /* @__PURE__ */ jsxRuntime.jsx(core.Group, { mt: "xs", justify: "flex-end", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -615,7 +623,7 @@
|
|
|
615
623
|
{
|
|
616
624
|
id: utils.buttonId(fieldPathId, "add"),
|
|
617
625
|
disabled: disabled || readonly,
|
|
618
|
-
onClick:
|
|
626
|
+
onClick: onAddProperty,
|
|
619
627
|
className: "rjsf-object-property-expand",
|
|
620
628
|
uiSchema,
|
|
621
629
|
registry
|
|
@@ -623,9 +631,45 @@
|
|
|
623
631
|
) })
|
|
624
632
|
] });
|
|
625
633
|
}
|
|
634
|
+
function OptionalDataControlsTemplate(props) {
|
|
635
|
+
const { id, registry, label, onAddClick, onRemoveClick } = props;
|
|
636
|
+
if (onAddClick) {
|
|
637
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
638
|
+
AddButton,
|
|
639
|
+
{
|
|
640
|
+
id,
|
|
641
|
+
registry,
|
|
642
|
+
icon: "plus",
|
|
643
|
+
className: "rjsf-add-optional-data",
|
|
644
|
+
onClick: onAddClick,
|
|
645
|
+
title: label
|
|
646
|
+
}
|
|
647
|
+
);
|
|
648
|
+
} else if (onRemoveClick) {
|
|
649
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
650
|
+
RemoveButton,
|
|
651
|
+
{
|
|
652
|
+
id,
|
|
653
|
+
registry,
|
|
654
|
+
icon: "remove",
|
|
655
|
+
className: "rjsf-remove-optional-data",
|
|
656
|
+
onClick: onRemoveClick,
|
|
657
|
+
title: label
|
|
658
|
+
}
|
|
659
|
+
);
|
|
660
|
+
}
|
|
661
|
+
return /* @__PURE__ */ jsxRuntime.jsx("em", { id, children: label });
|
|
662
|
+
}
|
|
626
663
|
function TitleField(props) {
|
|
627
|
-
const { id, title } = props;
|
|
628
|
-
|
|
664
|
+
const { id, title, optionalDataControl } = props;
|
|
665
|
+
let heading = title ? /* @__PURE__ */ jsxRuntime.jsx(core.Title, { id, order: 3, fw: "normal", children: title }) : null;
|
|
666
|
+
if (optionalDataControl) {
|
|
667
|
+
heading = /* @__PURE__ */ jsxRuntime.jsxs(core.Grid, { children: [
|
|
668
|
+
/* @__PURE__ */ jsxRuntime.jsx(core.Grid.Col, { span: "auto", children: heading }),
|
|
669
|
+
/* @__PURE__ */ jsxRuntime.jsx(core.Grid.Col, { span: "content", children: optionalDataControl })
|
|
670
|
+
] });
|
|
671
|
+
}
|
|
672
|
+
return heading;
|
|
629
673
|
}
|
|
630
674
|
function WrapIfAdditionalTemplate(props) {
|
|
631
675
|
const {
|
|
@@ -638,8 +682,8 @@
|
|
|
638
682
|
disabled,
|
|
639
683
|
schema,
|
|
640
684
|
uiSchema,
|
|
641
|
-
|
|
642
|
-
|
|
685
|
+
onKeyRenameBlur,
|
|
686
|
+
onRemoveProperty,
|
|
643
687
|
registry,
|
|
644
688
|
children
|
|
645
689
|
} = props;
|
|
@@ -647,10 +691,6 @@
|
|
|
647
691
|
const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
|
|
648
692
|
const keyLabel = translateString(utils.TranslatableString.KeyLabel, [label]);
|
|
649
693
|
const additional = utils.ADDITIONAL_PROPERTY_FLAG in schema;
|
|
650
|
-
const handleBlur = react.useCallback(
|
|
651
|
-
({ target }) => onKeyChange(target && target.value),
|
|
652
|
-
[onKeyChange]
|
|
653
|
-
);
|
|
654
694
|
if (!additional) {
|
|
655
695
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames, style, children });
|
|
656
696
|
}
|
|
@@ -671,7 +711,7 @@
|
|
|
671
711
|
disabled: disabled || readonly,
|
|
672
712
|
id: `${id}-key`,
|
|
673
713
|
name: `${id}-key`,
|
|
674
|
-
onBlur: !readonly ?
|
|
714
|
+
onBlur: !readonly ? onKeyRenameBlur : void 0
|
|
675
715
|
}
|
|
676
716
|
) }) }),
|
|
677
717
|
/* @__PURE__ */ jsxRuntime.jsx(core.Grid.Col, { span: 6, className: "form-additional", children })
|
|
@@ -683,7 +723,7 @@
|
|
|
683
723
|
iconType: "sm",
|
|
684
724
|
className: "rjsf-array-item-remove",
|
|
685
725
|
disabled: disabled || readonly,
|
|
686
|
-
onClick:
|
|
726
|
+
onClick: onRemoveProperty,
|
|
687
727
|
uiSchema: buttonUiOptions,
|
|
688
728
|
registry
|
|
689
729
|
}
|
|
@@ -712,6 +752,7 @@
|
|
|
712
752
|
FieldHelpTemplate,
|
|
713
753
|
GridTemplate,
|
|
714
754
|
ObjectFieldTemplate,
|
|
755
|
+
OptionalDataControlsTemplate,
|
|
715
756
|
TitleFieldTemplate: TitleField,
|
|
716
757
|
WrapIfAdditionalTemplate,
|
|
717
758
|
MultiSchemaFieldTemplate
|
|
@@ -974,6 +1015,7 @@
|
|
|
974
1015
|
function CheckboxesWidget(props) {
|
|
975
1016
|
const {
|
|
976
1017
|
id,
|
|
1018
|
+
htmlName,
|
|
977
1019
|
value,
|
|
978
1020
|
required,
|
|
979
1021
|
disabled,
|
|
@@ -1031,7 +1073,7 @@
|
|
|
1031
1073
|
core.Checkbox,
|
|
1032
1074
|
{
|
|
1033
1075
|
id: utils.optionId(id, i),
|
|
1034
|
-
name: id,
|
|
1076
|
+
name: htmlName || id,
|
|
1035
1077
|
value: String(i),
|
|
1036
1078
|
label: option.label,
|
|
1037
1079
|
disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1,
|
|
@@ -1049,6 +1091,7 @@
|
|
|
1049
1091
|
const {
|
|
1050
1092
|
id,
|
|
1051
1093
|
name,
|
|
1094
|
+
htmlName,
|
|
1052
1095
|
value = false,
|
|
1053
1096
|
required,
|
|
1054
1097
|
disabled,
|
|
@@ -1111,7 +1154,7 @@
|
|
|
1111
1154
|
core.Checkbox,
|
|
1112
1155
|
{
|
|
1113
1156
|
id,
|
|
1114
|
-
name,
|
|
1157
|
+
name: htmlName || name,
|
|
1115
1158
|
label: utils.labelValue(label || void 0, hideLabel, false),
|
|
1116
1159
|
disabled: disabled || readonly,
|
|
1117
1160
|
required,
|
|
@@ -1385,6 +1428,7 @@
|
|
|
1385
1428
|
function RadioWidget(props) {
|
|
1386
1429
|
const {
|
|
1387
1430
|
id,
|
|
1431
|
+
htmlName,
|
|
1388
1432
|
value,
|
|
1389
1433
|
required,
|
|
1390
1434
|
disabled,
|
|
@@ -1429,7 +1473,7 @@
|
|
|
1429
1473
|
core.Radio.Group,
|
|
1430
1474
|
{
|
|
1431
1475
|
id,
|
|
1432
|
-
name: id,
|
|
1476
|
+
name: htmlName || id,
|
|
1433
1477
|
value: selected,
|
|
1434
1478
|
label: !hideLabel ? label : void 0,
|
|
1435
1479
|
onChange: handleChange,
|
|
@@ -1519,6 +1563,7 @@
|
|
|
1519
1563
|
function SelectWidget(props) {
|
|
1520
1564
|
const {
|
|
1521
1565
|
id,
|
|
1566
|
+
htmlName,
|
|
1522
1567
|
value,
|
|
1523
1568
|
placeholder,
|
|
1524
1569
|
required,
|
|
@@ -1577,7 +1622,7 @@
|
|
|
1577
1622
|
Component,
|
|
1578
1623
|
{
|
|
1579
1624
|
id,
|
|
1580
|
-
name: id,
|
|
1625
|
+
name: htmlName || id,
|
|
1581
1626
|
label: utils.labelValue(label || void 0, hideLabel, false),
|
|
1582
1627
|
data: selectOptions,
|
|
1583
1628
|
value: multiple ? selectedIndexes : selectedIndexes,
|
|
@@ -1600,6 +1645,7 @@
|
|
|
1600
1645
|
const {
|
|
1601
1646
|
id,
|
|
1602
1647
|
name,
|
|
1648
|
+
htmlName,
|
|
1603
1649
|
value,
|
|
1604
1650
|
placeholder,
|
|
1605
1651
|
required,
|
|
@@ -1642,7 +1688,7 @@
|
|
|
1642
1688
|
core.Textarea,
|
|
1643
1689
|
{
|
|
1644
1690
|
id,
|
|
1645
|
-
name,
|
|
1691
|
+
name: htmlName || name,
|
|
1646
1692
|
value: value || "",
|
|
1647
1693
|
placeholder: placeholder || void 0,
|
|
1648
1694
|
required,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ArrayFieldItemTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
2
|
/** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
|
|
3
3
|
*
|
|
4
|
-
* @param props - The `
|
|
4
|
+
* @param props - The `ArrayFieldItemTemplateProps` props for the component
|
|
5
5
|
*/
|
|
6
|
-
export default function ArrayFieldItemTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props:
|
|
6
|
+
export default function ArrayFieldItemTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: ArrayFieldItemTemplateProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { getTemplate, getUiOptions, } from '@rjsf/utils';
|
|
|
3
3
|
import { Box, Flex, Group } from '@mantine/core';
|
|
4
4
|
/** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
|
|
5
5
|
*
|
|
6
|
-
* @param props - The `
|
|
6
|
+
* @param props - The `ArrayFieldItemTemplateProps` props for the component
|
|
7
7
|
*/
|
|
8
8
|
export default function ArrayFieldItemTemplate(props) {
|
|
9
9
|
const { buttonsProps, className, hasToolbar, index, uiSchema, registry, children } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayFieldItemTemplate.js","sourceRoot":"","sources":["../../src/templates/ArrayFieldItemTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,WAAW,EACX,YAAY,GAGb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEjD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAI5C,
|
|
1
|
+
{"version":3,"file":"ArrayFieldItemTemplate.js","sourceRoot":"","sources":["../../src/templates/ArrayFieldItemTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,WAAW,EACX,YAAY,GAGb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEjD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAI5C,KAA2C;IAC3C,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC3F,MAAM,SAAS,GAAG,YAAY,CAAU,QAAQ,CAAC,CAAC;IAClD,MAAM,6BAA6B,GAAG,WAAW,CAC/C,+BAA+B,EAC/B,QAAQ,EACR,SAAS,CACV,CAAC;IAEF,OAAO,CACL,KAAC,GAAG,IAA6B,SAAS,EAAE,SAAS,IAAI,iBAAiB,EAAE,EAAE,EAAC,IAAI,YACjF,MAAC,IAAI,IAAC,GAAG,EAAC,IAAI,EAAC,KAAK,EAAC,KAAK,EAAC,OAAO,EAAC,QAAQ,aACzC,KAAC,GAAG,IAAC,CAAC,EAAC,MAAM,YAAE,QAAQ,GAAO,EAC7B,UAAU,IAAI,CACb,KAAC,KAAK,IAAC,IAAI,EAAC,QAAQ,EAAC,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,YAChC,KAAC,6BAA6B,OAAK,YAAY,GAAI,GAC7C,CACT,IACI,IARC,cAAc,KAAK,EAAE,CASzB,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ArrayFieldTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
2
|
/** The `ArrayFieldTemplate` component is the template used to render all items in an array.
|
|
3
3
|
*
|
|
4
|
-
* @param props - The `
|
|
4
|
+
* @param props - The `ArrayFieldTemplateProps` props for the component
|
|
5
5
|
*/
|
|
6
6
|
export default function ArrayFieldTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: ArrayFieldTemplateProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,18 +3,17 @@ import { getTemplate, getUiOptions, buttonId, } from '@rjsf/utils';
|
|
|
3
3
|
import { Fieldset, Box, Group } from '@mantine/core';
|
|
4
4
|
/** The `ArrayFieldTemplate` component is the template used to render all items in an array.
|
|
5
5
|
*
|
|
6
|
-
* @param props - The `
|
|
6
|
+
* @param props - The `ArrayFieldTemplateProps` props for the component
|
|
7
7
|
*/
|
|
8
8
|
export default function ArrayFieldTemplate(props) {
|
|
9
|
-
const { canAdd, className, disabled, fieldPathId, items, onAddClick, readonly, required, schema, uiSchema, title, registry, } = props;
|
|
9
|
+
const { canAdd, className, disabled, fieldPathId, items, optionalDataControl, onAddClick, readonly, required, schema, uiSchema, title, registry, } = props;
|
|
10
10
|
const uiOptions = getUiOptions(uiSchema);
|
|
11
11
|
const ArrayFieldDescriptionTemplate = getTemplate('ArrayFieldDescriptionTemplate', registry, uiOptions);
|
|
12
|
-
const ArrayFieldItemTemplate = getTemplate('ArrayFieldItemTemplate', registry, uiOptions);
|
|
13
12
|
const ArrayFieldTitleTemplate = getTemplate('ArrayFieldTitleTemplate', registry, uiOptions);
|
|
13
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
14
14
|
// Button templates are not overridden in the uiSchema
|
|
15
15
|
const { ButtonTemplates: { AddButton }, } = registry.templates;
|
|
16
|
-
const legend = (uiOptions.title || title) && (_jsx(ArrayFieldTitleTemplate, { fieldPathId: fieldPathId, required: required, title: uiOptions.title || title, schema: schema, uiSchema: uiSchema, registry: registry }));
|
|
17
|
-
return (_jsxs(Fieldset, { legend: legend, className: className, id: fieldPathId.$id, children: [(uiOptions.description || schema.description) && (_jsx(ArrayFieldDescriptionTemplate, { description: uiOptions.description || schema.description, fieldPathId: fieldPathId, schema: schema, uiSchema: uiSchema, registry: registry })),
|
|
18
|
-
items.map(({ key, ...itemProps }) => (_jsx(ArrayFieldItemTemplate, { ...itemProps }, key))) }), canAdd && (_jsx(Group, { justify: 'flex-end', children: _jsx(AddButton, { id: buttonId(fieldPathId, 'add'), className: 'rjsf-array-item-add', disabled: disabled || readonly, onClick: onAddClick, uiSchema: uiSchema, registry: registry, iconType: 'md' }) }))] }));
|
|
16
|
+
const legend = (uiOptions.title || title) && (_jsx(ArrayFieldTitleTemplate, { fieldPathId: fieldPathId, required: required, title: uiOptions.title || title, schema: schema, uiSchema: uiSchema, registry: registry, optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : undefined }));
|
|
17
|
+
return (_jsxs(Fieldset, { legend: legend, className: className, id: fieldPathId.$id, children: [(uiOptions.description || schema.description) && (_jsx(ArrayFieldDescriptionTemplate, { description: uiOptions.description || schema.description, fieldPathId: fieldPathId, schema: schema, uiSchema: uiSchema, registry: registry })), _jsxs(Box, { className: 'row rjsf-array-item-list', children: [!showOptionalDataControlInTitle ? optionalDataControl : undefined, items] }), canAdd && (_jsx(Group, { justify: 'flex-end', children: _jsx(AddButton, { id: buttonId(fieldPathId, 'add'), className: 'rjsf-array-item-add', disabled: disabled || readonly, onClick: onAddClick, uiSchema: uiSchema, registry: registry, iconType: 'md' }) }))] }));
|
|
19
18
|
}
|
|
20
19
|
//# sourceMappingURL=ArrayFieldTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayFieldTemplate.js","sourceRoot":"","sources":["../../src/templates/ArrayFieldTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,WAAW,EACX,YAAY,
|
|
1
|
+
{"version":3,"file":"ArrayFieldTemplate.js","sourceRoot":"","sources":["../../src/templates/ArrayFieldTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,WAAW,EACX,YAAY,EAEZ,QAAQ,GAIT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAErD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAIxC,KAAuC;IACvC,MAAM,EACJ,MAAM,EACN,SAAS,EACT,QAAQ,EACR,WAAW,EACX,KAAK,EACL,mBAAmB,EACnB,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,KAAK,EACL,QAAQ,GACT,GAAG,KAAK,CAAC;IAEV,MAAM,SAAS,GAAG,YAAY,CAAU,QAAQ,CAAC,CAAC;IAClD,MAAM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AAO,EAAC,UAAU,YACvB,KAAC,SAAS,IACR,EAAE,EAAE,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC,EAChC,SAAS,EAAC,qBAAqB,EAC/B,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAC9B,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAC,IAAI,GACb,GACI,CACT,IACQ,CACZ,CAAC;AACJ,CAAC"}
|
|
@@ -10,7 +10,7 @@ import { cleanupOptions } from '../utils';
|
|
|
10
10
|
* @param props - The `WidgetProps` for this template
|
|
11
11
|
*/
|
|
12
12
|
export default function BaseInputTemplate(props) {
|
|
13
|
-
const { id, type, schema, value, placeholder, required, disabled, readonly, autofocus, label, hideLabel, onChange, onChangeOverride, onBlur, onFocus, options, rawErrors, children, } = props;
|
|
13
|
+
const { id, htmlName, type, schema, value, placeholder, required, disabled, readonly, autofocus, label, hideLabel, onChange, onChangeOverride, onBlur, onFocus, options, rawErrors, children, } = props;
|
|
14
14
|
const inputProps = getInputProps(schema, type, options, false);
|
|
15
15
|
const themeProps = cleanupOptions(options);
|
|
16
16
|
const handleNumberChange = useCallback((value) => onChange(value), [onChange]);
|
|
@@ -26,7 +26,7 @@ export default function BaseInputTemplate(props) {
|
|
|
26
26
|
const handleFocus = useCallback((e) => {
|
|
27
27
|
onFocus(id, e.target && e.target.value);
|
|
28
28
|
}, [onFocus, id]);
|
|
29
|
-
const input = inputProps.type === 'number' || inputProps.type === 'integer' ? (_jsx(NumberInput, { id: id, name: id, label: labelValue(label || undefined, hideLabel, false), required: required, autoFocus: autofocus, disabled: disabled || readonly, onBlur: !readonly ? handleBlur : undefined, onChange: !readonly ? handleNumberChange : undefined, onFocus: !readonly ? handleFocus : undefined, placeholder: placeholder, error: rawErrors && rawErrors.length > 0 ? rawErrors.join('\n') : undefined, list: schema.examples ? examplesId(id) : undefined, ...inputProps, ...themeProps, step: typeof inputProps.step === 'number' ? inputProps.step : 1, type: 'text', value: value, "aria-describedby": ariaDescribedByIds(id, !!schema.examples) })) : (_jsx(TextInput, { id: id, name: id, label: labelValue(label || undefined, hideLabel, false), required: required, autoFocus: autofocus, disabled: disabled || readonly, onBlur: !readonly ? handleBlur : undefined, onChange: !readonly ? handleChange : undefined, onFocus: !readonly ? handleFocus : undefined, placeholder: placeholder, error: rawErrors && rawErrors.length > 0 ? rawErrors.join('\n') : undefined, list: schema.examples ? examplesId(id) : undefined, ...inputProps, ...themeProps, value: value, "aria-describedby": ariaDescribedByIds(id, !!schema.examples) }));
|
|
29
|
+
const input = inputProps.type === 'number' || inputProps.type === 'integer' ? (_jsx(NumberInput, { id: id, name: htmlName || id, label: labelValue(label || undefined, hideLabel, false), required: required, autoFocus: autofocus, disabled: disabled || readonly, onBlur: !readonly ? handleBlur : undefined, onChange: !readonly ? handleNumberChange : undefined, onFocus: !readonly ? handleFocus : undefined, placeholder: placeholder, error: rawErrors && rawErrors.length > 0 ? rawErrors.join('\n') : undefined, list: schema.examples ? examplesId(id) : undefined, ...inputProps, ...themeProps, step: typeof inputProps.step === 'number' ? inputProps.step : 1, type: 'text', value: value, "aria-describedby": ariaDescribedByIds(id, !!schema.examples) })) : (_jsx(TextInput, { id: id, name: htmlName || id, label: labelValue(label || undefined, hideLabel, false), required: required, autoFocus: autofocus, disabled: disabled || readonly, onBlur: !readonly ? handleBlur : undefined, onChange: !readonly ? handleChange : undefined, onFocus: !readonly ? handleFocus : undefined, placeholder: placeholder, error: rawErrors && rawErrors.length > 0 ? rawErrors.join('\n') : undefined, list: schema.examples ? examplesId(id) : undefined, ...inputProps, ...themeProps, value: value, "aria-describedby": ariaDescribedByIds(id, !!schema.examples) }));
|
|
30
30
|
return (_jsxs(_Fragment, { children: [input, children, Array.isArray(schema.examples) && (_jsx("datalist", { id: examplesId(id), children: schema.examples
|
|
31
31
|
.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : [])
|
|
32
32
|
.map((example) => {
|
|
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O,CAAC,CAAC,CAAC,CAAE,CAAC,MAAM,CAAC,OAAO,CAAc,CAAC,CAAC,CAAC,EAAE,CAAC;qBACzG,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;oBACf,OAAO,iBAAsB,KAAK,EAAE,OAAO,IAAvB,OAAO,CAAoB,CAAC;gBAClD,CAAC,CAAC,GACK,CACZ,IACA,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -8,17 +8,18 @@ import { buttonId, canExpand, descriptionId, getTemplate, getUiOptions, titleId,
|
|
|
8
8
|
* @param props - The `ObjectFieldTemplateProps` for this component
|
|
9
9
|
*/
|
|
10
10
|
export default function ObjectFieldTemplate(props) {
|
|
11
|
-
const { title, description, disabled, properties,
|
|
11
|
+
const { title, description, disabled, properties, optionalDataControl, onAddProperty, readonly, required, schema, uiSchema, fieldPathId, formData, registry, } = props;
|
|
12
12
|
const uiOptions = getUiOptions(uiSchema);
|
|
13
13
|
const TitleFieldTemplate = getTemplate('TitleFieldTemplate', registry, uiOptions);
|
|
14
14
|
const DescriptionFieldTemplate = getTemplate('DescriptionFieldTemplate', registry, uiOptions);
|
|
15
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
15
16
|
// Button templates are not overridden in the uiSchema
|
|
16
17
|
const { ButtonTemplates: { AddButton }, } = registry.templates;
|
|
17
18
|
const gridCols = (typeof (uiOptions === null || uiOptions === void 0 ? void 0 : uiOptions.gridCols) === 'number' && (uiOptions === null || uiOptions === void 0 ? void 0 : uiOptions.gridCols)) || undefined;
|
|
18
19
|
const gridSpacing = uiOptions === null || uiOptions === void 0 ? void 0 : uiOptions.gridSpacing;
|
|
19
20
|
const gridVerticalSpacing = uiOptions === null || uiOptions === void 0 ? void 0 : uiOptions.gridVerticalSpacing;
|
|
20
|
-
return (_jsxs(Container, { id: fieldPathId.$id, p: 0, children: [title && (_jsx(TitleFieldTemplate, { id: titleId(fieldPathId), title: title, required: required, schema: schema, uiSchema: uiSchema, registry: registry })), description && (_jsx(DescriptionFieldTemplate, { id: descriptionId(fieldPathId), description: description, schema: schema, uiSchema: uiSchema, registry: registry })),
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
return (_jsxs(Container, { id: fieldPathId.$id, p: 0, children: [title && (_jsx(TitleFieldTemplate, { id: titleId(fieldPathId), title: title, required: required, schema: schema, uiSchema: uiSchema, registry: registry, optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : undefined })), description && (_jsx(DescriptionFieldTemplate, { id: descriptionId(fieldPathId), description: description, schema: schema, uiSchema: uiSchema, registry: registry })), _jsxs(SimpleGrid, { cols: gridCols, spacing: gridSpacing, verticalSpacing: gridVerticalSpacing, mb: 'sm', children: [!showOptionalDataControlInTitle ? optionalDataControl : undefined, properties
|
|
22
|
+
.filter((e) => !e.hidden)
|
|
23
|
+
.map((element) => (_jsx(Box, { children: element.content }, element.name)))] }), canExpand(schema, uiSchema, formData) && (_jsx(Group, { mt: 'xs', justify: 'flex-end', children: _jsx(AddButton, { id: buttonId(fieldPathId, 'add'), disabled: disabled || readonly, onClick: onAddProperty, className: 'rjsf-object-property-expand', uiSchema: uiSchema, registry: registry }) }))] }));
|
|
23
24
|
}
|
|
24
25
|
//# sourceMappingURL=ObjectFieldTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectFieldTemplate.js","sourceRoot":"","sources":["../../src/templates/ObjectFieldTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAkB,UAAU,EAAE,MAAM,eAAe,CAAC;AAClF,OAAO,EACL,QAAQ,EACR,SAAS,EACT,aAAa,EAEb,WAAW,EACX,YAAY,EAKZ,OAAO,GACR,MAAM,aAAa,CAAC;AAErB;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAIzC,KAAwC;IACxC,MAAM,EACJ,KAAK,EACL,WAAW,EACX,QAAQ,EACR,UAAU,EACV,
|
|
1
|
+
{"version":3,"file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,EAAE,QAAQ,IAAI,QAAQ,EAC9B,OAAO,EAAE,aAAa,EACtB,SAAS,EAAC,6BAA6B,EACvC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB,GACI,CACT,IACS,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FormContextType, OptionalDataControlsTemplateProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
/** The OptionalDataControlsTemplate renders one of three different states. If
|
|
3
|
+
* there is an `onAddClick()` function, it renders the "Add" button. If there is
|
|
4
|
+
* an `onRemoveClick()` function, it renders the "Remove" button. Otherwise it
|
|
5
|
+
* renders the "No data found" section. All of them use the `label` as either
|
|
6
|
+
* the `title` of buttons or simply outputting it.
|
|
7
|
+
*
|
|
8
|
+
* @param props - The `OptionalDataControlsTemplateProps` for the template
|
|
9
|
+
*/
|
|
10
|
+
export default function OptionalDataControlsTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: OptionalDataControlsTemplateProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import AddButton from './ButtonTemplates/AddButton';
|
|
3
|
+
import { RemoveButton } from './ButtonTemplates/IconButton';
|
|
4
|
+
/** The OptionalDataControlsTemplate renders one of three different states. If
|
|
5
|
+
* there is an `onAddClick()` function, it renders the "Add" button. If there is
|
|
6
|
+
* an `onRemoveClick()` function, it renders the "Remove" button. Otherwise it
|
|
7
|
+
* renders the "No data found" section. All of them use the `label` as either
|
|
8
|
+
* the `title` of buttons or simply outputting it.
|
|
9
|
+
*
|
|
10
|
+
* @param props - The `OptionalDataControlsTemplateProps` for the template
|
|
11
|
+
*/
|
|
12
|
+
export default function OptionalDataControlsTemplate(props) {
|
|
13
|
+
const { id, registry, label, onAddClick, onRemoveClick } = props;
|
|
14
|
+
if (onAddClick) {
|
|
15
|
+
return (_jsx(AddButton, { id: id, registry: registry, icon: 'plus', className: 'rjsf-add-optional-data', onClick: onAddClick, title: label }));
|
|
16
|
+
}
|
|
17
|
+
else if (onRemoveClick) {
|
|
18
|
+
return (_jsx(RemoveButton, { id: id, registry: registry, icon: 'remove', className: 'rjsf-remove-optional-data', onClick: onRemoveClick, title: label }));
|
|
19
|
+
}
|
|
20
|
+
return _jsx("em", { id: id, children: label });
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=OptionalDataControlsTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OptionalDataControlsTemplate.js","sourceRoot":"","sources":["../../src/templates/OptionalDataControlsTemplate.tsx"],"names":[],"mappings":";AAEA,OAAO,SAAS,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,4BAA4B,CAIlD,KAAiD;IACjD,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IACjE,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,CACL,KAAC,SAAS,IACR,EAAE,EAAE,EAAE,EACN,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,MAAM,EACX,SAAS,EAAC,wBAAwB,EAClC,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,KAAK,GACZ,CACH,CAAC;IACJ,CAAC;SAAM,IAAI,aAAa,EAAE,CAAC;QACzB,OAAO,CACL,KAAC,YAAY,IACX,EAAE,EAAE,EAAE,EACN,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,2BAA2B,EACrC,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,KAAK,GACZ,CACH,CAAC;IACJ,CAAC;IACD,OAAO,aAAI,EAAE,EAAE,EAAE,YAAG,KAAK,GAAM,CAAC;AAClC,CAAC"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Title } from '@mantine/core';
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Grid, Title } from '@mantine/core';
|
|
3
3
|
/** The `TitleField` is the template to use to render the title of a field
|
|
4
4
|
*
|
|
5
5
|
* @param props - The `TitleFieldProps` for this component
|
|
6
6
|
*/
|
|
7
7
|
export default function TitleField(props) {
|
|
8
|
-
const { id, title } = props;
|
|
9
|
-
|
|
8
|
+
const { id, title, optionalDataControl } = props;
|
|
9
|
+
let heading = title ? (_jsx(Title, { id: id, order: 3, fw: 'normal', children: title })) : null;
|
|
10
|
+
if (optionalDataControl) {
|
|
11
|
+
heading = (_jsxs(Grid, { children: [_jsx(Grid.Col, { span: 'auto', children: heading }), _jsx(Grid.Col, { span: 'content', children: optionalDataControl })] }));
|
|
12
|
+
}
|
|
13
|
+
return heading;
|
|
10
14
|
}
|
|
11
15
|
//# sourceMappingURL=TitleField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleField.js","sourceRoot":"","sources":["../../src/templates/TitleField.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"TitleField.js","sourceRoot":"","sources":["../../src/templates/TitleField.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE5C;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,KAA+B;IAE/B,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,GAAG,KAAK,CAAC;IACjD,IAAI,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CACpB,KAAC,KAAK,IAAC,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAC,QAAQ,YACjC,KAAK,GACA,CACT,CAAC,CAAC,CAAC,IAAI,CAAC;IACT,IAAI,mBAAmB,EAAE,CAAC;QACxB,OAAO,GAAG,CACR,MAAC,IAAI,eACH,KAAC,IAAI,CAAC,GAAG,IAAC,IAAI,EAAC,MAAM,YAAE,OAAO,GAAY,EAC1C,KAAC,IAAI,CAAC,GAAG,IAAC,IAAI,EAAC,SAAS,YAAE,mBAAmB,GAAY,IACpD,CACR,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback } from 'react';
|
|
3
2
|
import { ADDITIONAL_PROPERTY_FLAG, UI_OPTIONS_KEY, buttonId, TranslatableString, } from '@rjsf/utils';
|
|
4
3
|
import { Flex, Grid, TextInput } from '@mantine/core';
|
|
5
4
|
/** The `WrapIfAdditional` component is used by the `FieldTemplate` to rename, or remove properties that are
|
|
@@ -8,13 +7,12 @@ import { Flex, Grid, TextInput } from '@mantine/core';
|
|
|
8
7
|
* @param props - The `WrapIfAdditionalProps` for this component
|
|
9
8
|
*/
|
|
10
9
|
export default function WrapIfAdditionalTemplate(props) {
|
|
11
|
-
const { id, classNames, style, label, required, readonly, disabled, schema, uiSchema,
|
|
10
|
+
const { id, classNames, style, label, required, readonly, disabled, schema, uiSchema, onKeyRenameBlur, onRemoveProperty, registry, children, } = props;
|
|
12
11
|
const { templates, translateString } = registry;
|
|
13
12
|
// Button templates are not overridden in the uiSchema
|
|
14
13
|
const { RemoveButton } = templates.ButtonTemplates;
|
|
15
14
|
const keyLabel = translateString(TranslatableString.KeyLabel, [label]);
|
|
16
15
|
const additional = ADDITIONAL_PROPERTY_FLAG in schema;
|
|
17
|
-
const handleBlur = useCallback(({ target }) => onKeyChange(target && target.value), [onKeyChange]);
|
|
18
16
|
if (!additional) {
|
|
19
17
|
return (_jsx("div", { className: classNames, style: style, children: children }));
|
|
20
18
|
}
|
|
@@ -24,6 +22,6 @@ export default function WrapIfAdditionalTemplate(props) {
|
|
|
24
22
|
...uiSchema,
|
|
25
23
|
[UI_OPTIONS_KEY]: { ...uiOptions, block: true },
|
|
26
24
|
};
|
|
27
|
-
return (_jsx("div", { className: classNames, style: style, children: _jsxs(Flex, { gap: 'xs', align: 'end', justify: 'center', children: [_jsxs(Grid, { w: '100%', align: 'center', children: [_jsx(Grid.Col, { span: 6, className: 'form-additional', children: _jsx("div", { className: 'form-group', children: _jsx(TextInput, { className: 'form-group', label: keyLabel, defaultValue: label, required: required, disabled: disabled || readonly, id: `${id}-key`, name: `${id}-key`, onBlur: !readonly ?
|
|
25
|
+
return (_jsx("div", { className: classNames, style: style, children: _jsxs(Flex, { gap: 'xs', align: 'end', justify: 'center', children: [_jsxs(Grid, { w: '100%', align: 'center', children: [_jsx(Grid.Col, { span: 6, className: 'form-additional', children: _jsx("div", { className: 'form-group', children: _jsx(TextInput, { className: 'form-group', label: keyLabel, defaultValue: label, required: required, disabled: disabled || readonly, id: `${id}-key`, name: `${id}-key`, onBlur: !readonly ? onKeyRenameBlur : undefined }) }) }), _jsx(Grid.Col, { span: 6, className: 'form-additional', children: children })] }), _jsx(RemoveButton, { id: buttonId(id, 'remove'), iconType: 'sm', className: 'rjsf-array-item-remove', disabled: disabled || readonly, onClick: onRemoveProperty, uiSchema: buttonUiOptions, registry: registry })] }) }));
|
|
28
26
|
}
|
|
29
27
|
//# sourceMappingURL=WrapIfAdditionalTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WrapIfAdditionalTemplate.js","sourceRoot":"","sources":["../../src/templates/WrapIfAdditionalTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"WrapIfAdditionalTemplate.js","sourceRoot":"","sources":["../../src/templates/WrapIfAdditionalTemplate.tsx"],"names":[],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EAAC,OAAO,EAAC,QAAQ,aACzC,MAAC,IAAI,IAAC,CAAC,EAAC,MAAM,EAAC,KAAK,EAAC,QAAQ,aAC3B,KAAC,IAAI,CAAC,GAAG,IAAC,IAAI,EAAE,CAAC,EAAE,SAAS,EAAC,iBAAiB,YAC5C,cAAK,SAAS,EAAC,YAAY,YACzB,KAAC,SAAS,IACR,SAAS,EAAC,YAAY,EACtB,KAAK,EAAE,QAAQ,EACf,YAAY,EAAE,KAAK,EACnB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAC9B,EAAE,EAAE,GAAG,EAAE,MAAM,EACf,IAAI,EAAE,GAAG,EAAE,MAAM,EACjB,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,GAC/C,GACE,GACG,EACX,KAAC,IAAI,CAAC,GAAG,IAAC,IAAI,EAAE,CAAC,EAAE,SAAS,EAAC,iBAAiB,YAC3C,QAAQ,GACA,IACN,EACP,KAAC,YAAY,IACX,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,EAC1B,QAAQ,EAAC,IAAI,EACb,SAAS,EAAC,wBAAwB,EAClC,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAC9B,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,QAAQ,GAClB,IACG,GACH,CACP,CAAC;AACJ,CAAC"}
|
package/lib/templates/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import FieldTemplate from './FieldTemplate';
|
|
|
10
10
|
import FieldHelpTemplate from './FieldHelpTemplate';
|
|
11
11
|
import GridTemplate from './GridTemplate';
|
|
12
12
|
import ObjectFieldTemplate from './ObjectFieldTemplate';
|
|
13
|
+
import OptionalDataControlsTemplate from './OptionalDataControlsTemplate';
|
|
13
14
|
import TitleField from './TitleField';
|
|
14
15
|
import WrapIfAdditionalTemplate from './WrapIfAdditionalTemplate';
|
|
15
16
|
import MultiSchemaFieldTemplate from './MultiSchemaFieldTemplate';
|
|
@@ -27,6 +28,7 @@ export function generateTemplates() {
|
|
|
27
28
|
FieldHelpTemplate,
|
|
28
29
|
GridTemplate,
|
|
29
30
|
ObjectFieldTemplate,
|
|
31
|
+
OptionalDataControlsTemplate,
|
|
30
32
|
TitleFieldTemplate: TitleField,
|
|
31
33
|
WrapIfAdditionalTemplate,
|
|
32
34
|
MultiSchemaFieldTemplate,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAEA,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAElE,MAAM,UAAU,iBAAiB;IAK/B,OAAO;QACL,sBAAsB;QACtB,kBAAkB;QAClB,uBAAuB;QACvB,iBAAiB;QACjB,eAAe,EAAE,eAAe,EAAW;QAC3C,wBAAwB,EAAE,gBAAgB;QAC1C,iBAAiB,EAAE,SAAS;QAC5B,kBAAkB;QAClB,aAAa;QACb,iBAAiB;QACjB,YAAY;QACZ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