@rjsf/chakra-ui 6.0.2 → 6.1.1
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/chakra-ui.esm.js +47 -30
- package/dist/chakra-ui.esm.js.map +2 -2
- package/dist/chakra-ui.umd.js +46 -30
- package/dist/index.cjs +49 -32
- package/dist/index.cjs.map +3 -3
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js +3 -3
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -1
- package/lib/FieldTemplate/FieldTemplate.js +1 -1
- package/lib/FieldTemplate/FieldTemplate.js.map +1 -1
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +5 -3
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +8 -3
- package/src/FieldTemplate/FieldTemplate.tsx +2 -0
- package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +16 -5
package/dist/chakra-ui.esm.js
CHANGED
|
@@ -355,14 +355,14 @@ function FieldErrorTemplate(props) {
|
|
|
355
355
|
// src/FieldHelpTemplate/FieldHelpTemplate.tsx
|
|
356
356
|
import { Text as Text2 } from "@chakra-ui/react";
|
|
357
357
|
import { helpId } from "@rjsf/utils";
|
|
358
|
+
import { RichHelp } from "@rjsf/core";
|
|
358
359
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
359
360
|
function FieldHelpTemplate(props) {
|
|
360
|
-
const { fieldPathId, help } = props;
|
|
361
|
+
const { fieldPathId, help, uiSchema, registry } = props;
|
|
361
362
|
if (!help) {
|
|
362
363
|
return null;
|
|
363
364
|
}
|
|
364
|
-
|
|
365
|
-
return /* @__PURE__ */ jsx13(Text2, { id, children: help });
|
|
365
|
+
return /* @__PURE__ */ jsx13(Text2, { as: "sup", fontSize: "md", id: helpId(fieldPathId), children: /* @__PURE__ */ jsx13(RichHelp, { help, registry, uiSchema }) });
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
// src/FieldTemplate/FieldTemplate.tsx
|
|
@@ -413,6 +413,8 @@ function FieldTemplate(props) {
|
|
|
413
413
|
disabled,
|
|
414
414
|
id,
|
|
415
415
|
label,
|
|
416
|
+
displayLabel,
|
|
417
|
+
rawDescription,
|
|
416
418
|
onKeyRename,
|
|
417
419
|
onKeyRenameBlur,
|
|
418
420
|
onRemoveProperty,
|
|
@@ -618,10 +620,12 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
618
620
|
classNames,
|
|
619
621
|
style,
|
|
620
622
|
disabled,
|
|
623
|
+
displayLabel,
|
|
621
624
|
id,
|
|
622
625
|
label,
|
|
623
626
|
onRemoveProperty,
|
|
624
627
|
onKeyRenameBlur,
|
|
628
|
+
rawDescription,
|
|
625
629
|
readonly,
|
|
626
630
|
registry,
|
|
627
631
|
required,
|
|
@@ -630,37 +634,50 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
630
634
|
} = props;
|
|
631
635
|
const { templates, translateString } = registry;
|
|
632
636
|
const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
|
|
633
|
-
const keyLabel = translateString(TranslatableString4.KeyLabel, [label]);
|
|
637
|
+
const keyLabel = displayLabel ? translateString(TranslatableString4.KeyLabel, [label]) : void 0;
|
|
634
638
|
const additional = ADDITIONAL_PROPERTY_FLAG in schema;
|
|
639
|
+
const hasDescription = !!rawDescription;
|
|
640
|
+
const margin = hasDescription ? 58 : 22;
|
|
635
641
|
if (!additional) {
|
|
636
642
|
return /* @__PURE__ */ jsx21("div", { className: classNames, style, children });
|
|
637
643
|
}
|
|
638
|
-
return /* @__PURE__ */ jsxs11(
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
644
|
+
return /* @__PURE__ */ jsxs11(
|
|
645
|
+
Grid4,
|
|
646
|
+
{
|
|
647
|
+
templateColumns: "repeat(11, 1fr)",
|
|
648
|
+
className: classNames,
|
|
649
|
+
style,
|
|
650
|
+
alignItems: "center",
|
|
651
|
+
gap: 2,
|
|
652
|
+
children: [
|
|
653
|
+
/* @__PURE__ */ jsx21(GridItem4, { colSpan: 5, style: { marginTop: hasDescription ? "36px" : void 0 }, children: /* @__PURE__ */ jsx21(Field, { required, label: keyLabel, children: /* @__PURE__ */ jsx21(
|
|
654
|
+
Input2,
|
|
655
|
+
{
|
|
656
|
+
defaultValue: label,
|
|
657
|
+
disabled: disabled || readonly,
|
|
658
|
+
id: `${id}-key`,
|
|
659
|
+
name: `${id}-key`,
|
|
660
|
+
onBlur: !readonly ? onKeyRenameBlur : void 0,
|
|
661
|
+
type: "text",
|
|
662
|
+
mb: 1
|
|
663
|
+
}
|
|
664
|
+
) }) }),
|
|
665
|
+
/* @__PURE__ */ jsx21(GridItem4, { colSpan: 5, children }),
|
|
666
|
+
/* @__PURE__ */ jsx21(GridItem4, { justifySelf: "flex-end", style: { marginTop: displayLabel ? `${margin}px` : void 0 }, children: /* @__PURE__ */ jsx21(
|
|
667
|
+
RemoveButton2,
|
|
668
|
+
{
|
|
669
|
+
id: buttonId3(id, "remove"),
|
|
670
|
+
className: "rjsf-object-property-remove",
|
|
671
|
+
disabled: disabled || readonly,
|
|
672
|
+
onClick: onRemoveProperty,
|
|
673
|
+
uiSchema,
|
|
674
|
+
registry
|
|
675
|
+
}
|
|
676
|
+
) })
|
|
677
|
+
]
|
|
678
|
+
},
|
|
679
|
+
`${id}-key`
|
|
680
|
+
);
|
|
664
681
|
}
|
|
665
682
|
|
|
666
683
|
// src/Templates/Templates.ts
|