@rjsf/core 6.5.3 → 6.6.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/core.umd.js +240 -279
- package/dist/index.cjs +330 -369
- package/dist/index.cjs.map +4 -4
- package/dist/index.esm.js +288 -328
- package/dist/index.esm.js.map +4 -4
- package/lib/components/Form.d.ts +3 -4
- package/lib/components/Form.d.ts.map +1 -1
- package/lib/components/Form.js +6 -25
- package/lib/components/RichDescription.js +1 -1
- package/lib/components/RichHelp.js +1 -1
- package/lib/components/fields/FallbackField.d.ts.map +1 -1
- package/lib/components/fields/FallbackField.js +1 -1
- package/lib/components/fields/LayoutGridField.js +1 -1
- package/lib/components/fields/MultiSchemaField.d.ts.map +1 -1
- package/lib/components/fields/MultiSchemaField.js +1 -1
- package/lib/components/fields/ObjectField.js +1 -1
- package/lib/components/fields/index.js +1 -1
- package/lib/components/templates/ButtonTemplates/index.js +1 -1
- package/lib/components/templates/FieldHelpTemplate.d.ts.map +1 -1
- package/lib/components/templates/UnsupportedField.js +1 -1
- package/lib/components/templates/index.js +2 -2
- package/lib/components/widgets/FileWidget.d.ts.map +1 -1
- package/lib/components/widgets/FileWidget.js +3 -2
- package/lib/components/widgets/index.js +4 -4
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/withTheme.d.ts +1 -1
- package/lib/withTheme.d.ts.map +1 -1
- package/package.json +18 -18
- package/src/components/Form.tsx +8 -52
- package/src/components/RichDescription.tsx +1 -1
- package/src/components/RichHelp.tsx +1 -1
- package/src/components/fields/FallbackField.tsx +1 -1
- package/src/components/fields/LayoutGridField.tsx +1 -1
- package/src/components/fields/MultiSchemaField.tsx +3 -3
- package/src/components/fields/ObjectField.tsx +1 -1
- package/src/components/fields/index.ts +1 -1
- package/src/components/templates/ButtonTemplates/index.ts +1 -1
- package/src/components/templates/FieldHelpTemplate.tsx +1 -0
- package/src/components/templates/UnsupportedField.tsx +1 -1
- package/src/components/templates/index.ts +2 -2
- package/src/components/widgets/FileWidget.tsx +3 -2
- package/src/components/widgets/index.ts +4 -4
- package/src/index.ts +1 -1
- package/src/tsconfig.json +0 -1
- package/src/withTheme.tsx +2 -1
package/dist/index.esm.js
CHANGED
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
getUiOptions as getUiOptions21,
|
|
10
10
|
isObject as isObject6,
|
|
11
11
|
mergeObjects,
|
|
12
|
-
removeOptionalEmptyObjects,
|
|
13
12
|
shouldRender as shouldRender2,
|
|
14
13
|
SUBMIT_BTN_OPTIONS_KEY,
|
|
15
14
|
toErrorList,
|
|
@@ -965,6 +964,7 @@ function BooleanField(props) {
|
|
|
965
964
|
var BooleanField_default = BooleanField;
|
|
966
965
|
|
|
967
966
|
// src/components/fields/FallbackField.tsx
|
|
967
|
+
import { useMemo as useMemo2, useState as useState2 } from "react";
|
|
968
968
|
import {
|
|
969
969
|
getTemplate as getTemplate2,
|
|
970
970
|
getUiOptions as getUiOptions3,
|
|
@@ -973,7 +973,6 @@ import {
|
|
|
973
973
|
TranslatableString as TranslatableString3,
|
|
974
974
|
useDeepCompareMemo as useDeepCompareMemo2
|
|
975
975
|
} from "@rjsf/utils";
|
|
976
|
-
import { useMemo as useMemo2, useState as useState2 } from "react";
|
|
977
976
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
978
977
|
function getFallbackTypeSelectionSchema(title) {
|
|
979
978
|
return {
|
|
@@ -1118,8 +1117,8 @@ import has from "lodash/has";
|
|
|
1118
1117
|
import includes from "lodash/includes";
|
|
1119
1118
|
import intersection from "lodash/intersection";
|
|
1120
1119
|
import isEmpty from "lodash/isEmpty";
|
|
1121
|
-
import isFunction from "lodash/isFunction";
|
|
1122
1120
|
import isEqual from "lodash/isEqual";
|
|
1121
|
+
import isFunction from "lodash/isFunction";
|
|
1123
1122
|
import isObject3 from "lodash/isObject";
|
|
1124
1123
|
import isPlainObject from "lodash/isPlainObject";
|
|
1125
1124
|
import isString from "lodash/isString";
|
|
@@ -1670,9 +1669,6 @@ function LayoutMultiSchemaField(props) {
|
|
|
1670
1669
|
|
|
1671
1670
|
// src/components/fields/MultiSchemaField.tsx
|
|
1672
1671
|
import { Component } from "react";
|
|
1673
|
-
import get3 from "lodash/get";
|
|
1674
|
-
import isEmpty3 from "lodash/isEmpty";
|
|
1675
|
-
import omit2 from "lodash/omit";
|
|
1676
1672
|
import {
|
|
1677
1673
|
ANY_OF_KEY as ANY_OF_KEY3,
|
|
1678
1674
|
deepEquals,
|
|
@@ -1687,6 +1683,9 @@ import {
|
|
|
1687
1683
|
shouldRenderOptionalField as shouldRenderOptionalField2,
|
|
1688
1684
|
TranslatableString as TranslatableString4
|
|
1689
1685
|
} from "@rjsf/utils";
|
|
1686
|
+
import get3 from "lodash/get";
|
|
1687
|
+
import isEmpty3 from "lodash/isEmpty";
|
|
1688
|
+
import omit2 from "lodash/omit";
|
|
1690
1689
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1691
1690
|
var AnyOfField = class extends Component {
|
|
1692
1691
|
/** Constructs an `AnyOfField` with the given `props` to initialize the initially selected option in state
|
|
@@ -1887,6 +1886,19 @@ var AnyOfField = class extends Component {
|
|
|
1887
1886
|
};
|
|
1888
1887
|
var MultiSchemaField_default = AnyOfField;
|
|
1889
1888
|
|
|
1889
|
+
// src/components/fields/NullField.tsx
|
|
1890
|
+
import { useEffect as useEffect2 } from "react";
|
|
1891
|
+
function NullField(props) {
|
|
1892
|
+
const { formData, onChange, fieldPathId } = props;
|
|
1893
|
+
useEffect2(() => {
|
|
1894
|
+
if (formData === void 0) {
|
|
1895
|
+
onChange(null, fieldPathId.path);
|
|
1896
|
+
}
|
|
1897
|
+
}, [fieldPathId, formData, onChange]);
|
|
1898
|
+
return null;
|
|
1899
|
+
}
|
|
1900
|
+
var NullField_default = NullField;
|
|
1901
|
+
|
|
1890
1902
|
// src/components/fields/NumberField.tsx
|
|
1891
1903
|
import { useState as useState4, useCallback as useCallback3 } from "react";
|
|
1892
1904
|
import {
|
|
@@ -1938,15 +1950,15 @@ import {
|
|
|
1938
1950
|
REF_KEY,
|
|
1939
1951
|
TranslatableString as TranslatableString5
|
|
1940
1952
|
} from "@rjsf/utils";
|
|
1941
|
-
import Markdown from "markdown-to-jsx";
|
|
1942
1953
|
import get4 from "lodash/get";
|
|
1943
1954
|
import has3 from "lodash/has";
|
|
1944
1955
|
import isObject4 from "lodash/isObject";
|
|
1945
1956
|
import set4 from "lodash/set";
|
|
1957
|
+
import { Markdown } from "markdown-to-jsx";
|
|
1946
1958
|
|
|
1947
1959
|
// src/components/constants.ts
|
|
1948
|
-
var ADDITIONAL_PROPERTY_KEY_REMOVE = Symbol("remove-this-key");
|
|
1949
|
-
var IS_RESET = Symbol("reset");
|
|
1960
|
+
var ADDITIONAL_PROPERTY_KEY_REMOVE = /* @__PURE__ */ Symbol("remove-this-key");
|
|
1961
|
+
var IS_RESET = /* @__PURE__ */ Symbol("reset");
|
|
1950
1962
|
|
|
1951
1963
|
// src/components/fields/ObjectField.tsx
|
|
1952
1964
|
import { jsx as jsx9, jsxs } from "react/jsx-runtime";
|
|
@@ -2641,19 +2653,6 @@ function StringField(props) {
|
|
|
2641
2653
|
}
|
|
2642
2654
|
var StringField_default = StringField;
|
|
2643
2655
|
|
|
2644
|
-
// src/components/fields/NullField.tsx
|
|
2645
|
-
import { useEffect as useEffect2 } from "react";
|
|
2646
|
-
function NullField(props) {
|
|
2647
|
-
const { formData, onChange, fieldPathId } = props;
|
|
2648
|
-
useEffect2(() => {
|
|
2649
|
-
if (formData === void 0) {
|
|
2650
|
-
onChange(null, fieldPathId.path);
|
|
2651
|
-
}
|
|
2652
|
-
}, [fieldPathId, formData, onChange]);
|
|
2653
|
-
return null;
|
|
2654
|
-
}
|
|
2655
|
-
var NullField_default = NullField;
|
|
2656
|
-
|
|
2657
2656
|
// src/components/fields/index.ts
|
|
2658
2657
|
function fields() {
|
|
2659
2658
|
return {
|
|
@@ -2707,40 +2706,11 @@ function ArrayFieldDescriptionTemplate(props) {
|
|
|
2707
2706
|
);
|
|
2708
2707
|
}
|
|
2709
2708
|
|
|
2710
|
-
// src/components/templates/ArrayFieldItemTemplate.tsx
|
|
2711
|
-
import {
|
|
2712
|
-
getTemplate as getTemplate11,
|
|
2713
|
-
getUiOptions as getUiOptions13
|
|
2714
|
-
} from "@rjsf/utils";
|
|
2715
|
-
import { jsx as jsx14, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
2716
|
-
function ArrayFieldItemTemplate(props) {
|
|
2717
|
-
const { children, className, buttonsProps, displayLabel, hasDescription, hasToolbar, registry, uiSchema } = props;
|
|
2718
|
-
const uiOptions = getUiOptions13(uiSchema);
|
|
2719
|
-
const ArrayFieldItemButtonsTemplate2 = getTemplate11(
|
|
2720
|
-
"ArrayFieldItemButtonsTemplate",
|
|
2721
|
-
registry,
|
|
2722
|
-
uiOptions
|
|
2723
|
-
);
|
|
2724
|
-
const btnStyle = {
|
|
2725
|
-
flex: 1,
|
|
2726
|
-
paddingLeft: 6,
|
|
2727
|
-
paddingRight: 6,
|
|
2728
|
-
fontWeight: "bold"
|
|
2729
|
-
};
|
|
2730
|
-
const margin = hasDescription ? 31 : 9;
|
|
2731
|
-
const containerStyle = { display: "flex", alignItems: displayLabel ? "center" : "baseline" };
|
|
2732
|
-
const toolbarStyle = { display: "flex", justifyContent: "flex-end", marginTop: displayLabel ? `${margin}px` : 0 };
|
|
2733
|
-
return /* @__PURE__ */ jsxs3("div", { className, style: containerStyle, children: [
|
|
2734
|
-
/* @__PURE__ */ jsx14("div", { className: hasToolbar ? "col-xs-9 col-md-10 col-xl-11" : "col-xs-12", children }),
|
|
2735
|
-
hasToolbar && /* @__PURE__ */ jsx14("div", { className: "col-xs-3 col-md-2 col-xl-1 array-item-toolbox", children: /* @__PURE__ */ jsx14("div", { className: "btn-group", style: toolbarStyle, children: /* @__PURE__ */ jsx14(ArrayFieldItemButtonsTemplate2, { ...buttonsProps, style: btnStyle }) }) })
|
|
2736
|
-
] });
|
|
2737
|
-
}
|
|
2738
|
-
|
|
2739
2709
|
// src/components/templates/ArrayFieldItemButtonsTemplate.tsx
|
|
2740
2710
|
import {
|
|
2741
2711
|
buttonId
|
|
2742
2712
|
} from "@rjsf/utils";
|
|
2743
|
-
import { Fragment as Fragment2, jsx as
|
|
2713
|
+
import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
2744
2714
|
function ArrayFieldItemButtonsTemplate(props) {
|
|
2745
2715
|
const {
|
|
2746
2716
|
disabled,
|
|
@@ -2758,8 +2728,8 @@ function ArrayFieldItemButtonsTemplate(props) {
|
|
|
2758
2728
|
uiSchema
|
|
2759
2729
|
} = props;
|
|
2760
2730
|
const { CopyButton: CopyButton2, MoveDownButton: MoveDownButton2, MoveUpButton: MoveUpButton2, RemoveButton: RemoveButton2 } = registry.templates.ButtonTemplates;
|
|
2761
|
-
return /* @__PURE__ */
|
|
2762
|
-
(hasMoveUp || hasMoveDown) && /* @__PURE__ */
|
|
2731
|
+
return /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
2732
|
+
(hasMoveUp || hasMoveDown) && /* @__PURE__ */ jsx14(
|
|
2763
2733
|
MoveUpButton2,
|
|
2764
2734
|
{
|
|
2765
2735
|
id: buttonId(fieldPathId, "moveUp"),
|
|
@@ -2770,7 +2740,7 @@ function ArrayFieldItemButtonsTemplate(props) {
|
|
|
2770
2740
|
registry
|
|
2771
2741
|
}
|
|
2772
2742
|
),
|
|
2773
|
-
(hasMoveUp || hasMoveDown) && /* @__PURE__ */
|
|
2743
|
+
(hasMoveUp || hasMoveDown) && /* @__PURE__ */ jsx14(
|
|
2774
2744
|
MoveDownButton2,
|
|
2775
2745
|
{
|
|
2776
2746
|
id: buttonId(fieldPathId, "moveDown"),
|
|
@@ -2781,7 +2751,7 @@ function ArrayFieldItemButtonsTemplate(props) {
|
|
|
2781
2751
|
registry
|
|
2782
2752
|
}
|
|
2783
2753
|
),
|
|
2784
|
-
hasCopy && /* @__PURE__ */
|
|
2754
|
+
hasCopy && /* @__PURE__ */ jsx14(
|
|
2785
2755
|
CopyButton2,
|
|
2786
2756
|
{
|
|
2787
2757
|
id: buttonId(fieldPathId, "copy"),
|
|
@@ -2792,7 +2762,7 @@ function ArrayFieldItemButtonsTemplate(props) {
|
|
|
2792
2762
|
registry
|
|
2793
2763
|
}
|
|
2794
2764
|
),
|
|
2795
|
-
hasRemove && /* @__PURE__ */
|
|
2765
|
+
hasRemove && /* @__PURE__ */ jsx14(
|
|
2796
2766
|
RemoveButton2,
|
|
2797
2767
|
{
|
|
2798
2768
|
id: buttonId(fieldPathId, "remove"),
|
|
@@ -2806,6 +2776,35 @@ function ArrayFieldItemButtonsTemplate(props) {
|
|
|
2806
2776
|
] });
|
|
2807
2777
|
}
|
|
2808
2778
|
|
|
2779
|
+
// src/components/templates/ArrayFieldItemTemplate.tsx
|
|
2780
|
+
import {
|
|
2781
|
+
getTemplate as getTemplate11,
|
|
2782
|
+
getUiOptions as getUiOptions13
|
|
2783
|
+
} from "@rjsf/utils";
|
|
2784
|
+
import { jsx as jsx15, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
2785
|
+
function ArrayFieldItemTemplate(props) {
|
|
2786
|
+
const { children, className, buttonsProps, displayLabel, hasDescription, hasToolbar, registry, uiSchema } = props;
|
|
2787
|
+
const uiOptions = getUiOptions13(uiSchema);
|
|
2788
|
+
const ArrayFieldItemButtonsTemplate2 = getTemplate11(
|
|
2789
|
+
"ArrayFieldItemButtonsTemplate",
|
|
2790
|
+
registry,
|
|
2791
|
+
uiOptions
|
|
2792
|
+
);
|
|
2793
|
+
const btnStyle = {
|
|
2794
|
+
flex: 1,
|
|
2795
|
+
paddingLeft: 6,
|
|
2796
|
+
paddingRight: 6,
|
|
2797
|
+
fontWeight: "bold"
|
|
2798
|
+
};
|
|
2799
|
+
const margin = hasDescription ? 31 : 9;
|
|
2800
|
+
const containerStyle = { display: "flex", alignItems: displayLabel ? "center" : "baseline" };
|
|
2801
|
+
const toolbarStyle = { display: "flex", justifyContent: "flex-end", marginTop: displayLabel ? `${margin}px` : 0 };
|
|
2802
|
+
return /* @__PURE__ */ jsxs4("div", { className, style: containerStyle, children: [
|
|
2803
|
+
/* @__PURE__ */ jsx15("div", { className: hasToolbar ? "col-xs-9 col-md-10 col-xl-11" : "col-xs-12", children }),
|
|
2804
|
+
hasToolbar && /* @__PURE__ */ jsx15("div", { className: "col-xs-3 col-md-2 col-xl-1 array-item-toolbox", children: /* @__PURE__ */ jsx15("div", { className: "btn-group", style: toolbarStyle, children: /* @__PURE__ */ jsx15(ArrayFieldItemButtonsTemplate2, { ...buttonsProps, style: btnStyle }) }) })
|
|
2805
|
+
] });
|
|
2806
|
+
}
|
|
2807
|
+
|
|
2809
2808
|
// src/components/templates/ArrayFieldTemplate.tsx
|
|
2810
2809
|
import {
|
|
2811
2810
|
getTemplate as getTemplate12,
|
|
@@ -3027,50 +3026,39 @@ function BaseInputTemplate(props) {
|
|
|
3027
3026
|
] });
|
|
3028
3027
|
}
|
|
3029
3028
|
|
|
3030
|
-
// src/components/templates/ButtonTemplates/SubmitButton.tsx
|
|
3031
|
-
import { getSubmitButtonOptions } from "@rjsf/utils";
|
|
3032
|
-
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
3033
|
-
function SubmitButton({ uiSchema }) {
|
|
3034
|
-
const { submitText, norender, props: submitButtonProps = {} } = getSubmitButtonOptions(uiSchema);
|
|
3035
|
-
if (norender) {
|
|
3036
|
-
return null;
|
|
3037
|
-
}
|
|
3038
|
-
return /* @__PURE__ */ jsx20("div", { children: /* @__PURE__ */ jsx20("button", { type: "submit", ...submitButtonProps, className: `btn btn-info ${submitButtonProps.className || ""}`, children: submitText }) });
|
|
3039
|
-
}
|
|
3040
|
-
|
|
3041
3029
|
// src/components/templates/ButtonTemplates/AddButton.tsx
|
|
3042
3030
|
import { TranslatableString as TranslatableString9 } from "@rjsf/utils";
|
|
3043
3031
|
|
|
3044
3032
|
// src/components/templates/ButtonTemplates/IconButton.tsx
|
|
3045
3033
|
import { TranslatableString as TranslatableString8 } from "@rjsf/utils";
|
|
3046
|
-
import { jsx as
|
|
3034
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
3047
3035
|
function IconButton(props) {
|
|
3048
3036
|
const { iconType = "default", icon, className, uiSchema, registry, ...otherProps } = props;
|
|
3049
|
-
return /* @__PURE__ */
|
|
3037
|
+
return /* @__PURE__ */ jsx20("button", { type: "button", className: `btn btn-${iconType} ${className}`, ...otherProps, children: /* @__PURE__ */ jsx20("i", { className: `glyphicon glyphicon-${icon}` }) });
|
|
3050
3038
|
}
|
|
3051
3039
|
function CopyButton(props) {
|
|
3052
3040
|
const {
|
|
3053
3041
|
registry: { translateString }
|
|
3054
3042
|
} = props;
|
|
3055
|
-
return /* @__PURE__ */
|
|
3043
|
+
return /* @__PURE__ */ jsx20(IconButton, { title: translateString(TranslatableString8.CopyButton), ...props, icon: "copy" });
|
|
3056
3044
|
}
|
|
3057
3045
|
function MoveDownButton(props) {
|
|
3058
3046
|
const {
|
|
3059
3047
|
registry: { translateString }
|
|
3060
3048
|
} = props;
|
|
3061
|
-
return /* @__PURE__ */
|
|
3049
|
+
return /* @__PURE__ */ jsx20(IconButton, { title: translateString(TranslatableString8.MoveDownButton), ...props, icon: "arrow-down" });
|
|
3062
3050
|
}
|
|
3063
3051
|
function MoveUpButton(props) {
|
|
3064
3052
|
const {
|
|
3065
3053
|
registry: { translateString }
|
|
3066
3054
|
} = props;
|
|
3067
|
-
return /* @__PURE__ */
|
|
3055
|
+
return /* @__PURE__ */ jsx20(IconButton, { title: translateString(TranslatableString8.MoveUpButton), ...props, icon: "arrow-up" });
|
|
3068
3056
|
}
|
|
3069
3057
|
function RemoveButton(props) {
|
|
3070
3058
|
const {
|
|
3071
3059
|
registry: { translateString }
|
|
3072
3060
|
} = props;
|
|
3073
|
-
return /* @__PURE__ */
|
|
3061
|
+
return /* @__PURE__ */ jsx20(IconButton, { title: translateString(TranslatableString8.RemoveButton), ...props, iconType: "danger", icon: "remove" });
|
|
3074
3062
|
}
|
|
3075
3063
|
function ClearButton({
|
|
3076
3064
|
id,
|
|
@@ -3081,7 +3069,7 @@ function ClearButton({
|
|
|
3081
3069
|
...props
|
|
3082
3070
|
}) {
|
|
3083
3071
|
const { translateString } = registry;
|
|
3084
|
-
return /* @__PURE__ */
|
|
3072
|
+
return /* @__PURE__ */ jsx20(
|
|
3085
3073
|
IconButton,
|
|
3086
3074
|
{
|
|
3087
3075
|
id,
|
|
@@ -3098,7 +3086,7 @@ function ClearButton({
|
|
|
3098
3086
|
}
|
|
3099
3087
|
|
|
3100
3088
|
// src/components/templates/ButtonTemplates/AddButton.tsx
|
|
3101
|
-
import { jsx as
|
|
3089
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
3102
3090
|
function AddButton({
|
|
3103
3091
|
id,
|
|
3104
3092
|
className,
|
|
@@ -3107,11 +3095,11 @@ function AddButton({
|
|
|
3107
3095
|
registry
|
|
3108
3096
|
}) {
|
|
3109
3097
|
const { translateString } = registry;
|
|
3110
|
-
return /* @__PURE__ */
|
|
3098
|
+
return /* @__PURE__ */ jsx21("div", { className: "row", children: /* @__PURE__ */ jsx21(
|
|
3111
3099
|
"p",
|
|
3112
3100
|
{
|
|
3113
3101
|
className: `col-xs-4 col-sm-2 col-lg-1 col-xs-offset-8 col-sm-offset-10 col-lg-offset-11 text-right ${className}`,
|
|
3114
|
-
children: /* @__PURE__ */
|
|
3102
|
+
children: /* @__PURE__ */ jsx21(
|
|
3115
3103
|
IconButton,
|
|
3116
3104
|
{
|
|
3117
3105
|
id,
|
|
@@ -3128,6 +3116,17 @@ function AddButton({
|
|
|
3128
3116
|
) });
|
|
3129
3117
|
}
|
|
3130
3118
|
|
|
3119
|
+
// src/components/templates/ButtonTemplates/SubmitButton.tsx
|
|
3120
|
+
import { getSubmitButtonOptions } from "@rjsf/utils";
|
|
3121
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
3122
|
+
function SubmitButton({ uiSchema }) {
|
|
3123
|
+
const { submitText, norender, props: submitButtonProps = {} } = getSubmitButtonOptions(uiSchema);
|
|
3124
|
+
if (norender) {
|
|
3125
|
+
return null;
|
|
3126
|
+
}
|
|
3127
|
+
return /* @__PURE__ */ jsx22("div", { children: /* @__PURE__ */ jsx22("button", { type: "submit", ...submitButtonProps, className: `btn btn-info ${submitButtonProps.className || ""}`, children: submitText }) });
|
|
3128
|
+
}
|
|
3129
|
+
|
|
3131
3130
|
// src/components/templates/ButtonTemplates/index.ts
|
|
3132
3131
|
function buttonTemplates() {
|
|
3133
3132
|
return {
|
|
@@ -3147,7 +3146,7 @@ import {
|
|
|
3147
3146
|
getTestIds as getTestIds2,
|
|
3148
3147
|
getUiOptions as getUiOptions16
|
|
3149
3148
|
} from "@rjsf/utils";
|
|
3150
|
-
import Markdown2 from "markdown-to-jsx";
|
|
3149
|
+
import { Markdown as Markdown2 } from "markdown-to-jsx/react";
|
|
3151
3150
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
3152
3151
|
var TEST_IDS = getTestIds2();
|
|
3153
3152
|
function RichDescription({ description, registry, uiSchema = {} }) {
|
|
@@ -3208,63 +3207,17 @@ function FallbackFieldTemplate(props) {
|
|
|
3208
3207
|
);
|
|
3209
3208
|
}
|
|
3210
3209
|
|
|
3211
|
-
// src/components/templates/FieldTemplate/FieldTemplate.tsx
|
|
3212
|
-
import {
|
|
3213
|
-
getTemplate as getTemplate15,
|
|
3214
|
-
getUiOptions as getUiOptions17
|
|
3215
|
-
} from "@rjsf/utils";
|
|
3216
|
-
|
|
3217
|
-
// src/components/templates/FieldTemplate/Label.tsx
|
|
3218
|
-
import { jsx as jsx27, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3219
|
-
var REQUIRED_FIELD_SYMBOL = "*";
|
|
3220
|
-
function Label(props) {
|
|
3221
|
-
const { label, required, id } = props;
|
|
3222
|
-
if (!label) {
|
|
3223
|
-
return null;
|
|
3224
|
-
}
|
|
3225
|
-
return /* @__PURE__ */ jsxs8("label", { className: "control-label", htmlFor: id, children: [
|
|
3226
|
-
label,
|
|
3227
|
-
required && /* @__PURE__ */ jsx27("span", { className: "required", children: REQUIRED_FIELD_SYMBOL })
|
|
3228
|
-
] });
|
|
3229
|
-
}
|
|
3230
|
-
|
|
3231
|
-
// src/components/templates/FieldTemplate/FieldTemplate.tsx
|
|
3232
|
-
import { jsx as jsx28, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3233
|
-
function FieldTemplate(props) {
|
|
3234
|
-
const { id, label, children, errors, help, description, hidden, required, displayLabel, registry, uiSchema } = props;
|
|
3235
|
-
const uiOptions = getUiOptions17(uiSchema);
|
|
3236
|
-
const WrapIfAdditionalTemplate2 = getTemplate15(
|
|
3237
|
-
"WrapIfAdditionalTemplate",
|
|
3238
|
-
registry,
|
|
3239
|
-
uiOptions
|
|
3240
|
-
);
|
|
3241
|
-
if (hidden) {
|
|
3242
|
-
return /* @__PURE__ */ jsx28("div", { className: "hidden", children });
|
|
3243
|
-
}
|
|
3244
|
-
const isCheckbox = uiOptions.widget === "checkbox";
|
|
3245
|
-
return /* @__PURE__ */ jsxs9(WrapIfAdditionalTemplate2, { ...props, children: [
|
|
3246
|
-
displayLabel && !isCheckbox && /* @__PURE__ */ jsx28(Label, { label, required, id }),
|
|
3247
|
-
displayLabel && description ? description : null,
|
|
3248
|
-
children,
|
|
3249
|
-
errors,
|
|
3250
|
-
help
|
|
3251
|
-
] });
|
|
3252
|
-
}
|
|
3253
|
-
|
|
3254
|
-
// src/components/templates/FieldTemplate/index.ts
|
|
3255
|
-
var FieldTemplate_default = FieldTemplate;
|
|
3256
|
-
|
|
3257
3210
|
// src/components/templates/FieldErrorTemplate.tsx
|
|
3258
3211
|
import { errorId } from "@rjsf/utils";
|
|
3259
|
-
import { jsx as
|
|
3212
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
3260
3213
|
function FieldErrorTemplate(props) {
|
|
3261
3214
|
const { errors = [], fieldPathId } = props;
|
|
3262
3215
|
if (errors.length === 0) {
|
|
3263
3216
|
return null;
|
|
3264
3217
|
}
|
|
3265
3218
|
const id = errorId(fieldPathId);
|
|
3266
|
-
return /* @__PURE__ */
|
|
3267
|
-
return /* @__PURE__ */
|
|
3219
|
+
return /* @__PURE__ */ jsx27("div", { children: /* @__PURE__ */ jsx27("ul", { id, className: "error-detail bs-callout bs-callout-info", children: errors.filter((elem) => !!elem).map((error, index) => {
|
|
3220
|
+
return /* @__PURE__ */ jsx27("li", { className: "text-danger", children: error }, index);
|
|
3268
3221
|
}) }) });
|
|
3269
3222
|
}
|
|
3270
3223
|
|
|
@@ -3274,10 +3227,10 @@ import { helpId } from "@rjsf/utils";
|
|
|
3274
3227
|
// src/components/RichHelp.tsx
|
|
3275
3228
|
import {
|
|
3276
3229
|
getTestIds as getTestIds3,
|
|
3277
|
-
getUiOptions as
|
|
3230
|
+
getUiOptions as getUiOptions17
|
|
3278
3231
|
} from "@rjsf/utils";
|
|
3279
|
-
import Markdown3 from "markdown-to-jsx";
|
|
3280
|
-
import { jsx as
|
|
3232
|
+
import { Markdown as Markdown3 } from "markdown-to-jsx/react";
|
|
3233
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
3281
3234
|
var TEST_IDS2 = getTestIds3();
|
|
3282
3235
|
function RichHelp({
|
|
3283
3236
|
help,
|
|
@@ -3285,24 +3238,70 @@ function RichHelp({
|
|
|
3285
3238
|
uiSchema = {}
|
|
3286
3239
|
}) {
|
|
3287
3240
|
const { globalUiOptions } = registry;
|
|
3288
|
-
const uiOptions =
|
|
3241
|
+
const uiOptions = getUiOptions17(uiSchema, globalUiOptions);
|
|
3289
3242
|
if (uiOptions.enableMarkdownInHelp && typeof help === "string") {
|
|
3290
|
-
return /* @__PURE__ */
|
|
3243
|
+
return /* @__PURE__ */ jsx28(Markdown3, { options: { disableParsingRawHTML: true }, "data-testid": TEST_IDS2.markdown, children: help });
|
|
3291
3244
|
}
|
|
3292
3245
|
return help;
|
|
3293
3246
|
}
|
|
3294
3247
|
RichHelp.TEST_IDS = TEST_IDS2;
|
|
3295
3248
|
|
|
3296
3249
|
// src/components/templates/FieldHelpTemplate.tsx
|
|
3297
|
-
import { jsx as
|
|
3250
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
3298
3251
|
function FieldHelpTemplate(props) {
|
|
3299
3252
|
const { fieldPathId, help, uiSchema, registry } = props;
|
|
3300
3253
|
if (!help) {
|
|
3301
3254
|
return null;
|
|
3302
3255
|
}
|
|
3303
|
-
return /* @__PURE__ */
|
|
3256
|
+
return /* @__PURE__ */ jsx29("div", { id: helpId(fieldPathId), className: "help-block", children: /* @__PURE__ */ jsx29(RichHelp, { help, registry, uiSchema }) });
|
|
3304
3257
|
}
|
|
3305
3258
|
|
|
3259
|
+
// src/components/templates/FieldTemplate/FieldTemplate.tsx
|
|
3260
|
+
import {
|
|
3261
|
+
getTemplate as getTemplate15,
|
|
3262
|
+
getUiOptions as getUiOptions18
|
|
3263
|
+
} from "@rjsf/utils";
|
|
3264
|
+
|
|
3265
|
+
// src/components/templates/FieldTemplate/Label.tsx
|
|
3266
|
+
import { jsx as jsx30, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3267
|
+
var REQUIRED_FIELD_SYMBOL = "*";
|
|
3268
|
+
function Label(props) {
|
|
3269
|
+
const { label, required, id } = props;
|
|
3270
|
+
if (!label) {
|
|
3271
|
+
return null;
|
|
3272
|
+
}
|
|
3273
|
+
return /* @__PURE__ */ jsxs8("label", { className: "control-label", htmlFor: id, children: [
|
|
3274
|
+
label,
|
|
3275
|
+
required && /* @__PURE__ */ jsx30("span", { className: "required", children: REQUIRED_FIELD_SYMBOL })
|
|
3276
|
+
] });
|
|
3277
|
+
}
|
|
3278
|
+
|
|
3279
|
+
// src/components/templates/FieldTemplate/FieldTemplate.tsx
|
|
3280
|
+
import { jsx as jsx31, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3281
|
+
function FieldTemplate(props) {
|
|
3282
|
+
const { id, label, children, errors, help, description, hidden, required, displayLabel, registry, uiSchema } = props;
|
|
3283
|
+
const uiOptions = getUiOptions18(uiSchema);
|
|
3284
|
+
const WrapIfAdditionalTemplate2 = getTemplate15(
|
|
3285
|
+
"WrapIfAdditionalTemplate",
|
|
3286
|
+
registry,
|
|
3287
|
+
uiOptions
|
|
3288
|
+
);
|
|
3289
|
+
if (hidden) {
|
|
3290
|
+
return /* @__PURE__ */ jsx31("div", { className: "hidden", children });
|
|
3291
|
+
}
|
|
3292
|
+
const isCheckbox = uiOptions.widget === "checkbox";
|
|
3293
|
+
return /* @__PURE__ */ jsxs9(WrapIfAdditionalTemplate2, { ...props, children: [
|
|
3294
|
+
displayLabel && !isCheckbox && /* @__PURE__ */ jsx31(Label, { label, required, id }),
|
|
3295
|
+
displayLabel && description ? description : null,
|
|
3296
|
+
children,
|
|
3297
|
+
errors,
|
|
3298
|
+
help
|
|
3299
|
+
] });
|
|
3300
|
+
}
|
|
3301
|
+
|
|
3302
|
+
// src/components/templates/FieldTemplate/index.ts
|
|
3303
|
+
var FieldTemplate_default = FieldTemplate;
|
|
3304
|
+
|
|
3306
3305
|
// src/components/templates/GridTemplate.tsx
|
|
3307
3306
|
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
3308
3307
|
function GridTemplate(props) {
|
|
@@ -3447,7 +3446,7 @@ function TitleField(props) {
|
|
|
3447
3446
|
|
|
3448
3447
|
// src/components/templates/UnsupportedField.tsx
|
|
3449
3448
|
import { TranslatableString as TranslatableString11 } from "@rjsf/utils";
|
|
3450
|
-
import Markdown4 from "markdown-to-jsx";
|
|
3449
|
+
import { Markdown as Markdown4 } from "markdown-to-jsx";
|
|
3451
3450
|
import { jsx as jsx37, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3452
3451
|
function UnsupportedField(props) {
|
|
3453
3452
|
const { schema, fieldPathId, reason, registry } = props;
|
|
@@ -3569,19 +3568,30 @@ function templates() {
|
|
|
3569
3568
|
}
|
|
3570
3569
|
var templates_default = templates;
|
|
3571
3570
|
|
|
3571
|
+
// src/components/widgets/AltDateTimeWidget.tsx
|
|
3572
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
3573
|
+
function AltDateTimeWidget({
|
|
3574
|
+
time = true,
|
|
3575
|
+
...props
|
|
3576
|
+
}) {
|
|
3577
|
+
const { AltDateWidget: AltDateWidget2 } = props.registry.widgets;
|
|
3578
|
+
return /* @__PURE__ */ jsx39(AltDateWidget2, { time, ...props });
|
|
3579
|
+
}
|
|
3580
|
+
var AltDateTimeWidget_default = AltDateTimeWidget;
|
|
3581
|
+
|
|
3572
3582
|
// src/components/widgets/AltDateWidget.tsx
|
|
3573
3583
|
import {
|
|
3574
3584
|
DateElement,
|
|
3575
3585
|
TranslatableString as TranslatableString13,
|
|
3576
3586
|
useAltDateWidgetProps
|
|
3577
3587
|
} from "@rjsf/utils";
|
|
3578
|
-
import { jsx as
|
|
3588
|
+
import { jsx as jsx40, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3579
3589
|
function AltDateWidget(props) {
|
|
3580
3590
|
const { disabled = false, readonly = false, autofocus = false, options, id, name, registry, onBlur, onFocus } = props;
|
|
3581
3591
|
const { translateString } = registry;
|
|
3582
3592
|
const { elements, handleChange, handleClear, handleSetNow } = useAltDateWidgetProps(props);
|
|
3583
3593
|
return /* @__PURE__ */ jsxs15("ul", { className: "list-inline", children: [
|
|
3584
|
-
elements.map((elemProps, i) => /* @__PURE__ */
|
|
3594
|
+
elements.map((elemProps, i) => /* @__PURE__ */ jsx40("li", { className: "list-inline-item", children: /* @__PURE__ */ jsx40(
|
|
3585
3595
|
DateElement,
|
|
3586
3596
|
{
|
|
3587
3597
|
rootId: id,
|
|
@@ -3596,34 +3606,94 @@ function AltDateWidget(props) {
|
|
|
3596
3606
|
autofocus: autofocus && i === 0
|
|
3597
3607
|
}
|
|
3598
3608
|
) }, i)),
|
|
3599
|
-
(options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /* @__PURE__ */
|
|
3600
|
-
(options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /* @__PURE__ */
|
|
3609
|
+
(options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /* @__PURE__ */ jsx40("li", { className: "list-inline-item", children: /* @__PURE__ */ jsx40("a", { href: "#", className: "btn btn-info btn-now", onClick: handleSetNow, children: translateString(TranslatableString13.NowLabel) }) }),
|
|
3610
|
+
(options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /* @__PURE__ */ jsx40("li", { className: "list-inline-item", children: /* @__PURE__ */ jsx40("a", { href: "#", className: "btn btn-warning btn-clear", onClick: handleClear, children: translateString(TranslatableString13.ClearLabel) }) })
|
|
3601
3611
|
] });
|
|
3602
3612
|
}
|
|
3603
3613
|
var AltDateWidget_default = AltDateWidget;
|
|
3604
3614
|
|
|
3605
|
-
// src/components/widgets/
|
|
3606
|
-
import {
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3615
|
+
// src/components/widgets/CheckboxesWidget.tsx
|
|
3616
|
+
import { useCallback as useCallback8 } from "react";
|
|
3617
|
+
import {
|
|
3618
|
+
ariaDescribedByIds as ariaDescribedByIds2,
|
|
3619
|
+
enumOptionValueDecoder,
|
|
3620
|
+
enumOptionValueEncoder,
|
|
3621
|
+
enumOptionsDeselectValue,
|
|
3622
|
+
enumOptionsIsSelected,
|
|
3623
|
+
enumOptionsSelectValue,
|
|
3624
|
+
getOptionValueFormat,
|
|
3625
|
+
optionId
|
|
3626
|
+
} from "@rjsf/utils";
|
|
3627
|
+
import { jsx as jsx41, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3628
|
+
function CheckboxesWidget({
|
|
3629
|
+
id,
|
|
3630
|
+
disabled,
|
|
3631
|
+
options,
|
|
3632
|
+
value,
|
|
3633
|
+
autofocus = false,
|
|
3634
|
+
readonly,
|
|
3635
|
+
onChange,
|
|
3636
|
+
onBlur,
|
|
3637
|
+
onFocus,
|
|
3638
|
+
htmlName
|
|
3610
3639
|
}) {
|
|
3611
|
-
const {
|
|
3612
|
-
|
|
3640
|
+
const { inline = false, enumOptions, enumDisabled, emptyValue } = options;
|
|
3641
|
+
const optionValueFormat = getOptionValueFormat(options);
|
|
3642
|
+
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
3643
|
+
const handleBlur = useCallback8(
|
|
3644
|
+
({ target }) => onBlur(id, enumOptionValueDecoder(target && target.value, enumOptions, optionValueFormat, emptyValue)),
|
|
3645
|
+
[onBlur, id, enumOptions, emptyValue, optionValueFormat]
|
|
3646
|
+
);
|
|
3647
|
+
const handleFocus = useCallback8(
|
|
3648
|
+
({ target }) => onFocus(id, enumOptionValueDecoder(target && target.value, enumOptions, optionValueFormat, emptyValue)),
|
|
3649
|
+
[onFocus, id, enumOptions, emptyValue, optionValueFormat]
|
|
3650
|
+
);
|
|
3651
|
+
return /* @__PURE__ */ jsx41("div", { className: "checkboxes", id, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
3652
|
+
const checked = enumOptionsIsSelected(option.value, checkboxesValues);
|
|
3653
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
3654
|
+
const disabledCls = disabled || itemDisabled || readonly ? "disabled" : "";
|
|
3655
|
+
const handleChange = (event) => {
|
|
3656
|
+
if (event.target.checked) {
|
|
3657
|
+
onChange(enumOptionsSelectValue(index, checkboxesValues, enumOptions));
|
|
3658
|
+
} else {
|
|
3659
|
+
onChange(enumOptionsDeselectValue(index, checkboxesValues, enumOptions));
|
|
3660
|
+
}
|
|
3661
|
+
};
|
|
3662
|
+
const checkbox = /* @__PURE__ */ jsxs16("span", { children: [
|
|
3663
|
+
/* @__PURE__ */ jsx41(
|
|
3664
|
+
"input",
|
|
3665
|
+
{
|
|
3666
|
+
type: "checkbox",
|
|
3667
|
+
id: optionId(id, index),
|
|
3668
|
+
name: htmlName || id,
|
|
3669
|
+
checked,
|
|
3670
|
+
value: enumOptionValueEncoder(option.value, index, optionValueFormat),
|
|
3671
|
+
disabled: disabled || itemDisabled || readonly,
|
|
3672
|
+
autoFocus: autofocus && index === 0,
|
|
3673
|
+
onChange: handleChange,
|
|
3674
|
+
onBlur: handleBlur,
|
|
3675
|
+
onFocus: handleFocus,
|
|
3676
|
+
"aria-describedby": ariaDescribedByIds2(id)
|
|
3677
|
+
}
|
|
3678
|
+
),
|
|
3679
|
+
/* @__PURE__ */ jsx41("span", { children: option.label })
|
|
3680
|
+
] });
|
|
3681
|
+
return inline ? /* @__PURE__ */ jsx41("label", { className: `checkbox-inline ${disabledCls}`, children: checkbox }, index) : /* @__PURE__ */ jsx41("div", { className: `checkbox ${disabledCls}`, children: /* @__PURE__ */ jsx41("label", { children: checkbox }) }, index);
|
|
3682
|
+
}) });
|
|
3613
3683
|
}
|
|
3614
|
-
var
|
|
3684
|
+
var CheckboxesWidget_default = CheckboxesWidget;
|
|
3615
3685
|
|
|
3616
3686
|
// src/components/widgets/CheckboxWidget.tsx
|
|
3617
|
-
import { useCallback as
|
|
3687
|
+
import { useCallback as useCallback9 } from "react";
|
|
3618
3688
|
import {
|
|
3619
|
-
ariaDescribedByIds as
|
|
3689
|
+
ariaDescribedByIds as ariaDescribedByIds3,
|
|
3620
3690
|
descriptionId as descriptionId4,
|
|
3621
3691
|
getTemplate as getTemplate17,
|
|
3622
3692
|
labelValue,
|
|
3623
3693
|
schemaRequiresTrueValue,
|
|
3624
3694
|
getUiOptions as getUiOptions20
|
|
3625
3695
|
} from "@rjsf/utils";
|
|
3626
|
-
import { jsx as
|
|
3696
|
+
import { jsx as jsx42, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3627
3697
|
function CheckboxWidget({
|
|
3628
3698
|
schema,
|
|
3629
3699
|
uiSchema,
|
|
@@ -3647,23 +3717,23 @@ function CheckboxWidget({
|
|
|
3647
3717
|
options
|
|
3648
3718
|
);
|
|
3649
3719
|
const required = schemaRequiresTrueValue(schema);
|
|
3650
|
-
const handleChange =
|
|
3720
|
+
const handleChange = useCallback9(
|
|
3651
3721
|
(event) => onChange(event.target.checked),
|
|
3652
3722
|
[onChange]
|
|
3653
3723
|
);
|
|
3654
|
-
const handleBlur =
|
|
3724
|
+
const handleBlur = useCallback9(
|
|
3655
3725
|
(event) => onBlur(id, event.target.checked),
|
|
3656
3726
|
[onBlur, id]
|
|
3657
3727
|
);
|
|
3658
|
-
const handleFocus =
|
|
3728
|
+
const handleFocus = useCallback9(
|
|
3659
3729
|
(event) => onFocus(id, event.target.checked),
|
|
3660
3730
|
[onFocus, id]
|
|
3661
3731
|
);
|
|
3662
3732
|
const uiOptions = getUiOptions20(uiSchema);
|
|
3663
3733
|
const isCheckboxWidget = uiOptions.widget === "checkbox";
|
|
3664
3734
|
const description = isCheckboxWidget ? void 0 : options.description ?? schema.description;
|
|
3665
|
-
return /* @__PURE__ */
|
|
3666
|
-
!hideLabel && description && /* @__PURE__ */
|
|
3735
|
+
return /* @__PURE__ */ jsxs17("div", { className: `checkbox ${disabled || readonly ? "disabled" : ""}`, children: [
|
|
3736
|
+
!hideLabel && description && /* @__PURE__ */ jsx42(
|
|
3667
3737
|
DescriptionFieldTemplate,
|
|
3668
3738
|
{
|
|
3669
3739
|
id: descriptionId4(id),
|
|
@@ -3673,8 +3743,8 @@ function CheckboxWidget({
|
|
|
3673
3743
|
registry
|
|
3674
3744
|
}
|
|
3675
3745
|
),
|
|
3676
|
-
/* @__PURE__ */
|
|
3677
|
-
/* @__PURE__ */
|
|
3746
|
+
/* @__PURE__ */ jsxs17("label", { children: [
|
|
3747
|
+
/* @__PURE__ */ jsx42(
|
|
3678
3748
|
"input",
|
|
3679
3749
|
{
|
|
3680
3750
|
type: "checkbox",
|
|
@@ -3687,86 +3757,15 @@ function CheckboxWidget({
|
|
|
3687
3757
|
onChange: handleChange,
|
|
3688
3758
|
onBlur: handleBlur,
|
|
3689
3759
|
onFocus: handleFocus,
|
|
3690
|
-
"aria-describedby":
|
|
3760
|
+
"aria-describedby": ariaDescribedByIds3(id)
|
|
3691
3761
|
}
|
|
3692
3762
|
),
|
|
3693
|
-
labelValue(/* @__PURE__ */
|
|
3763
|
+
labelValue(/* @__PURE__ */ jsx42("span", { children: label }), hideLabel)
|
|
3694
3764
|
] })
|
|
3695
3765
|
] });
|
|
3696
3766
|
}
|
|
3697
3767
|
var CheckboxWidget_default = CheckboxWidget;
|
|
3698
3768
|
|
|
3699
|
-
// src/components/widgets/CheckboxesWidget.tsx
|
|
3700
|
-
import { useCallback as useCallback9 } from "react";
|
|
3701
|
-
import {
|
|
3702
|
-
ariaDescribedByIds as ariaDescribedByIds3,
|
|
3703
|
-
enumOptionValueDecoder,
|
|
3704
|
-
enumOptionValueEncoder,
|
|
3705
|
-
enumOptionsDeselectValue,
|
|
3706
|
-
enumOptionsIsSelected,
|
|
3707
|
-
enumOptionsSelectValue,
|
|
3708
|
-
getOptionValueFormat,
|
|
3709
|
-
optionId
|
|
3710
|
-
} from "@rjsf/utils";
|
|
3711
|
-
import { jsx as jsx42, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3712
|
-
function CheckboxesWidget({
|
|
3713
|
-
id,
|
|
3714
|
-
disabled,
|
|
3715
|
-
options,
|
|
3716
|
-
value,
|
|
3717
|
-
autofocus = false,
|
|
3718
|
-
readonly,
|
|
3719
|
-
onChange,
|
|
3720
|
-
onBlur,
|
|
3721
|
-
onFocus,
|
|
3722
|
-
htmlName
|
|
3723
|
-
}) {
|
|
3724
|
-
const { inline = false, enumOptions, enumDisabled, emptyValue } = options;
|
|
3725
|
-
const optionValueFormat = getOptionValueFormat(options);
|
|
3726
|
-
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
3727
|
-
const handleBlur = useCallback9(
|
|
3728
|
-
({ target }) => onBlur(id, enumOptionValueDecoder(target && target.value, enumOptions, optionValueFormat, emptyValue)),
|
|
3729
|
-
[onBlur, id, enumOptions, emptyValue, optionValueFormat]
|
|
3730
|
-
);
|
|
3731
|
-
const handleFocus = useCallback9(
|
|
3732
|
-
({ target }) => onFocus(id, enumOptionValueDecoder(target && target.value, enumOptions, optionValueFormat, emptyValue)),
|
|
3733
|
-
[onFocus, id, enumOptions, emptyValue, optionValueFormat]
|
|
3734
|
-
);
|
|
3735
|
-
return /* @__PURE__ */ jsx42("div", { className: "checkboxes", id, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
3736
|
-
const checked = enumOptionsIsSelected(option.value, checkboxesValues);
|
|
3737
|
-
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
3738
|
-
const disabledCls = disabled || itemDisabled || readonly ? "disabled" : "";
|
|
3739
|
-
const handleChange = (event) => {
|
|
3740
|
-
if (event.target.checked) {
|
|
3741
|
-
onChange(enumOptionsSelectValue(index, checkboxesValues, enumOptions));
|
|
3742
|
-
} else {
|
|
3743
|
-
onChange(enumOptionsDeselectValue(index, checkboxesValues, enumOptions));
|
|
3744
|
-
}
|
|
3745
|
-
};
|
|
3746
|
-
const checkbox = /* @__PURE__ */ jsxs17("span", { children: [
|
|
3747
|
-
/* @__PURE__ */ jsx42(
|
|
3748
|
-
"input",
|
|
3749
|
-
{
|
|
3750
|
-
type: "checkbox",
|
|
3751
|
-
id: optionId(id, index),
|
|
3752
|
-
name: htmlName || id,
|
|
3753
|
-
checked,
|
|
3754
|
-
value: enumOptionValueEncoder(option.value, index, optionValueFormat),
|
|
3755
|
-
disabled: disabled || itemDisabled || readonly,
|
|
3756
|
-
autoFocus: autofocus && index === 0,
|
|
3757
|
-
onChange: handleChange,
|
|
3758
|
-
onBlur: handleBlur,
|
|
3759
|
-
onFocus: handleFocus,
|
|
3760
|
-
"aria-describedby": ariaDescribedByIds3(id)
|
|
3761
|
-
}
|
|
3762
|
-
),
|
|
3763
|
-
/* @__PURE__ */ jsx42("span", { children: option.label })
|
|
3764
|
-
] });
|
|
3765
|
-
return inline ? /* @__PURE__ */ jsx42("label", { className: `checkbox-inline ${disabledCls}`, children: checkbox }, index) : /* @__PURE__ */ jsx42("div", { className: `checkbox ${disabledCls}`, children: /* @__PURE__ */ jsx42("label", { children: checkbox }) }, index);
|
|
3766
|
-
}) });
|
|
3767
|
-
}
|
|
3768
|
-
var CheckboxesWidget_default = CheckboxesWidget;
|
|
3769
|
-
|
|
3770
3769
|
// src/components/widgets/ColorWidget.tsx
|
|
3771
3770
|
import { getTemplate as getTemplate18 } from "@rjsf/utils";
|
|
3772
3771
|
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
@@ -3776,28 +3775,17 @@ function ColorWidget(props) {
|
|
|
3776
3775
|
return /* @__PURE__ */ jsx43(BaseInputTemplate2, { type: "color", ...props, disabled: disabled || readonly });
|
|
3777
3776
|
}
|
|
3778
3777
|
|
|
3779
|
-
// src/components/widgets/DateWidget.tsx
|
|
3780
|
-
import { useCallback as useCallback10 } from "react";
|
|
3781
|
-
import { getTemplate as getTemplate19 } from "@rjsf/utils";
|
|
3782
|
-
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
3783
|
-
function DateWidget(props) {
|
|
3784
|
-
const { onChange, options, registry } = props;
|
|
3785
|
-
const BaseInputTemplate2 = getTemplate19("BaseInputTemplate", registry, options);
|
|
3786
|
-
const handleChange = useCallback10((value) => onChange(value || void 0), [onChange]);
|
|
3787
|
-
return /* @__PURE__ */ jsx44(BaseInputTemplate2, { type: "date", ...props, onChange: handleChange });
|
|
3788
|
-
}
|
|
3789
|
-
|
|
3790
3778
|
// src/components/widgets/DateTimeWidget.tsx
|
|
3791
3779
|
import {
|
|
3792
|
-
getTemplate as
|
|
3780
|
+
getTemplate as getTemplate19,
|
|
3793
3781
|
localToUTC,
|
|
3794
3782
|
utcToLocal
|
|
3795
3783
|
} from "@rjsf/utils";
|
|
3796
|
-
import { jsx as
|
|
3784
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
3797
3785
|
function DateTimeWidget(props) {
|
|
3798
3786
|
const { onChange, value, options, registry } = props;
|
|
3799
|
-
const BaseInputTemplate2 =
|
|
3800
|
-
return /* @__PURE__ */
|
|
3787
|
+
const BaseInputTemplate2 = getTemplate19("BaseInputTemplate", registry, options);
|
|
3788
|
+
return /* @__PURE__ */ jsx44(
|
|
3801
3789
|
BaseInputTemplate2,
|
|
3802
3790
|
{
|
|
3803
3791
|
type: "datetime-local",
|
|
@@ -3808,6 +3796,17 @@ function DateTimeWidget(props) {
|
|
|
3808
3796
|
);
|
|
3809
3797
|
}
|
|
3810
3798
|
|
|
3799
|
+
// src/components/widgets/DateWidget.tsx
|
|
3800
|
+
import { useCallback as useCallback10 } from "react";
|
|
3801
|
+
import { getTemplate as getTemplate20 } from "@rjsf/utils";
|
|
3802
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
3803
|
+
function DateWidget(props) {
|
|
3804
|
+
const { onChange, options, registry } = props;
|
|
3805
|
+
const BaseInputTemplate2 = getTemplate20("BaseInputTemplate", registry, options);
|
|
3806
|
+
const handleChange = useCallback10((value) => onChange(value || void 0), [onChange]);
|
|
3807
|
+
return /* @__PURE__ */ jsx45(BaseInputTemplate2, { type: "date", ...props, onChange: handleChange });
|
|
3808
|
+
}
|
|
3809
|
+
|
|
3811
3810
|
// src/components/widgets/EmailWidget.tsx
|
|
3812
3811
|
import { getTemplate as getTemplate21 } from "@rjsf/utils";
|
|
3813
3812
|
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
@@ -3823,7 +3822,7 @@ import {
|
|
|
3823
3822
|
TranslatableString as TranslatableString14,
|
|
3824
3823
|
useFileWidgetProps
|
|
3825
3824
|
} from "@rjsf/utils";
|
|
3826
|
-
import Markdown5 from "markdown-to-jsx";
|
|
3825
|
+
import { Markdown as Markdown5 } from "markdown-to-jsx";
|
|
3827
3826
|
import { Fragment as Fragment4, jsx as jsx47, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3828
3827
|
function FileInfoPreview({
|
|
3829
3828
|
fileInfo,
|
|
@@ -3870,7 +3869,7 @@ function FileWidget(props) {
|
|
|
3870
3869
|
const BaseInputTemplate2 = getTemplate22("BaseInputTemplate", registry, options);
|
|
3871
3870
|
const handleOnChangeEvent = (event) => {
|
|
3872
3871
|
if (event.target.files) {
|
|
3873
|
-
handleChange(event.target.files);
|
|
3872
|
+
void handleChange(event.target.files);
|
|
3874
3873
|
}
|
|
3875
3874
|
};
|
|
3876
3875
|
return /* @__PURE__ */ jsxs18("div", { children: [
|
|
@@ -4261,22 +4260,22 @@ function TimeWidget(props) {
|
|
|
4261
4260
|
return /* @__PURE__ */ jsx56(BaseInputTemplate2, { type: "time", ...props, onChange: handleChange });
|
|
4262
4261
|
}
|
|
4263
4262
|
|
|
4264
|
-
// src/components/widgets/
|
|
4263
|
+
// src/components/widgets/UpDownWidget.tsx
|
|
4265
4264
|
import { getTemplate as getTemplate26 } from "@rjsf/utils";
|
|
4266
4265
|
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
4267
|
-
function
|
|
4266
|
+
function UpDownWidget(props) {
|
|
4268
4267
|
const { options, registry } = props;
|
|
4269
4268
|
const BaseInputTemplate2 = getTemplate26("BaseInputTemplate", registry, options);
|
|
4270
|
-
return /* @__PURE__ */ jsx57(BaseInputTemplate2, { type: "
|
|
4269
|
+
return /* @__PURE__ */ jsx57(BaseInputTemplate2, { type: "number", ...props });
|
|
4271
4270
|
}
|
|
4272
4271
|
|
|
4273
|
-
// src/components/widgets/
|
|
4272
|
+
// src/components/widgets/URLWidget.tsx
|
|
4274
4273
|
import { getTemplate as getTemplate27 } from "@rjsf/utils";
|
|
4275
4274
|
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
4276
|
-
function
|
|
4275
|
+
function URLWidget(props) {
|
|
4277
4276
|
const { options, registry } = props;
|
|
4278
4277
|
const BaseInputTemplate2 = getTemplate27("BaseInputTemplate", registry, options);
|
|
4279
|
-
return /* @__PURE__ */ jsx58(BaseInputTemplate2, { type: "
|
|
4278
|
+
return /* @__PURE__ */ jsx58(BaseInputTemplate2, { type: "url", ...props });
|
|
4280
4279
|
}
|
|
4281
4280
|
|
|
4282
4281
|
// src/components/widgets/index.ts
|
|
@@ -4760,7 +4759,7 @@ var Form = class extends Component3 {
|
|
|
4760
4759
|
this._isProcessingUserChange = true;
|
|
4761
4760
|
const { newValue, path, id } = this.pendingChanges[0];
|
|
4762
4761
|
const { newErrorSchema } = this.pendingChanges[0];
|
|
4763
|
-
const { extraErrors, omitExtraData, liveOmit, noValidate, liveValidate, onChange
|
|
4762
|
+
const { extraErrors, omitExtraData, liveOmit, noValidate, liveValidate, onChange } = this.props;
|
|
4764
4763
|
const { formData: oldFormData, schemaUtils, schema, fieldPathId, schemaValidationErrorSchema, errors } = this.state;
|
|
4765
4764
|
let { customErrors } = this.state;
|
|
4766
4765
|
let mergeBaseErrorSchema = schemaValidationErrorSchema;
|
|
@@ -4809,18 +4808,6 @@ var Form = class extends Component3 {
|
|
|
4809
4808
|
formData: newFormData
|
|
4810
4809
|
};
|
|
4811
4810
|
}
|
|
4812
|
-
if (removeEmptyOptionalObjects) {
|
|
4813
|
-
newFormData = removeOptionalEmptyObjects(
|
|
4814
|
-
schemaUtils.getValidator(),
|
|
4815
|
-
schema,
|
|
4816
|
-
schemaUtils.getRootSchema(),
|
|
4817
|
-
newFormData
|
|
4818
|
-
);
|
|
4819
|
-
state = {
|
|
4820
|
-
...state,
|
|
4821
|
-
formData: newFormData
|
|
4822
|
-
};
|
|
4823
|
-
}
|
|
4824
4811
|
if (newErrorSchema) {
|
|
4825
4812
|
const oldValidationError = !isRootPath ? _get(schemaValidationErrorSchema, path) : schemaValidationErrorSchema;
|
|
4826
4813
|
if (!_isEmpty(oldValidationError)) {
|
|
@@ -4922,33 +4909,24 @@ var Form = class extends Component3 {
|
|
|
4922
4909
|
* @param data - The data associated with the field that was blurred
|
|
4923
4910
|
*/
|
|
4924
4911
|
onBlur = (id, data) => {
|
|
4925
|
-
const { onBlur, omitExtraData, liveOmit, liveValidate
|
|
4912
|
+
const { onBlur, omitExtraData, liveOmit, liveValidate } = this.props;
|
|
4926
4913
|
if (onBlur) {
|
|
4927
4914
|
onBlur(id, data);
|
|
4928
4915
|
}
|
|
4929
4916
|
if (omitExtraData === true && liveOmit === "onBlur" || liveValidate === "onBlur") {
|
|
4930
4917
|
const { onChange, extraErrors } = this.props;
|
|
4931
|
-
const { formData
|
|
4918
|
+
const { formData } = this.state;
|
|
4932
4919
|
let newFormData = formData;
|
|
4933
4920
|
let state = { formData: newFormData };
|
|
4934
4921
|
if (omitExtraData === true && liveOmit === "onBlur") {
|
|
4935
4922
|
newFormData = this.omitExtraData(formData);
|
|
4936
4923
|
state = { formData: newFormData };
|
|
4937
4924
|
}
|
|
4938
|
-
if (removeEmptyOptionalObjects) {
|
|
4939
|
-
newFormData = removeOptionalEmptyObjects(
|
|
4940
|
-
schemaUtils.getValidator(),
|
|
4941
|
-
schema,
|
|
4942
|
-
schemaUtils.getRootSchema(),
|
|
4943
|
-
newFormData
|
|
4944
|
-
);
|
|
4945
|
-
state = { ...state, formData: newFormData };
|
|
4946
|
-
}
|
|
4947
4925
|
if (liveValidate === "onBlur") {
|
|
4948
|
-
const { schema
|
|
4926
|
+
const { schema, schemaUtils, errorSchema, customErrors, retrievedSchema } = this.state;
|
|
4949
4927
|
const liveValidation = this.liveValidate(
|
|
4950
|
-
|
|
4951
|
-
|
|
4928
|
+
schema,
|
|
4929
|
+
schemaUtils,
|
|
4952
4930
|
errorSchema,
|
|
4953
4931
|
newFormData,
|
|
4954
4932
|
extraErrors,
|
|
@@ -4995,20 +4973,11 @@ var Form = class extends Component3 {
|
|
|
4995
4973
|
return;
|
|
4996
4974
|
}
|
|
4997
4975
|
event.persist();
|
|
4998
|
-
const { omitExtraData, extraErrors, noValidate, onSubmit
|
|
4976
|
+
const { omitExtraData, extraErrors, noValidate, onSubmit } = this.props;
|
|
4999
4977
|
let { formData: newFormData } = this.state;
|
|
5000
4978
|
if (omitExtraData === true) {
|
|
5001
4979
|
newFormData = this.omitExtraData(newFormData);
|
|
5002
4980
|
}
|
|
5003
|
-
if (removeEmptyOptionalObjects) {
|
|
5004
|
-
const { schemaUtils, schema } = this.state;
|
|
5005
|
-
newFormData = removeOptionalEmptyObjects(
|
|
5006
|
-
schemaUtils.getValidator(),
|
|
5007
|
-
schema,
|
|
5008
|
-
schemaUtils.getRootSchema(),
|
|
5009
|
-
newFormData
|
|
5010
|
-
);
|
|
5011
|
-
}
|
|
5012
4981
|
if (noValidate || this.validateFormWithFormData(newFormData)) {
|
|
5013
4982
|
const errorSchema = extraErrors || {};
|
|
5014
4983
|
const errors = extraErrors ? toErrorList(extraErrors) : [];
|
|
@@ -5173,20 +5142,11 @@ var Form = class extends Component3 {
|
|
|
5173
5142
|
* @returns - True if the form is valid, false otherwise.
|
|
5174
5143
|
*/
|
|
5175
5144
|
validateForm() {
|
|
5176
|
-
const { omitExtraData
|
|
5145
|
+
const { omitExtraData } = this.props;
|
|
5177
5146
|
let { formData: newFormData } = this.state;
|
|
5178
5147
|
if (omitExtraData === true) {
|
|
5179
5148
|
newFormData = this.omitExtraData(newFormData);
|
|
5180
5149
|
}
|
|
5181
|
-
if (removeEmptyOptionalObjects) {
|
|
5182
|
-
const { schemaUtils, schema } = this.state;
|
|
5183
|
-
newFormData = removeOptionalEmptyObjects(
|
|
5184
|
-
schemaUtils.getValidator(),
|
|
5185
|
-
schema,
|
|
5186
|
-
schemaUtils.getRootSchema(),
|
|
5187
|
-
newFormData
|
|
5188
|
-
);
|
|
5189
|
-
}
|
|
5190
5150
|
return this.validateFormWithFormData(newFormData);
|
|
5191
5151
|
}
|
|
5192
5152
|
/** Renders the `Form` fields inside the <form> | `tagName` or `_internalFormWrapper`, rendering any errors if
|
|
@@ -5264,6 +5224,33 @@ var Form = class extends Component3 {
|
|
|
5264
5224
|
}
|
|
5265
5225
|
};
|
|
5266
5226
|
|
|
5227
|
+
// src/getTestRegistry.tsx
|
|
5228
|
+
import {
|
|
5229
|
+
DEFAULT_ID_PREFIX as DEFAULT_ID_PREFIX3,
|
|
5230
|
+
DEFAULT_ID_SEPARATOR as DEFAULT_ID_SEPARATOR3,
|
|
5231
|
+
createSchemaUtils as createSchemaUtils2,
|
|
5232
|
+
englishStringTranslator as englishStringTranslator2
|
|
5233
|
+
} from "@rjsf/utils";
|
|
5234
|
+
import validator from "@rjsf/validator-ajv8";
|
|
5235
|
+
function getTestRegistry(rootSchema, fields2 = {}, templates2 = {}, widgets2 = {}, formContext = {}, globalFormOptions = {
|
|
5236
|
+
idPrefix: DEFAULT_ID_PREFIX3,
|
|
5237
|
+
idSeparator: DEFAULT_ID_SEPARATOR3,
|
|
5238
|
+
useFallbackUiForUnsupportedType: false
|
|
5239
|
+
}) {
|
|
5240
|
+
const defaults = getDefaultRegistry();
|
|
5241
|
+
const schemaUtils = createSchemaUtils2(validator, rootSchema);
|
|
5242
|
+
return {
|
|
5243
|
+
fields: { ...defaults.fields, ...fields2 },
|
|
5244
|
+
templates: { ...defaults.templates, ...templates2 },
|
|
5245
|
+
widgets: { ...defaults.widgets, ...widgets2 },
|
|
5246
|
+
formContext,
|
|
5247
|
+
rootSchema,
|
|
5248
|
+
schemaUtils,
|
|
5249
|
+
translateString: englishStringTranslator2,
|
|
5250
|
+
globalFormOptions
|
|
5251
|
+
};
|
|
5252
|
+
}
|
|
5253
|
+
|
|
5267
5254
|
// src/withTheme.tsx
|
|
5268
5255
|
import { forwardRef } from "react";
|
|
5269
5256
|
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
@@ -5295,33 +5282,6 @@ function withTheme(themeProps) {
|
|
|
5295
5282
|
);
|
|
5296
5283
|
}
|
|
5297
5284
|
|
|
5298
|
-
// src/getTestRegistry.tsx
|
|
5299
|
-
import {
|
|
5300
|
-
DEFAULT_ID_PREFIX as DEFAULT_ID_PREFIX3,
|
|
5301
|
-
DEFAULT_ID_SEPARATOR as DEFAULT_ID_SEPARATOR3,
|
|
5302
|
-
createSchemaUtils as createSchemaUtils2,
|
|
5303
|
-
englishStringTranslator as englishStringTranslator2
|
|
5304
|
-
} from "@rjsf/utils";
|
|
5305
|
-
import validator from "@rjsf/validator-ajv8";
|
|
5306
|
-
function getTestRegistry(rootSchema, fields2 = {}, templates2 = {}, widgets2 = {}, formContext = {}, globalFormOptions = {
|
|
5307
|
-
idPrefix: DEFAULT_ID_PREFIX3,
|
|
5308
|
-
idSeparator: DEFAULT_ID_SEPARATOR3,
|
|
5309
|
-
useFallbackUiForUnsupportedType: false
|
|
5310
|
-
}) {
|
|
5311
|
-
const defaults = getDefaultRegistry();
|
|
5312
|
-
const schemaUtils = createSchemaUtils2(validator, rootSchema);
|
|
5313
|
-
return {
|
|
5314
|
-
fields: { ...defaults.fields, ...fields2 },
|
|
5315
|
-
templates: { ...defaults.templates, ...templates2 },
|
|
5316
|
-
widgets: { ...defaults.widgets, ...widgets2 },
|
|
5317
|
-
formContext,
|
|
5318
|
-
rootSchema,
|
|
5319
|
-
schemaUtils,
|
|
5320
|
-
translateString: englishStringTranslator2,
|
|
5321
|
-
globalFormOptions
|
|
5322
|
-
};
|
|
5323
|
-
}
|
|
5324
|
-
|
|
5325
5285
|
// src/index.ts
|
|
5326
5286
|
var index_default = Form;
|
|
5327
5287
|
export {
|