@rjsf/core 6.2.4 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.umd.js +20 -6
- package/dist/index.cjs +317 -297
- package/dist/index.cjs.map +4 -4
- package/dist/index.esm.js +162 -139
- package/dist/index.esm.js.map +4 -4
- package/lib/components/Form.d.ts.map +1 -1
- package/lib/components/Form.js +7 -2
- package/lib/components/SchemaExamples.d.ts +16 -0
- package/lib/components/SchemaExamples.d.ts.map +1 -0
- package/lib/components/SchemaExamples.js +23 -0
- package/lib/components/fields/ArrayField.d.ts.map +1 -1
- package/lib/components/fields/LayoutGridField.d.ts.map +1 -1
- package/lib/components/fields/ObjectField.d.ts.map +1 -1
- package/lib/components/fields/SchemaField.d.ts.map +1 -1
- package/lib/components/fields/SchemaField.js +3 -2
- package/lib/components/templates/BaseInputTemplate.d.ts.map +1 -1
- package/lib/components/templates/BaseInputTemplate.js +2 -5
- package/lib/index.d.ts +3 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/components/Form.tsx +18 -6
- package/src/components/SchemaExamples.tsx +36 -0
- package/src/components/fields/ArrayField.tsx +10 -4
- package/src/components/fields/LayoutGridField.tsx +5 -2
- package/src/components/fields/ObjectField.tsx +5 -2
- package/src/components/fields/SchemaField.tsx +3 -1
- package/src/components/templates/BaseInputTemplate.tsx +3 -9
- package/src/index.ts +11 -2
package/dist/index.esm.js
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
createSchemaUtils,
|
|
5
5
|
deepEquals as deepEquals2,
|
|
6
6
|
ErrorSchemaBuilder,
|
|
7
|
+
expandUiSchemaDefinitions,
|
|
7
8
|
getChangedFields,
|
|
8
9
|
getTemplate as getTemplate28,
|
|
9
10
|
getUiOptions as getUiOptions21,
|
|
@@ -13,6 +14,7 @@ import {
|
|
|
13
14
|
SUBMIT_BTN_OPTIONS_KEY,
|
|
14
15
|
toErrorList,
|
|
15
16
|
toFieldPathId as toFieldPathId6,
|
|
17
|
+
UI_DEFINITIONS_KEY,
|
|
16
18
|
UI_GLOBAL_OPTIONS_KEY as UI_GLOBAL_OPTIONS_KEY2,
|
|
17
19
|
UI_OPTIONS_KEY as UI_OPTIONS_KEY3,
|
|
18
20
|
validationDataMerge,
|
|
@@ -2288,6 +2290,7 @@ import {
|
|
|
2288
2290
|
ID_KEY as ID_KEY4,
|
|
2289
2291
|
isFormDataAvailable as isFormDataAvailable5,
|
|
2290
2292
|
ONE_OF_KEY as ONE_OF_KEY5,
|
|
2293
|
+
resolveUiSchema,
|
|
2291
2294
|
shouldRender,
|
|
2292
2295
|
shouldRenderOptionalField as shouldRenderOptionalField4,
|
|
2293
2296
|
toFieldPathId as toFieldPathId5,
|
|
@@ -2330,7 +2333,7 @@ function SchemaFieldRender(props) {
|
|
|
2330
2333
|
const {
|
|
2331
2334
|
schema: _schema,
|
|
2332
2335
|
fieldPathId,
|
|
2333
|
-
uiSchema,
|
|
2336
|
+
uiSchema: _uiSchema,
|
|
2334
2337
|
formData,
|
|
2335
2338
|
errorSchema,
|
|
2336
2339
|
name,
|
|
@@ -2344,6 +2347,7 @@ function SchemaFieldRender(props) {
|
|
|
2344
2347
|
} = props;
|
|
2345
2348
|
const { schemaUtils, globalFormOptions, globalUiOptions, fields: fields2 } = registry;
|
|
2346
2349
|
const { AnyOfField: _AnyOfField, OneOfField: _OneOfField } = fields2;
|
|
2350
|
+
const uiSchema = resolveUiSchema(_schema, _uiSchema, registry);
|
|
2347
2351
|
const uiOptions = getUiOptions10(uiSchema, globalUiOptions);
|
|
2348
2352
|
const FieldTemplate2 = getTemplate9("FieldTemplate", registry, uiOptions);
|
|
2349
2353
|
const DescriptionFieldTemplate = getTemplate9(
|
|
@@ -2884,10 +2888,28 @@ function ArrayFieldTitleTemplate(props) {
|
|
|
2884
2888
|
import { useCallback as useCallback7 } from "react";
|
|
2885
2889
|
import {
|
|
2886
2890
|
ariaDescribedByIds,
|
|
2887
|
-
examplesId,
|
|
2891
|
+
examplesId as examplesId2,
|
|
2888
2892
|
getInputProps
|
|
2889
2893
|
} from "@rjsf/utils";
|
|
2890
|
-
|
|
2894
|
+
|
|
2895
|
+
// src/components/SchemaExamples.tsx
|
|
2896
|
+
import { examplesId } from "@rjsf/utils";
|
|
2897
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
2898
|
+
function SchemaExamples(props) {
|
|
2899
|
+
const { id, schema } = props;
|
|
2900
|
+
const { examples, default: schemaDefault } = schema;
|
|
2901
|
+
if (!Array.isArray(examples)) {
|
|
2902
|
+
return null;
|
|
2903
|
+
}
|
|
2904
|
+
return /* @__PURE__ */ jsx18("datalist", { id: examplesId(id), children: examples.concat(
|
|
2905
|
+
schemaDefault !== void 0 && !examples.map(String).includes(String(schemaDefault)) ? [schemaDefault] : []
|
|
2906
|
+
).map((example) => {
|
|
2907
|
+
return /* @__PURE__ */ jsx18("option", { value: example }, String(example));
|
|
2908
|
+
}) }, `datalist_${id}`);
|
|
2909
|
+
}
|
|
2910
|
+
|
|
2911
|
+
// src/components/templates/BaseInputTemplate.tsx
|
|
2912
|
+
import { Fragment as Fragment3, jsx as jsx19, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2891
2913
|
function BaseInputTemplate(props) {
|
|
2892
2914
|
const {
|
|
2893
2915
|
id,
|
|
@@ -2950,7 +2972,7 @@ function BaseInputTemplate(props) {
|
|
|
2950
2972
|
[onChange, options.emptyValue]
|
|
2951
2973
|
);
|
|
2952
2974
|
return /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
2953
|
-
/* @__PURE__ */
|
|
2975
|
+
/* @__PURE__ */ jsx19(
|
|
2954
2976
|
"input",
|
|
2955
2977
|
{
|
|
2956
2978
|
id,
|
|
@@ -2961,29 +2983,27 @@ function BaseInputTemplate(props) {
|
|
|
2961
2983
|
autoFocus: autofocus,
|
|
2962
2984
|
value: inputValue,
|
|
2963
2985
|
...inputProps,
|
|
2964
|
-
list: schema.examples ?
|
|
2986
|
+
list: schema.examples ? examplesId2(id) : void 0,
|
|
2965
2987
|
onChange: onChangeOverride || _onChange,
|
|
2966
2988
|
onBlur: _onBlur,
|
|
2967
2989
|
onFocus: _onFocus,
|
|
2968
2990
|
"aria-describedby": ariaDescribedByIds(id, !!schema.examples)
|
|
2969
2991
|
}
|
|
2970
2992
|
),
|
|
2971
|
-
options.allowClearTextInputs && !readonly && !disabled && inputValue && /* @__PURE__ */
|
|
2972
|
-
|
|
2973
|
-
return /* @__PURE__ */ jsx18("option", { value: example }, example);
|
|
2974
|
-
}) }, `datalist_${id}`)
|
|
2993
|
+
options.allowClearTextInputs && !readonly && !disabled && inputValue && /* @__PURE__ */ jsx19(ClearButton2, { registry, onClick: _onClear }),
|
|
2994
|
+
/* @__PURE__ */ jsx19(SchemaExamples, { id, schema })
|
|
2975
2995
|
] });
|
|
2976
2996
|
}
|
|
2977
2997
|
|
|
2978
2998
|
// src/components/templates/ButtonTemplates/SubmitButton.tsx
|
|
2979
2999
|
import { getSubmitButtonOptions } from "@rjsf/utils";
|
|
2980
|
-
import { jsx as
|
|
3000
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2981
3001
|
function SubmitButton({ uiSchema }) {
|
|
2982
3002
|
const { submitText, norender, props: submitButtonProps = {} } = getSubmitButtonOptions(uiSchema);
|
|
2983
3003
|
if (norender) {
|
|
2984
3004
|
return null;
|
|
2985
3005
|
}
|
|
2986
|
-
return /* @__PURE__ */
|
|
3006
|
+
return /* @__PURE__ */ jsx20("div", { children: /* @__PURE__ */ jsx20("button", { type: "submit", ...submitButtonProps, className: `btn btn-info ${submitButtonProps.className || ""}`, children: submitText }) });
|
|
2987
3007
|
}
|
|
2988
3008
|
|
|
2989
3009
|
// src/components/templates/ButtonTemplates/AddButton.tsx
|
|
@@ -2991,34 +3011,34 @@ import { TranslatableString as TranslatableString8 } from "@rjsf/utils";
|
|
|
2991
3011
|
|
|
2992
3012
|
// src/components/templates/ButtonTemplates/IconButton.tsx
|
|
2993
3013
|
import { TranslatableString as TranslatableString7 } from "@rjsf/utils";
|
|
2994
|
-
import { jsx as
|
|
3014
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
2995
3015
|
function IconButton(props) {
|
|
2996
3016
|
const { iconType = "default", icon, className, uiSchema, registry, ...otherProps } = props;
|
|
2997
|
-
return /* @__PURE__ */
|
|
3017
|
+
return /* @__PURE__ */ jsx21("button", { type: "button", className: `btn btn-${iconType} ${className}`, ...otherProps, children: /* @__PURE__ */ jsx21("i", { className: `glyphicon glyphicon-${icon}` }) });
|
|
2998
3018
|
}
|
|
2999
3019
|
function CopyButton(props) {
|
|
3000
3020
|
const {
|
|
3001
3021
|
registry: { translateString }
|
|
3002
3022
|
} = props;
|
|
3003
|
-
return /* @__PURE__ */
|
|
3023
|
+
return /* @__PURE__ */ jsx21(IconButton, { title: translateString(TranslatableString7.CopyButton), ...props, icon: "copy" });
|
|
3004
3024
|
}
|
|
3005
3025
|
function MoveDownButton(props) {
|
|
3006
3026
|
const {
|
|
3007
3027
|
registry: { translateString }
|
|
3008
3028
|
} = props;
|
|
3009
|
-
return /* @__PURE__ */
|
|
3029
|
+
return /* @__PURE__ */ jsx21(IconButton, { title: translateString(TranslatableString7.MoveDownButton), ...props, icon: "arrow-down" });
|
|
3010
3030
|
}
|
|
3011
3031
|
function MoveUpButton(props) {
|
|
3012
3032
|
const {
|
|
3013
3033
|
registry: { translateString }
|
|
3014
3034
|
} = props;
|
|
3015
|
-
return /* @__PURE__ */
|
|
3035
|
+
return /* @__PURE__ */ jsx21(IconButton, { title: translateString(TranslatableString7.MoveUpButton), ...props, icon: "arrow-up" });
|
|
3016
3036
|
}
|
|
3017
3037
|
function RemoveButton(props) {
|
|
3018
3038
|
const {
|
|
3019
3039
|
registry: { translateString }
|
|
3020
3040
|
} = props;
|
|
3021
|
-
return /* @__PURE__ */
|
|
3041
|
+
return /* @__PURE__ */ jsx21(IconButton, { title: translateString(TranslatableString7.RemoveButton), ...props, iconType: "danger", icon: "remove" });
|
|
3022
3042
|
}
|
|
3023
3043
|
function ClearButton({
|
|
3024
3044
|
id,
|
|
@@ -3029,7 +3049,7 @@ function ClearButton({
|
|
|
3029
3049
|
...props
|
|
3030
3050
|
}) {
|
|
3031
3051
|
const { translateString } = registry;
|
|
3032
|
-
return /* @__PURE__ */
|
|
3052
|
+
return /* @__PURE__ */ jsx21(
|
|
3033
3053
|
IconButton,
|
|
3034
3054
|
{
|
|
3035
3055
|
id,
|
|
@@ -3046,7 +3066,7 @@ function ClearButton({
|
|
|
3046
3066
|
}
|
|
3047
3067
|
|
|
3048
3068
|
// src/components/templates/ButtonTemplates/AddButton.tsx
|
|
3049
|
-
import { jsx as
|
|
3069
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
3050
3070
|
function AddButton({
|
|
3051
3071
|
id,
|
|
3052
3072
|
className,
|
|
@@ -3055,11 +3075,11 @@ function AddButton({
|
|
|
3055
3075
|
registry
|
|
3056
3076
|
}) {
|
|
3057
3077
|
const { translateString } = registry;
|
|
3058
|
-
return /* @__PURE__ */
|
|
3078
|
+
return /* @__PURE__ */ jsx22("div", { className: "row", children: /* @__PURE__ */ jsx22(
|
|
3059
3079
|
"p",
|
|
3060
3080
|
{
|
|
3061
3081
|
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}`,
|
|
3062
|
-
children: /* @__PURE__ */
|
|
3082
|
+
children: /* @__PURE__ */ jsx22(
|
|
3063
3083
|
IconButton,
|
|
3064
3084
|
{
|
|
3065
3085
|
id,
|
|
@@ -3096,56 +3116,56 @@ import {
|
|
|
3096
3116
|
getUiOptions as getUiOptions16
|
|
3097
3117
|
} from "@rjsf/utils";
|
|
3098
3118
|
import Markdown2 from "markdown-to-jsx";
|
|
3099
|
-
import { jsx as
|
|
3119
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
3100
3120
|
var TEST_IDS = getTestIds2();
|
|
3101
3121
|
function RichDescription({ description, registry, uiSchema = {} }) {
|
|
3102
3122
|
const { globalUiOptions } = registry;
|
|
3103
3123
|
const uiOptions = getUiOptions16(uiSchema, globalUiOptions);
|
|
3104
3124
|
if (uiOptions.enableMarkdownInDescription && typeof description === "string") {
|
|
3105
|
-
return /* @__PURE__ */
|
|
3125
|
+
return /* @__PURE__ */ jsx23(Markdown2, { options: { disableParsingRawHTML: true }, "data-testid": TEST_IDS.markdown, children: description });
|
|
3106
3126
|
}
|
|
3107
3127
|
return description;
|
|
3108
3128
|
}
|
|
3109
3129
|
RichDescription.TEST_IDS = TEST_IDS;
|
|
3110
3130
|
|
|
3111
3131
|
// src/components/templates/DescriptionField.tsx
|
|
3112
|
-
import { jsx as
|
|
3132
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
3113
3133
|
function DescriptionField(props) {
|
|
3114
3134
|
const { id, description, registry, uiSchema } = props;
|
|
3115
3135
|
if (!description) {
|
|
3116
3136
|
return null;
|
|
3117
3137
|
}
|
|
3118
|
-
return /* @__PURE__ */
|
|
3138
|
+
return /* @__PURE__ */ jsx24("div", { id, className: "field-description", children: /* @__PURE__ */ jsx24(RichDescription, { description, registry, uiSchema }) });
|
|
3119
3139
|
}
|
|
3120
3140
|
|
|
3121
3141
|
// src/components/templates/ErrorList.tsx
|
|
3122
3142
|
import {
|
|
3123
3143
|
TranslatableString as TranslatableString9
|
|
3124
3144
|
} from "@rjsf/utils";
|
|
3125
|
-
import { jsx as
|
|
3145
|
+
import { jsx as jsx25, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
3126
3146
|
function ErrorList({
|
|
3127
3147
|
errors,
|
|
3128
3148
|
registry
|
|
3129
3149
|
}) {
|
|
3130
3150
|
const { translateString } = registry;
|
|
3131
3151
|
return /* @__PURE__ */ jsxs7("div", { className: "panel panel-danger errors", children: [
|
|
3132
|
-
/* @__PURE__ */
|
|
3133
|
-
/* @__PURE__ */
|
|
3134
|
-
return /* @__PURE__ */
|
|
3152
|
+
/* @__PURE__ */ jsx25("div", { className: "panel-heading", children: /* @__PURE__ */ jsx25("h3", { className: "panel-title", children: translateString(TranslatableString9.ErrorsLabel) }) }),
|
|
3153
|
+
/* @__PURE__ */ jsx25("ul", { className: "list-group", children: errors.map((error, i) => {
|
|
3154
|
+
return /* @__PURE__ */ jsx25("li", { className: "list-group-item text-danger", children: error.stack }, i);
|
|
3135
3155
|
}) })
|
|
3136
3156
|
] });
|
|
3137
3157
|
}
|
|
3138
3158
|
|
|
3139
3159
|
// src/components/templates/FallbackFieldTemplate.tsx
|
|
3140
3160
|
import { getTemplate as getTemplate14 } from "@rjsf/utils";
|
|
3141
|
-
import { jsx as
|
|
3161
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
3142
3162
|
function FallbackFieldTemplate(props) {
|
|
3143
3163
|
const { schema, registry, typeSelector, schemaField } = props;
|
|
3144
3164
|
const MultiSchemaFieldTemplate2 = getTemplate14(
|
|
3145
3165
|
"MultiSchemaFieldTemplate",
|
|
3146
3166
|
registry
|
|
3147
3167
|
);
|
|
3148
|
-
return /* @__PURE__ */
|
|
3168
|
+
return /* @__PURE__ */ jsx26(
|
|
3149
3169
|
MultiSchemaFieldTemplate2,
|
|
3150
3170
|
{
|
|
3151
3171
|
selector: typeSelector,
|
|
@@ -3163,7 +3183,7 @@ import {
|
|
|
3163
3183
|
} from "@rjsf/utils";
|
|
3164
3184
|
|
|
3165
3185
|
// src/components/templates/FieldTemplate/Label.tsx
|
|
3166
|
-
import { jsx as
|
|
3186
|
+
import { jsx as jsx27, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3167
3187
|
var REQUIRED_FIELD_SYMBOL = "*";
|
|
3168
3188
|
function Label(props) {
|
|
3169
3189
|
const { label, required, id } = props;
|
|
@@ -3172,12 +3192,12 @@ function Label(props) {
|
|
|
3172
3192
|
}
|
|
3173
3193
|
return /* @__PURE__ */ jsxs8("label", { className: "control-label", htmlFor: id, children: [
|
|
3174
3194
|
label,
|
|
3175
|
-
required && /* @__PURE__ */
|
|
3195
|
+
required && /* @__PURE__ */ jsx27("span", { className: "required", children: REQUIRED_FIELD_SYMBOL })
|
|
3176
3196
|
] });
|
|
3177
3197
|
}
|
|
3178
3198
|
|
|
3179
3199
|
// src/components/templates/FieldTemplate/FieldTemplate.tsx
|
|
3180
|
-
import { jsx as
|
|
3200
|
+
import { jsx as jsx28, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3181
3201
|
function FieldTemplate(props) {
|
|
3182
3202
|
const { id, label, children, errors, help, description, hidden, required, displayLabel, registry, uiSchema } = props;
|
|
3183
3203
|
const uiOptions = getUiOptions17(uiSchema);
|
|
@@ -3187,11 +3207,11 @@ function FieldTemplate(props) {
|
|
|
3187
3207
|
uiOptions
|
|
3188
3208
|
);
|
|
3189
3209
|
if (hidden) {
|
|
3190
|
-
return /* @__PURE__ */
|
|
3210
|
+
return /* @__PURE__ */ jsx28("div", { className: "hidden", children });
|
|
3191
3211
|
}
|
|
3192
3212
|
const isCheckbox = uiOptions.widget === "checkbox";
|
|
3193
3213
|
return /* @__PURE__ */ jsxs9(WrapIfAdditionalTemplate2, { ...props, children: [
|
|
3194
|
-
displayLabel && !isCheckbox && /* @__PURE__ */
|
|
3214
|
+
displayLabel && !isCheckbox && /* @__PURE__ */ jsx28(Label, { label, required, id }),
|
|
3195
3215
|
displayLabel && description ? description : null,
|
|
3196
3216
|
children,
|
|
3197
3217
|
errors,
|
|
@@ -3204,15 +3224,15 @@ var FieldTemplate_default = FieldTemplate;
|
|
|
3204
3224
|
|
|
3205
3225
|
// src/components/templates/FieldErrorTemplate.tsx
|
|
3206
3226
|
import { errorId } from "@rjsf/utils";
|
|
3207
|
-
import { jsx as
|
|
3227
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
3208
3228
|
function FieldErrorTemplate(props) {
|
|
3209
3229
|
const { errors = [], fieldPathId } = props;
|
|
3210
3230
|
if (errors.length === 0) {
|
|
3211
3231
|
return null;
|
|
3212
3232
|
}
|
|
3213
3233
|
const id = errorId(fieldPathId);
|
|
3214
|
-
return /* @__PURE__ */
|
|
3215
|
-
return /* @__PURE__ */
|
|
3234
|
+
return /* @__PURE__ */ jsx29("div", { children: /* @__PURE__ */ jsx29("ul", { id, className: "error-detail bs-callout bs-callout-info", children: errors.filter((elem) => !!elem).map((error, index) => {
|
|
3235
|
+
return /* @__PURE__ */ jsx29("li", { className: "text-danger", children: error }, index);
|
|
3216
3236
|
}) }) });
|
|
3217
3237
|
}
|
|
3218
3238
|
|
|
@@ -3225,7 +3245,7 @@ import {
|
|
|
3225
3245
|
getUiOptions as getUiOptions18
|
|
3226
3246
|
} from "@rjsf/utils";
|
|
3227
3247
|
import Markdown3 from "markdown-to-jsx";
|
|
3228
|
-
import { jsx as
|
|
3248
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
3229
3249
|
var TEST_IDS2 = getTestIds3();
|
|
3230
3250
|
function RichHelp({
|
|
3231
3251
|
help,
|
|
@@ -3235,35 +3255,35 @@ function RichHelp({
|
|
|
3235
3255
|
const { globalUiOptions } = registry;
|
|
3236
3256
|
const uiOptions = getUiOptions18(uiSchema, globalUiOptions);
|
|
3237
3257
|
if (uiOptions.enableMarkdownInHelp && typeof help === "string") {
|
|
3238
|
-
return /* @__PURE__ */
|
|
3258
|
+
return /* @__PURE__ */ jsx30(Markdown3, { options: { disableParsingRawHTML: true }, "data-testid": TEST_IDS2.markdown, children: help });
|
|
3239
3259
|
}
|
|
3240
3260
|
return help;
|
|
3241
3261
|
}
|
|
3242
3262
|
RichHelp.TEST_IDS = TEST_IDS2;
|
|
3243
3263
|
|
|
3244
3264
|
// src/components/templates/FieldHelpTemplate.tsx
|
|
3245
|
-
import { jsx as
|
|
3265
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
3246
3266
|
function FieldHelpTemplate(props) {
|
|
3247
3267
|
const { fieldPathId, help, uiSchema, registry } = props;
|
|
3248
3268
|
if (!help) {
|
|
3249
3269
|
return null;
|
|
3250
3270
|
}
|
|
3251
|
-
return /* @__PURE__ */
|
|
3271
|
+
return /* @__PURE__ */ jsx31("div", { id: helpId(fieldPathId), className: "help-block", children: /* @__PURE__ */ jsx31(RichHelp, { help, registry, uiSchema }) });
|
|
3252
3272
|
}
|
|
3253
3273
|
|
|
3254
3274
|
// src/components/templates/GridTemplate.tsx
|
|
3255
|
-
import { jsx as
|
|
3275
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
3256
3276
|
function GridTemplate(props) {
|
|
3257
3277
|
const { children, column, className, ...rest } = props;
|
|
3258
|
-
return /* @__PURE__ */
|
|
3278
|
+
return /* @__PURE__ */ jsx32("div", { className, ...rest, children });
|
|
3259
3279
|
}
|
|
3260
3280
|
|
|
3261
3281
|
// src/components/templates/MultiSchemaFieldTemplate.tsx
|
|
3262
|
-
import { jsx as
|
|
3282
|
+
import { jsx as jsx33, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3263
3283
|
function MultiSchemaFieldTemplate(props) {
|
|
3264
3284
|
const { selector, optionSchemaField } = props;
|
|
3265
3285
|
return /* @__PURE__ */ jsxs10("div", { className: "panel panel-default panel-body", children: [
|
|
3266
|
-
/* @__PURE__ */
|
|
3286
|
+
/* @__PURE__ */ jsx33("div", { className: "form-group", children: selector }),
|
|
3267
3287
|
optionSchemaField
|
|
3268
3288
|
] });
|
|
3269
3289
|
}
|
|
@@ -3277,7 +3297,7 @@ import {
|
|
|
3277
3297
|
titleId as titleId3,
|
|
3278
3298
|
buttonId as buttonId3
|
|
3279
3299
|
} from "@rjsf/utils";
|
|
3280
|
-
import { jsx as
|
|
3300
|
+
import { jsx as jsx34, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3281
3301
|
function ObjectFieldTemplate(props) {
|
|
3282
3302
|
const {
|
|
3283
3303
|
className,
|
|
@@ -3311,7 +3331,7 @@ function ObjectFieldTemplate(props) {
|
|
|
3311
3331
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
3312
3332
|
} = registry.templates;
|
|
3313
3333
|
return /* @__PURE__ */ jsxs11("fieldset", { className, id: fieldPathId.$id, children: [
|
|
3314
|
-
title && /* @__PURE__ */
|
|
3334
|
+
title && /* @__PURE__ */ jsx34(
|
|
3315
3335
|
TitleFieldTemplate,
|
|
3316
3336
|
{
|
|
3317
3337
|
id: titleId3(fieldPathId),
|
|
@@ -3323,7 +3343,7 @@ function ObjectFieldTemplate(props) {
|
|
|
3323
3343
|
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
3324
3344
|
}
|
|
3325
3345
|
),
|
|
3326
|
-
description && /* @__PURE__ */
|
|
3346
|
+
description && /* @__PURE__ */ jsx34(
|
|
3327
3347
|
DescriptionFieldTemplate,
|
|
3328
3348
|
{
|
|
3329
3349
|
id: descriptionId3(fieldPathId),
|
|
@@ -3335,7 +3355,7 @@ function ObjectFieldTemplate(props) {
|
|
|
3335
3355
|
),
|
|
3336
3356
|
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
3337
3357
|
properties.map((prop) => prop.content),
|
|
3338
|
-
canExpand(schema, uiSchema, formData) && /* @__PURE__ */
|
|
3358
|
+
canExpand(schema, uiSchema, formData) && /* @__PURE__ */ jsx34(
|
|
3339
3359
|
AddButton2,
|
|
3340
3360
|
{
|
|
3341
3361
|
id: buttonId3(fieldPathId, "add"),
|
|
@@ -3350,11 +3370,11 @@ function ObjectFieldTemplate(props) {
|
|
|
3350
3370
|
}
|
|
3351
3371
|
|
|
3352
3372
|
// src/components/templates/OptionalDataControlsTemplate.tsx
|
|
3353
|
-
import { jsx as
|
|
3373
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
3354
3374
|
function OptionalDataControlsTemplate(props) {
|
|
3355
3375
|
const { id, registry, label, onAddClick, onRemoveClick } = props;
|
|
3356
3376
|
if (onAddClick) {
|
|
3357
|
-
return /* @__PURE__ */
|
|
3377
|
+
return /* @__PURE__ */ jsx35(
|
|
3358
3378
|
IconButton,
|
|
3359
3379
|
{
|
|
3360
3380
|
id,
|
|
@@ -3366,7 +3386,7 @@ function OptionalDataControlsTemplate(props) {
|
|
|
3366
3386
|
}
|
|
3367
3387
|
);
|
|
3368
3388
|
} else if (onRemoveClick) {
|
|
3369
|
-
return /* @__PURE__ */
|
|
3389
|
+
return /* @__PURE__ */ jsx35(
|
|
3370
3390
|
IconButton,
|
|
3371
3391
|
{
|
|
3372
3392
|
id,
|
|
@@ -3378,25 +3398,25 @@ function OptionalDataControlsTemplate(props) {
|
|
|
3378
3398
|
}
|
|
3379
3399
|
);
|
|
3380
3400
|
}
|
|
3381
|
-
return /* @__PURE__ */
|
|
3401
|
+
return /* @__PURE__ */ jsx35("em", { id, children: label });
|
|
3382
3402
|
}
|
|
3383
3403
|
|
|
3384
3404
|
// src/components/templates/TitleField.tsx
|
|
3385
|
-
import { jsx as
|
|
3405
|
+
import { jsx as jsx36, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3386
3406
|
var REQUIRED_FIELD_SYMBOL2 = "*";
|
|
3387
3407
|
function TitleField(props) {
|
|
3388
3408
|
const { id, title, required, optionalDataControl } = props;
|
|
3389
3409
|
return /* @__PURE__ */ jsxs12("legend", { id, children: [
|
|
3390
3410
|
title,
|
|
3391
|
-
required && /* @__PURE__ */
|
|
3392
|
-
optionalDataControl && /* @__PURE__ */
|
|
3411
|
+
required && /* @__PURE__ */ jsx36("span", { className: "required", children: REQUIRED_FIELD_SYMBOL2 }),
|
|
3412
|
+
optionalDataControl && /* @__PURE__ */ jsx36("span", { className: "pull-right", style: { marginBottom: "2px" }, children: optionalDataControl })
|
|
3393
3413
|
] });
|
|
3394
3414
|
}
|
|
3395
3415
|
|
|
3396
3416
|
// src/components/templates/UnsupportedField.tsx
|
|
3397
3417
|
import { TranslatableString as TranslatableString10 } from "@rjsf/utils";
|
|
3398
3418
|
import Markdown4 from "markdown-to-jsx";
|
|
3399
|
-
import { jsx as
|
|
3419
|
+
import { jsx as jsx37, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3400
3420
|
function UnsupportedField(props) {
|
|
3401
3421
|
const { schema, fieldPathId, reason, registry } = props;
|
|
3402
3422
|
const { translateString } = registry;
|
|
@@ -3411,8 +3431,8 @@ function UnsupportedField(props) {
|
|
|
3411
3431
|
translateParams.push(reason);
|
|
3412
3432
|
}
|
|
3413
3433
|
return /* @__PURE__ */ jsxs13("div", { className: "unsupported-field", children: [
|
|
3414
|
-
/* @__PURE__ */
|
|
3415
|
-
schema && /* @__PURE__ */
|
|
3434
|
+
/* @__PURE__ */ jsx37("p", { children: /* @__PURE__ */ jsx37(Markdown4, { options: { disableParsingRawHTML: true }, children: translateString(translateEnum, translateParams) }) }),
|
|
3435
|
+
schema && /* @__PURE__ */ jsx37("pre", { children: JSON.stringify(schema, null, 2) })
|
|
3416
3436
|
] });
|
|
3417
3437
|
}
|
|
3418
3438
|
var UnsupportedField_default = UnsupportedField;
|
|
@@ -3423,7 +3443,7 @@ import {
|
|
|
3423
3443
|
buttonId as buttonId4,
|
|
3424
3444
|
TranslatableString as TranslatableString11
|
|
3425
3445
|
} from "@rjsf/utils";
|
|
3426
|
-
import { jsx as
|
|
3446
|
+
import { jsx as jsx38, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3427
3447
|
function WrapIfAdditionalTemplate(props) {
|
|
3428
3448
|
const {
|
|
3429
3449
|
id,
|
|
@@ -3455,14 +3475,14 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
3455
3475
|
}
|
|
3456
3476
|
const uiClassNames = classNamesList.join(" ").trim();
|
|
3457
3477
|
if (!additional) {
|
|
3458
|
-
return /* @__PURE__ */
|
|
3478
|
+
return /* @__PURE__ */ jsx38("div", { className: uiClassNames, style, children });
|
|
3459
3479
|
}
|
|
3460
3480
|
const margin = hasDescription ? 46 : 26;
|
|
3461
|
-
return /* @__PURE__ */
|
|
3462
|
-
/* @__PURE__ */
|
|
3463
|
-
displayLabel && /* @__PURE__ */
|
|
3464
|
-
displayLabel && rawDescription && /* @__PURE__ */
|
|
3465
|
-
/* @__PURE__ */
|
|
3481
|
+
return /* @__PURE__ */ jsx38("div", { className: uiClassNames, style, children: /* @__PURE__ */ jsxs14("div", { className: "row", children: [
|
|
3482
|
+
/* @__PURE__ */ jsx38("div", { className: "col-xs-5 form-additional", children: /* @__PURE__ */ jsxs14("div", { className: "form-group", children: [
|
|
3483
|
+
displayLabel && /* @__PURE__ */ jsx38(Label, { label: keyLabel, required, id: `${id}-key` }),
|
|
3484
|
+
displayLabel && rawDescription && /* @__PURE__ */ jsx38("div", { children: "\xA0" }),
|
|
3485
|
+
/* @__PURE__ */ jsx38(
|
|
3466
3486
|
"input",
|
|
3467
3487
|
{
|
|
3468
3488
|
className: "form-control",
|
|
@@ -3473,8 +3493,8 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
3473
3493
|
}
|
|
3474
3494
|
)
|
|
3475
3495
|
] }) }),
|
|
3476
|
-
/* @__PURE__ */
|
|
3477
|
-
/* @__PURE__ */
|
|
3496
|
+
/* @__PURE__ */ jsx38("div", { className: "form-additional form-group col-xs-5", children }),
|
|
3497
|
+
/* @__PURE__ */ jsx38("div", { className: "col-xs-2", style: { marginTop: displayLabel ? `${margin}px` : void 0 }, children: /* @__PURE__ */ jsx38(
|
|
3478
3498
|
RemoveButton2,
|
|
3479
3499
|
{
|
|
3480
3500
|
id: buttonId4(id, "remove"),
|
|
@@ -3522,13 +3542,13 @@ import {
|
|
|
3522
3542
|
TranslatableString as TranslatableString12,
|
|
3523
3543
|
useAltDateWidgetProps
|
|
3524
3544
|
} from "@rjsf/utils";
|
|
3525
|
-
import { jsx as
|
|
3545
|
+
import { jsx as jsx39, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3526
3546
|
function AltDateWidget(props) {
|
|
3527
3547
|
const { disabled = false, readonly = false, autofocus = false, options, id, name, registry, onBlur, onFocus } = props;
|
|
3528
3548
|
const { translateString } = registry;
|
|
3529
3549
|
const { elements, handleChange, handleClear, handleSetNow } = useAltDateWidgetProps(props);
|
|
3530
3550
|
return /* @__PURE__ */ jsxs15("ul", { className: "list-inline", children: [
|
|
3531
|
-
elements.map((elemProps, i) => /* @__PURE__ */
|
|
3551
|
+
elements.map((elemProps, i) => /* @__PURE__ */ jsx39("li", { className: "list-inline-item", children: /* @__PURE__ */ jsx39(
|
|
3532
3552
|
DateElement,
|
|
3533
3553
|
{
|
|
3534
3554
|
rootId: id,
|
|
@@ -3543,20 +3563,20 @@ function AltDateWidget(props) {
|
|
|
3543
3563
|
autofocus: autofocus && i === 0
|
|
3544
3564
|
}
|
|
3545
3565
|
) }, i)),
|
|
3546
|
-
(options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /* @__PURE__ */
|
|
3547
|
-
(options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /* @__PURE__ */
|
|
3566
|
+
(options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /* @__PURE__ */ jsx39("li", { className: "list-inline-item", children: /* @__PURE__ */ jsx39("a", { href: "#", className: "btn btn-info btn-now", onClick: handleSetNow, children: translateString(TranslatableString12.NowLabel) }) }),
|
|
3567
|
+
(options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /* @__PURE__ */ jsx39("li", { className: "list-inline-item", children: /* @__PURE__ */ jsx39("a", { href: "#", className: "btn btn-warning btn-clear", onClick: handleClear, children: translateString(TranslatableString12.ClearLabel) }) })
|
|
3548
3568
|
] });
|
|
3549
3569
|
}
|
|
3550
3570
|
var AltDateWidget_default = AltDateWidget;
|
|
3551
3571
|
|
|
3552
3572
|
// src/components/widgets/AltDateTimeWidget.tsx
|
|
3553
|
-
import { jsx as
|
|
3573
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
3554
3574
|
function AltDateTimeWidget({
|
|
3555
3575
|
time = true,
|
|
3556
3576
|
...props
|
|
3557
3577
|
}) {
|
|
3558
3578
|
const { AltDateWidget: AltDateWidget2 } = props.registry.widgets;
|
|
3559
|
-
return /* @__PURE__ */
|
|
3579
|
+
return /* @__PURE__ */ jsx40(AltDateWidget2, { time, ...props });
|
|
3560
3580
|
}
|
|
3561
3581
|
var AltDateTimeWidget_default = AltDateTimeWidget;
|
|
3562
3582
|
|
|
@@ -3570,7 +3590,7 @@ import {
|
|
|
3570
3590
|
schemaRequiresTrueValue,
|
|
3571
3591
|
getUiOptions as getUiOptions20
|
|
3572
3592
|
} from "@rjsf/utils";
|
|
3573
|
-
import { jsx as
|
|
3593
|
+
import { jsx as jsx41, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3574
3594
|
function CheckboxWidget({
|
|
3575
3595
|
schema,
|
|
3576
3596
|
uiSchema,
|
|
@@ -3610,7 +3630,7 @@ function CheckboxWidget({
|
|
|
3610
3630
|
const isCheckboxWidget = uiOptions.widget === "checkbox";
|
|
3611
3631
|
const description = isCheckboxWidget ? void 0 : options.description ?? schema.description;
|
|
3612
3632
|
return /* @__PURE__ */ jsxs16("div", { className: `checkbox ${disabled || readonly ? "disabled" : ""}`, children: [
|
|
3613
|
-
!hideLabel && description && /* @__PURE__ */
|
|
3633
|
+
!hideLabel && description && /* @__PURE__ */ jsx41(
|
|
3614
3634
|
DescriptionFieldTemplate,
|
|
3615
3635
|
{
|
|
3616
3636
|
id: descriptionId4(id),
|
|
@@ -3621,7 +3641,7 @@ function CheckboxWidget({
|
|
|
3621
3641
|
}
|
|
3622
3642
|
),
|
|
3623
3643
|
/* @__PURE__ */ jsxs16("label", { children: [
|
|
3624
|
-
/* @__PURE__ */
|
|
3644
|
+
/* @__PURE__ */ jsx41(
|
|
3625
3645
|
"input",
|
|
3626
3646
|
{
|
|
3627
3647
|
type: "checkbox",
|
|
@@ -3637,7 +3657,7 @@ function CheckboxWidget({
|
|
|
3637
3657
|
"aria-describedby": ariaDescribedByIds2(id)
|
|
3638
3658
|
}
|
|
3639
3659
|
),
|
|
3640
|
-
labelValue(/* @__PURE__ */
|
|
3660
|
+
labelValue(/* @__PURE__ */ jsx41("span", { children: label }), hideLabel)
|
|
3641
3661
|
] })
|
|
3642
3662
|
] });
|
|
3643
3663
|
}
|
|
@@ -3653,7 +3673,7 @@ import {
|
|
|
3653
3673
|
enumOptionsValueForIndex,
|
|
3654
3674
|
optionId
|
|
3655
3675
|
} from "@rjsf/utils";
|
|
3656
|
-
import { jsx as
|
|
3676
|
+
import { jsx as jsx42, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3657
3677
|
function CheckboxesWidget({
|
|
3658
3678
|
id,
|
|
3659
3679
|
disabled,
|
|
@@ -3675,7 +3695,7 @@ function CheckboxesWidget({
|
|
|
3675
3695
|
({ target }) => onFocus(id, enumOptionsValueForIndex(target && target.value, enumOptions, emptyValue)),
|
|
3676
3696
|
[onFocus, id, enumOptions, emptyValue]
|
|
3677
3697
|
);
|
|
3678
|
-
return /* @__PURE__ */
|
|
3698
|
+
return /* @__PURE__ */ jsx42("div", { className: "checkboxes", id, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
3679
3699
|
const checked = enumOptionsIsSelected(option.value, checkboxesValues);
|
|
3680
3700
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
3681
3701
|
const disabledCls = disabled || itemDisabled || readonly ? "disabled" : "";
|
|
@@ -3687,7 +3707,7 @@ function CheckboxesWidget({
|
|
|
3687
3707
|
}
|
|
3688
3708
|
};
|
|
3689
3709
|
const checkbox = /* @__PURE__ */ jsxs17("span", { children: [
|
|
3690
|
-
/* @__PURE__ */
|
|
3710
|
+
/* @__PURE__ */ jsx42(
|
|
3691
3711
|
"input",
|
|
3692
3712
|
{
|
|
3693
3713
|
type: "checkbox",
|
|
@@ -3703,31 +3723,31 @@ function CheckboxesWidget({
|
|
|
3703
3723
|
"aria-describedby": ariaDescribedByIds3(id)
|
|
3704
3724
|
}
|
|
3705
3725
|
),
|
|
3706
|
-
/* @__PURE__ */
|
|
3726
|
+
/* @__PURE__ */ jsx42("span", { children: option.label })
|
|
3707
3727
|
] });
|
|
3708
|
-
return inline ? /* @__PURE__ */
|
|
3728
|
+
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);
|
|
3709
3729
|
}) });
|
|
3710
3730
|
}
|
|
3711
3731
|
var CheckboxesWidget_default = CheckboxesWidget;
|
|
3712
3732
|
|
|
3713
3733
|
// src/components/widgets/ColorWidget.tsx
|
|
3714
3734
|
import { getTemplate as getTemplate18 } from "@rjsf/utils";
|
|
3715
|
-
import { jsx as
|
|
3735
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
3716
3736
|
function ColorWidget(props) {
|
|
3717
3737
|
const { disabled, readonly, options, registry } = props;
|
|
3718
3738
|
const BaseInputTemplate2 = getTemplate18("BaseInputTemplate", registry, options);
|
|
3719
|
-
return /* @__PURE__ */
|
|
3739
|
+
return /* @__PURE__ */ jsx43(BaseInputTemplate2, { type: "color", ...props, disabled: disabled || readonly });
|
|
3720
3740
|
}
|
|
3721
3741
|
|
|
3722
3742
|
// src/components/widgets/DateWidget.tsx
|
|
3723
3743
|
import { useCallback as useCallback10 } from "react";
|
|
3724
3744
|
import { getTemplate as getTemplate19 } from "@rjsf/utils";
|
|
3725
|
-
import { jsx as
|
|
3745
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
3726
3746
|
function DateWidget(props) {
|
|
3727
3747
|
const { onChange, options, registry } = props;
|
|
3728
3748
|
const BaseInputTemplate2 = getTemplate19("BaseInputTemplate", registry, options);
|
|
3729
3749
|
const handleChange = useCallback10((value) => onChange(value || void 0), [onChange]);
|
|
3730
|
-
return /* @__PURE__ */
|
|
3750
|
+
return /* @__PURE__ */ jsx44(BaseInputTemplate2, { type: "date", ...props, onChange: handleChange });
|
|
3731
3751
|
}
|
|
3732
3752
|
|
|
3733
3753
|
// src/components/widgets/DateTimeWidget.tsx
|
|
@@ -3736,11 +3756,11 @@ import {
|
|
|
3736
3756
|
localToUTC,
|
|
3737
3757
|
utcToLocal
|
|
3738
3758
|
} from "@rjsf/utils";
|
|
3739
|
-
import { jsx as
|
|
3759
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
3740
3760
|
function DateTimeWidget(props) {
|
|
3741
3761
|
const { onChange, value, options, registry } = props;
|
|
3742
3762
|
const BaseInputTemplate2 = getTemplate20("BaseInputTemplate", registry, options);
|
|
3743
|
-
return /* @__PURE__ */
|
|
3763
|
+
return /* @__PURE__ */ jsx45(
|
|
3744
3764
|
BaseInputTemplate2,
|
|
3745
3765
|
{
|
|
3746
3766
|
type: "datetime-local",
|
|
@@ -3753,11 +3773,11 @@ function DateTimeWidget(props) {
|
|
|
3753
3773
|
|
|
3754
3774
|
// src/components/widgets/EmailWidget.tsx
|
|
3755
3775
|
import { getTemplate as getTemplate21 } from "@rjsf/utils";
|
|
3756
|
-
import { jsx as
|
|
3776
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
3757
3777
|
function EmailWidget(props) {
|
|
3758
3778
|
const { options, registry } = props;
|
|
3759
3779
|
const BaseInputTemplate2 = getTemplate21("BaseInputTemplate", registry, options);
|
|
3760
|
-
return /* @__PURE__ */
|
|
3780
|
+
return /* @__PURE__ */ jsx46(BaseInputTemplate2, { type: "email", ...props });
|
|
3761
3781
|
}
|
|
3762
3782
|
|
|
3763
3783
|
// src/components/widgets/FileWidget.tsx
|
|
@@ -3767,7 +3787,7 @@ import {
|
|
|
3767
3787
|
useFileWidgetProps
|
|
3768
3788
|
} from "@rjsf/utils";
|
|
3769
3789
|
import Markdown5 from "markdown-to-jsx";
|
|
3770
|
-
import { Fragment as Fragment4, jsx as
|
|
3790
|
+
import { Fragment as Fragment4, jsx as jsx47, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3771
3791
|
function FileInfoPreview({
|
|
3772
3792
|
fileInfo,
|
|
3773
3793
|
registry
|
|
@@ -3778,11 +3798,11 @@ function FileInfoPreview({
|
|
|
3778
3798
|
return null;
|
|
3779
3799
|
}
|
|
3780
3800
|
if (["image/jpeg", "image/png"].includes(type)) {
|
|
3781
|
-
return /* @__PURE__ */
|
|
3801
|
+
return /* @__PURE__ */ jsx47("img", { src: dataURL, style: { maxWidth: "100%" }, className: "file-preview" });
|
|
3782
3802
|
}
|
|
3783
3803
|
return /* @__PURE__ */ jsxs18(Fragment4, { children: [
|
|
3784
3804
|
" ",
|
|
3785
|
-
/* @__PURE__ */
|
|
3805
|
+
/* @__PURE__ */ jsx47("a", { download: `preview-${name}`, href: dataURL, className: "file-download", children: translateString(TranslatableString13.PreviewLabel) })
|
|
3786
3806
|
] });
|
|
3787
3807
|
}
|
|
3788
3808
|
function FilesInfo({
|
|
@@ -3797,13 +3817,13 @@ function FilesInfo({
|
|
|
3797
3817
|
}
|
|
3798
3818
|
const { translateString } = registry;
|
|
3799
3819
|
const { RemoveButton: RemoveButton2 } = getTemplate22("ButtonTemplates", registry, options);
|
|
3800
|
-
return /* @__PURE__ */
|
|
3820
|
+
return /* @__PURE__ */ jsx47("ul", { className: "file-info", children: filesInfo.map((fileInfo, key) => {
|
|
3801
3821
|
const { name, size, type } = fileInfo;
|
|
3802
3822
|
const handleRemove = () => onRemove(key);
|
|
3803
3823
|
return /* @__PURE__ */ jsxs18("li", { children: [
|
|
3804
|
-
/* @__PURE__ */
|
|
3805
|
-
preview && /* @__PURE__ */
|
|
3806
|
-
/* @__PURE__ */
|
|
3824
|
+
/* @__PURE__ */ jsx47(Markdown5, { children: translateString(TranslatableString13.FilesInfo, [name, type, String(size)]) }),
|
|
3825
|
+
preview && /* @__PURE__ */ jsx47(FileInfoPreview, { fileInfo, registry }),
|
|
3826
|
+
/* @__PURE__ */ jsx47(RemoveButton2, { onClick: handleRemove, registry })
|
|
3807
3827
|
] }, key);
|
|
3808
3828
|
}) });
|
|
3809
3829
|
}
|
|
@@ -3817,7 +3837,7 @@ function FileWidget(props) {
|
|
|
3817
3837
|
}
|
|
3818
3838
|
};
|
|
3819
3839
|
return /* @__PURE__ */ jsxs18("div", { children: [
|
|
3820
|
-
/* @__PURE__ */
|
|
3840
|
+
/* @__PURE__ */ jsx47(
|
|
3821
3841
|
BaseInputTemplate2,
|
|
3822
3842
|
{
|
|
3823
3843
|
...props,
|
|
@@ -3829,7 +3849,7 @@ function FileWidget(props) {
|
|
|
3829
3849
|
accept: options.accept ? String(options.accept) : void 0
|
|
3830
3850
|
}
|
|
3831
3851
|
),
|
|
3832
|
-
/* @__PURE__ */
|
|
3852
|
+
/* @__PURE__ */ jsx47(
|
|
3833
3853
|
FilesInfo,
|
|
3834
3854
|
{
|
|
3835
3855
|
filesInfo,
|
|
@@ -3844,23 +3864,23 @@ function FileWidget(props) {
|
|
|
3844
3864
|
var FileWidget_default = FileWidget;
|
|
3845
3865
|
|
|
3846
3866
|
// src/components/widgets/HiddenWidget.tsx
|
|
3847
|
-
import { jsx as
|
|
3867
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
3848
3868
|
function HiddenWidget({
|
|
3849
3869
|
id,
|
|
3850
3870
|
value,
|
|
3851
3871
|
htmlName
|
|
3852
3872
|
}) {
|
|
3853
|
-
return /* @__PURE__ */
|
|
3873
|
+
return /* @__PURE__ */ jsx48("input", { type: "hidden", id, name: htmlName || id, value: typeof value === "undefined" ? "" : value });
|
|
3854
3874
|
}
|
|
3855
3875
|
var HiddenWidget_default = HiddenWidget;
|
|
3856
3876
|
|
|
3857
3877
|
// src/components/widgets/PasswordWidget.tsx
|
|
3858
3878
|
import { getTemplate as getTemplate23 } from "@rjsf/utils";
|
|
3859
|
-
import { jsx as
|
|
3879
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
3860
3880
|
function PasswordWidget(props) {
|
|
3861
3881
|
const { options, registry } = props;
|
|
3862
3882
|
const BaseInputTemplate2 = getTemplate23("BaseInputTemplate", registry, options);
|
|
3863
|
-
return /* @__PURE__ */
|
|
3883
|
+
return /* @__PURE__ */ jsx49(BaseInputTemplate2, { type: "password", ...props });
|
|
3864
3884
|
}
|
|
3865
3885
|
|
|
3866
3886
|
// src/components/widgets/RadioWidget.tsx
|
|
@@ -3871,7 +3891,7 @@ import {
|
|
|
3871
3891
|
enumOptionsValueForIndex as enumOptionsValueForIndex2,
|
|
3872
3892
|
optionId as optionId2
|
|
3873
3893
|
} from "@rjsf/utils";
|
|
3874
|
-
import { jsx as
|
|
3894
|
+
import { jsx as jsx50, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3875
3895
|
function RadioWidget({
|
|
3876
3896
|
options,
|
|
3877
3897
|
value,
|
|
@@ -3894,13 +3914,13 @@ function RadioWidget({
|
|
|
3894
3914
|
({ target }) => onFocus(id, enumOptionsValueForIndex2(target && target.value, enumOptions, emptyValue)),
|
|
3895
3915
|
[onFocus, enumOptions, emptyValue, id]
|
|
3896
3916
|
);
|
|
3897
|
-
return /* @__PURE__ */
|
|
3917
|
+
return /* @__PURE__ */ jsx50("div", { className: "field-radio-group", id, role: "radiogroup", children: Array.isArray(enumOptions) && enumOptions.map((option, i) => {
|
|
3898
3918
|
const checked = enumOptionsIsSelected2(option.value, value);
|
|
3899
3919
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
3900
3920
|
const disabledCls = disabled || itemDisabled || readonly ? "disabled" : "";
|
|
3901
3921
|
const handleChange = () => onChange(option.value);
|
|
3902
3922
|
const radio = /* @__PURE__ */ jsxs19("span", { children: [
|
|
3903
|
-
/* @__PURE__ */
|
|
3923
|
+
/* @__PURE__ */ jsx50(
|
|
3904
3924
|
"input",
|
|
3905
3925
|
{
|
|
3906
3926
|
type: "radio",
|
|
@@ -3917,15 +3937,15 @@ function RadioWidget({
|
|
|
3917
3937
|
"aria-describedby": ariaDescribedByIds4(id)
|
|
3918
3938
|
}
|
|
3919
3939
|
),
|
|
3920
|
-
/* @__PURE__ */
|
|
3940
|
+
/* @__PURE__ */ jsx50("span", { children: option.label })
|
|
3921
3941
|
] });
|
|
3922
|
-
return inline ? /* @__PURE__ */
|
|
3942
|
+
return inline ? /* @__PURE__ */ jsx50("label", { className: `radio-inline ${disabledCls}`, children: radio }, i) : /* @__PURE__ */ jsx50("div", { className: `radio ${disabledCls}`, children: /* @__PURE__ */ jsx50("label", { children: radio }) }, i);
|
|
3923
3943
|
}) });
|
|
3924
3944
|
}
|
|
3925
3945
|
var RadioWidget_default = RadioWidget;
|
|
3926
3946
|
|
|
3927
3947
|
// src/components/widgets/RangeWidget.tsx
|
|
3928
|
-
import { jsx as
|
|
3948
|
+
import { jsx as jsx51, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3929
3949
|
function RangeWidget(props) {
|
|
3930
3950
|
const {
|
|
3931
3951
|
value,
|
|
@@ -3934,14 +3954,14 @@ function RangeWidget(props) {
|
|
|
3934
3954
|
}
|
|
3935
3955
|
} = props;
|
|
3936
3956
|
return /* @__PURE__ */ jsxs20("div", { className: "field-range-wrapper", children: [
|
|
3937
|
-
/* @__PURE__ */
|
|
3938
|
-
/* @__PURE__ */
|
|
3957
|
+
/* @__PURE__ */ jsx51(BaseInputTemplate2, { type: "range", ...props }),
|
|
3958
|
+
/* @__PURE__ */ jsx51("span", { className: "range-view", children: value })
|
|
3939
3959
|
] });
|
|
3940
3960
|
}
|
|
3941
3961
|
|
|
3942
3962
|
// src/components/widgets/RatingWidget.tsx
|
|
3943
3963
|
import { useCallback as useCallback12 } from "react";
|
|
3944
|
-
import { Fragment as Fragment5, jsx as
|
|
3964
|
+
import { Fragment as Fragment5, jsx as jsx52, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3945
3965
|
function RatingWidget({
|
|
3946
3966
|
id,
|
|
3947
3967
|
value,
|
|
@@ -3991,7 +4011,7 @@ function RatingWidget({
|
|
|
3991
4011
|
}
|
|
3992
4012
|
return isFilled ? "\u2605" : "\u2606";
|
|
3993
4013
|
};
|
|
3994
|
-
return /* @__PURE__ */
|
|
4014
|
+
return /* @__PURE__ */ jsx52(Fragment5, { children: /* @__PURE__ */ jsxs21(
|
|
3995
4015
|
"div",
|
|
3996
4016
|
{
|
|
3997
4017
|
className: "rating-widget",
|
|
@@ -4004,7 +4024,7 @@ function RatingWidget({
|
|
|
4004
4024
|
[...Array(numStars)].map((_, index) => {
|
|
4005
4025
|
const starValue = min + index;
|
|
4006
4026
|
const isFilled = starValue <= value;
|
|
4007
|
-
return /* @__PURE__ */
|
|
4027
|
+
return /* @__PURE__ */ jsx52(
|
|
4008
4028
|
"span",
|
|
4009
4029
|
{
|
|
4010
4030
|
onClick: () => handleStarClick(starValue),
|
|
@@ -4026,7 +4046,7 @@ function RatingWidget({
|
|
|
4026
4046
|
index
|
|
4027
4047
|
);
|
|
4028
4048
|
}),
|
|
4029
|
-
/* @__PURE__ */
|
|
4049
|
+
/* @__PURE__ */ jsx52(
|
|
4030
4050
|
"input",
|
|
4031
4051
|
{
|
|
4032
4052
|
type: "hidden",
|
|
@@ -4050,7 +4070,7 @@ import {
|
|
|
4050
4070
|
enumOptionsIndexForValue,
|
|
4051
4071
|
enumOptionsValueForIndex as enumOptionsValueForIndex3
|
|
4052
4072
|
} from "@rjsf/utils";
|
|
4053
|
-
import { jsx as
|
|
4073
|
+
import { jsx as jsx53, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4054
4074
|
function getValue(event, multiple) {
|
|
4055
4075
|
if (multiple) {
|
|
4056
4076
|
return Array.from(event.target.options).slice().filter((o) => o.selected).map((o) => o.value);
|
|
@@ -4115,10 +4135,10 @@ function SelectWidget({
|
|
|
4115
4135
|
onChange: handleChange,
|
|
4116
4136
|
"aria-describedby": ariaDescribedByIds5(id),
|
|
4117
4137
|
children: [
|
|
4118
|
-
showPlaceholderOption && /* @__PURE__ */
|
|
4138
|
+
showPlaceholderOption && /* @__PURE__ */ jsx53("option", { value: "", children: placeholder }),
|
|
4119
4139
|
Array.isArray(enumOptions) && enumOptions.map(({ value: value2, label }, i) => {
|
|
4120
4140
|
const disabled2 = enumDisabled && enumDisabled.indexOf(value2) !== -1;
|
|
4121
|
-
return /* @__PURE__ */
|
|
4141
|
+
return /* @__PURE__ */ jsx53("option", { value: String(i), disabled: disabled2, children: label }, i);
|
|
4122
4142
|
})
|
|
4123
4143
|
]
|
|
4124
4144
|
}
|
|
@@ -4129,7 +4149,7 @@ var SelectWidget_default = SelectWidget;
|
|
|
4129
4149
|
// src/components/widgets/TextareaWidget.tsx
|
|
4130
4150
|
import { useCallback as useCallback14 } from "react";
|
|
4131
4151
|
import { ariaDescribedByIds as ariaDescribedByIds6 } from "@rjsf/utils";
|
|
4132
|
-
import { jsx as
|
|
4152
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
4133
4153
|
function TextareaWidget({
|
|
4134
4154
|
id,
|
|
4135
4155
|
options = {},
|
|
@@ -4156,7 +4176,7 @@ function TextareaWidget({
|
|
|
4156
4176
|
({ target }) => onFocus(id, target && target.value),
|
|
4157
4177
|
[id, onFocus]
|
|
4158
4178
|
);
|
|
4159
|
-
return /* @__PURE__ */
|
|
4179
|
+
return /* @__PURE__ */ jsx54(
|
|
4160
4180
|
"textarea",
|
|
4161
4181
|
{
|
|
4162
4182
|
id,
|
|
@@ -4180,40 +4200,40 @@ var TextareaWidget_default = TextareaWidget;
|
|
|
4180
4200
|
|
|
4181
4201
|
// src/components/widgets/TextWidget.tsx
|
|
4182
4202
|
import { getTemplate as getTemplate24 } from "@rjsf/utils";
|
|
4183
|
-
import { jsx as
|
|
4203
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
4184
4204
|
function TextWidget(props) {
|
|
4185
4205
|
const { options, registry } = props;
|
|
4186
4206
|
const BaseInputTemplate2 = getTemplate24("BaseInputTemplate", registry, options);
|
|
4187
|
-
return /* @__PURE__ */
|
|
4207
|
+
return /* @__PURE__ */ jsx55(BaseInputTemplate2, { ...props });
|
|
4188
4208
|
}
|
|
4189
4209
|
|
|
4190
4210
|
// src/components/widgets/TimeWidget.tsx
|
|
4191
4211
|
import { useCallback as useCallback15 } from "react";
|
|
4192
4212
|
import { getTemplate as getTemplate25 } from "@rjsf/utils";
|
|
4193
|
-
import { jsx as
|
|
4213
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
4194
4214
|
function TimeWidget(props) {
|
|
4195
4215
|
const { onChange, options, registry } = props;
|
|
4196
4216
|
const BaseInputTemplate2 = getTemplate25("BaseInputTemplate", registry, options);
|
|
4197
4217
|
const handleChange = useCallback15((value) => onChange(value ? `${value}:00` : void 0), [onChange]);
|
|
4198
|
-
return /* @__PURE__ */
|
|
4218
|
+
return /* @__PURE__ */ jsx56(BaseInputTemplate2, { type: "time", ...props, onChange: handleChange });
|
|
4199
4219
|
}
|
|
4200
4220
|
|
|
4201
4221
|
// src/components/widgets/URLWidget.tsx
|
|
4202
4222
|
import { getTemplate as getTemplate26 } from "@rjsf/utils";
|
|
4203
|
-
import { jsx as
|
|
4223
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
4204
4224
|
function URLWidget(props) {
|
|
4205
4225
|
const { options, registry } = props;
|
|
4206
4226
|
const BaseInputTemplate2 = getTemplate26("BaseInputTemplate", registry, options);
|
|
4207
|
-
return /* @__PURE__ */
|
|
4227
|
+
return /* @__PURE__ */ jsx57(BaseInputTemplate2, { type: "url", ...props });
|
|
4208
4228
|
}
|
|
4209
4229
|
|
|
4210
4230
|
// src/components/widgets/UpDownWidget.tsx
|
|
4211
4231
|
import { getTemplate as getTemplate27 } from "@rjsf/utils";
|
|
4212
|
-
import { jsx as
|
|
4232
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
4213
4233
|
function UpDownWidget(props) {
|
|
4214
4234
|
const { options, registry } = props;
|
|
4215
4235
|
const BaseInputTemplate2 = getTemplate27("BaseInputTemplate", registry, options);
|
|
4216
|
-
return /* @__PURE__ */
|
|
4236
|
+
return /* @__PURE__ */ jsx58(BaseInputTemplate2, { type: "number", ...props });
|
|
4217
4237
|
}
|
|
4218
4238
|
|
|
4219
4239
|
// src/components/widgets/index.ts
|
|
@@ -4261,7 +4281,7 @@ function getDefaultRegistry() {
|
|
|
4261
4281
|
}
|
|
4262
4282
|
|
|
4263
4283
|
// src/components/Form.tsx
|
|
4264
|
-
import { jsx as
|
|
4284
|
+
import { jsx as jsx59, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4265
4285
|
function toIChangeEvent(state, status) {
|
|
4266
4286
|
return {
|
|
4267
4287
|
..._pick(state, ["schema", "uiSchema", "fieldPathId", "schemaUtils", "formData", "edit", "errors", "errorSchema"]),
|
|
@@ -4480,11 +4500,12 @@ var Form = class extends Component3 {
|
|
|
4480
4500
|
}
|
|
4481
4501
|
const newRegistry = this.getRegistry(props, rootSchema, schemaUtils);
|
|
4482
4502
|
const registry = deepEquals2(state.registry, newRegistry) ? state.registry : newRegistry;
|
|
4503
|
+
const expandedUiSchema = registry.uiSchemaDefinitions ? expandUiSchemaDefinitions(rootSchema, uiSchema, registry) : uiSchema;
|
|
4483
4504
|
const fieldPathId = state.fieldPathId && state.fieldPathId?.[ID_KEY5] === registry.globalFormOptions.idPrefix ? state.fieldPathId : toFieldPathId6("", registry.globalFormOptions);
|
|
4484
4505
|
const nextState = {
|
|
4485
4506
|
schemaUtils,
|
|
4486
4507
|
schema: rootSchema,
|
|
4487
|
-
uiSchema,
|
|
4508
|
+
uiSchema: expandedUiSchema,
|
|
4488
4509
|
fieldPathId,
|
|
4489
4510
|
formData,
|
|
4490
4511
|
edit,
|
|
@@ -4528,7 +4549,7 @@ var Form = class extends Component3 {
|
|
|
4528
4549
|
const options = getUiOptions21(uiSchema);
|
|
4529
4550
|
const ErrorListTemplate = getTemplate28("ErrorListTemplate", registry, options);
|
|
4530
4551
|
if (errors && errors.length) {
|
|
4531
|
-
return /* @__PURE__ */
|
|
4552
|
+
return /* @__PURE__ */ jsx59(
|
|
4532
4553
|
ErrorListTemplate,
|
|
4533
4554
|
{
|
|
4534
4555
|
errors,
|
|
@@ -4927,7 +4948,8 @@ var Form = class extends Component3 {
|
|
|
4927
4948
|
schemaUtils,
|
|
4928
4949
|
translateString: customTranslateString || translateString,
|
|
4929
4950
|
globalUiOptions: uiSchema[UI_GLOBAL_OPTIONS_KEY2],
|
|
4930
|
-
globalFormOptions: this.getGlobalFormOptions(props)
|
|
4951
|
+
globalFormOptions: this.getGlobalFormOptions(props),
|
|
4952
|
+
uiSchemaDefinitions: uiSchema[UI_DEFINITIONS_KEY] ?? {}
|
|
4931
4953
|
};
|
|
4932
4954
|
}
|
|
4933
4955
|
/** Provides a function that can be used to programmatically submit the `Form` */
|
|
@@ -5085,7 +5107,7 @@ var Form = class extends Component3 {
|
|
|
5085
5107
|
ref: this.formElement,
|
|
5086
5108
|
children: [
|
|
5087
5109
|
showErrorList === "top" && this.renderErrors(registry),
|
|
5088
|
-
/* @__PURE__ */
|
|
5110
|
+
/* @__PURE__ */ jsx59(
|
|
5089
5111
|
_SchemaField,
|
|
5090
5112
|
{
|
|
5091
5113
|
name: "",
|
|
@@ -5102,7 +5124,7 @@ var Form = class extends Component3 {
|
|
|
5102
5124
|
readonly
|
|
5103
5125
|
}
|
|
5104
5126
|
),
|
|
5105
|
-
children ? children : /* @__PURE__ */
|
|
5127
|
+
children ? children : /* @__PURE__ */ jsx59(SubmitButton2, { uiSchema: submitUiSchema, registry }),
|
|
5106
5128
|
showErrorList === "bottom" && this.renderErrors(registry)
|
|
5107
5129
|
]
|
|
5108
5130
|
}
|
|
@@ -5112,7 +5134,7 @@ var Form = class extends Component3 {
|
|
|
5112
5134
|
|
|
5113
5135
|
// src/withTheme.tsx
|
|
5114
5136
|
import { forwardRef } from "react";
|
|
5115
|
-
import { jsx as
|
|
5137
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
5116
5138
|
function withTheme(themeProps) {
|
|
5117
5139
|
return forwardRef(
|
|
5118
5140
|
({ fields: fields2, widgets: widgets2, templates: templates2, ...directProps }, ref) => {
|
|
@@ -5126,7 +5148,7 @@ function withTheme(themeProps) {
|
|
|
5126
5148
|
...templates2?.ButtonTemplates
|
|
5127
5149
|
}
|
|
5128
5150
|
};
|
|
5129
|
-
return /* @__PURE__ */
|
|
5151
|
+
return /* @__PURE__ */ jsx60(
|
|
5130
5152
|
Form,
|
|
5131
5153
|
{
|
|
5132
5154
|
...themeProps,
|
|
@@ -5173,6 +5195,7 @@ var index_default = Form;
|
|
|
5173
5195
|
export {
|
|
5174
5196
|
RichDescription,
|
|
5175
5197
|
RichHelp,
|
|
5198
|
+
SchemaExamples,
|
|
5176
5199
|
index_default as default,
|
|
5177
5200
|
getDefaultRegistry,
|
|
5178
5201
|
getTestRegistry,
|