@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.cjs
CHANGED
|
@@ -41,7 +41,7 @@ __export(index_exports, {
|
|
|
41
41
|
module.exports = __toCommonJS(index_exports);
|
|
42
42
|
|
|
43
43
|
// src/components/Form.tsx
|
|
44
|
-
var
|
|
44
|
+
var import_react23 = require("react");
|
|
45
45
|
var import_utils50 = require("@rjsf/utils");
|
|
46
46
|
var import_cloneDeep2 = __toESM(require("lodash/cloneDeep"), 1);
|
|
47
47
|
var import_get5 = __toESM(require("lodash/get"), 1);
|
|
@@ -956,8 +956,8 @@ function BooleanField(props) {
|
|
|
956
956
|
var BooleanField_default = BooleanField;
|
|
957
957
|
|
|
958
958
|
// src/components/fields/FallbackField.tsx
|
|
959
|
-
var import_utils3 = require("@rjsf/utils");
|
|
960
959
|
var import_react3 = require("react");
|
|
960
|
+
var import_utils3 = require("@rjsf/utils");
|
|
961
961
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
962
962
|
function getFallbackTypeSelectionSchema(title) {
|
|
963
963
|
return {
|
|
@@ -1085,8 +1085,8 @@ var import_has = __toESM(require("lodash/has"), 1);
|
|
|
1085
1085
|
var import_includes = __toESM(require("lodash/includes"), 1);
|
|
1086
1086
|
var import_intersection = __toESM(require("lodash/intersection"), 1);
|
|
1087
1087
|
var import_isEmpty = __toESM(require("lodash/isEmpty"), 1);
|
|
1088
|
-
var import_isFunction = __toESM(require("lodash/isFunction"), 1);
|
|
1089
1088
|
var import_isEqual = __toESM(require("lodash/isEqual"), 1);
|
|
1089
|
+
var import_isFunction = __toESM(require("lodash/isFunction"), 1);
|
|
1090
1090
|
var import_isObject3 = __toESM(require("lodash/isObject"), 1);
|
|
1091
1091
|
var import_isPlainObject = __toESM(require("lodash/isPlainObject"), 1);
|
|
1092
1092
|
var import_isString = __toESM(require("lodash/isString"), 1);
|
|
@@ -1619,10 +1619,10 @@ function LayoutMultiSchemaField(props) {
|
|
|
1619
1619
|
|
|
1620
1620
|
// src/components/fields/MultiSchemaField.tsx
|
|
1621
1621
|
var import_react6 = require("react");
|
|
1622
|
+
var import_utils7 = require("@rjsf/utils");
|
|
1622
1623
|
var import_get3 = __toESM(require("lodash/get"), 1);
|
|
1623
1624
|
var import_isEmpty3 = __toESM(require("lodash/isEmpty"), 1);
|
|
1624
1625
|
var import_omit2 = __toESM(require("lodash/omit"), 1);
|
|
1625
|
-
var import_utils7 = require("@rjsf/utils");
|
|
1626
1626
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1627
1627
|
var AnyOfField = class extends import_react6.Component {
|
|
1628
1628
|
/** Constructs an `AnyOfField` with the given `props` to initialize the initially selected option in state
|
|
@@ -1823,18 +1823,31 @@ var AnyOfField = class extends import_react6.Component {
|
|
|
1823
1823
|
};
|
|
1824
1824
|
var MultiSchemaField_default = AnyOfField;
|
|
1825
1825
|
|
|
1826
|
-
// src/components/fields/
|
|
1826
|
+
// src/components/fields/NullField.tsx
|
|
1827
1827
|
var import_react7 = require("react");
|
|
1828
|
+
function NullField(props) {
|
|
1829
|
+
const { formData, onChange, fieldPathId } = props;
|
|
1830
|
+
(0, import_react7.useEffect)(() => {
|
|
1831
|
+
if (formData === void 0) {
|
|
1832
|
+
onChange(null, fieldPathId.path);
|
|
1833
|
+
}
|
|
1834
|
+
}, [fieldPathId, formData, onChange]);
|
|
1835
|
+
return null;
|
|
1836
|
+
}
|
|
1837
|
+
var NullField_default = NullField;
|
|
1838
|
+
|
|
1839
|
+
// src/components/fields/NumberField.tsx
|
|
1840
|
+
var import_react8 = require("react");
|
|
1828
1841
|
var import_utils8 = require("@rjsf/utils");
|
|
1829
1842
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1830
1843
|
var trailingCharMatcherWithPrefix = /\.([0-9]*0)*$/;
|
|
1831
1844
|
var trailingCharMatcher = /[0.]0*$/;
|
|
1832
1845
|
function NumberField(props) {
|
|
1833
1846
|
const { registry, onChange, formData, value: initialValue } = props;
|
|
1834
|
-
const [lastValue, setLastValue] = (0,
|
|
1847
|
+
const [lastValue, setLastValue] = (0, import_react8.useState)(initialValue);
|
|
1835
1848
|
const { StringField: StringField2 } = registry.fields;
|
|
1836
1849
|
let value = formData;
|
|
1837
|
-
const handleChange = (0,
|
|
1850
|
+
const handleChange = (0, import_react8.useCallback)(
|
|
1838
1851
|
(value2, path, errorSchema, id) => {
|
|
1839
1852
|
setLastValue(value2);
|
|
1840
1853
|
if (`${value2}`.charAt(0) === ".") {
|
|
@@ -1856,17 +1869,17 @@ function NumberField(props) {
|
|
|
1856
1869
|
var NumberField_default = NumberField;
|
|
1857
1870
|
|
|
1858
1871
|
// src/components/fields/ObjectField.tsx
|
|
1859
|
-
var
|
|
1872
|
+
var import_react9 = require("react");
|
|
1860
1873
|
var import_utils9 = require("@rjsf/utils");
|
|
1861
|
-
var import_markdown_to_jsx = __toESM(require("markdown-to-jsx"), 1);
|
|
1862
1874
|
var import_get4 = __toESM(require("lodash/get"), 1);
|
|
1863
1875
|
var import_has3 = __toESM(require("lodash/has"), 1);
|
|
1864
1876
|
var import_isObject4 = __toESM(require("lodash/isObject"), 1);
|
|
1865
1877
|
var import_set4 = __toESM(require("lodash/set"), 1);
|
|
1878
|
+
var import_markdown_to_jsx = require("markdown-to-jsx");
|
|
1866
1879
|
|
|
1867
1880
|
// src/components/constants.ts
|
|
1868
|
-
var ADDITIONAL_PROPERTY_KEY_REMOVE = Symbol("remove-this-key");
|
|
1869
|
-
var IS_RESET = Symbol("reset");
|
|
1881
|
+
var ADDITIONAL_PROPERTY_KEY_REMOVE = /* @__PURE__ */ Symbol("remove-this-key");
|
|
1882
|
+
var IS_RESET = /* @__PURE__ */ Symbol("reset");
|
|
1870
1883
|
|
|
1871
1884
|
// src/components/fields/ObjectField.tsx
|
|
1872
1885
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
@@ -1910,13 +1923,13 @@ function ObjectFieldProperty(props) {
|
|
|
1910
1923
|
handleRemoveProperty,
|
|
1911
1924
|
addedByAdditionalProperties
|
|
1912
1925
|
} = props;
|
|
1913
|
-
const [wasPropertyKeyModified, setWasPropertyKeyModified] = (0,
|
|
1926
|
+
const [wasPropertyKeyModified, setWasPropertyKeyModified] = (0, import_react9.useState)(false);
|
|
1914
1927
|
const { globalFormOptions, fields: fields2 } = registry;
|
|
1915
1928
|
const { SchemaField: SchemaField2 } = fields2;
|
|
1916
1929
|
const innerFieldIdPathId = (0, import_utils9.useDeepCompareMemo)(
|
|
1917
1930
|
(0, import_utils9.toFieldPathId)(propertyName, globalFormOptions, fieldPathId.path)
|
|
1918
1931
|
);
|
|
1919
|
-
const onPropertyChange = (0,
|
|
1932
|
+
const onPropertyChange = (0, import_react9.useCallback)(
|
|
1920
1933
|
(value, path, newErrorSchema, id) => {
|
|
1921
1934
|
if (value === void 0 && addedByAdditionalProperties) {
|
|
1922
1935
|
value = "";
|
|
@@ -1925,7 +1938,7 @@ function ObjectFieldProperty(props) {
|
|
|
1925
1938
|
},
|
|
1926
1939
|
[onChange, addedByAdditionalProperties]
|
|
1927
1940
|
);
|
|
1928
|
-
const onKeyRename = (0,
|
|
1941
|
+
const onKeyRename = (0, import_react9.useCallback)(
|
|
1929
1942
|
(value) => {
|
|
1930
1943
|
if (propertyName !== value) {
|
|
1931
1944
|
setWasPropertyKeyModified(true);
|
|
@@ -1934,7 +1947,7 @@ function ObjectFieldProperty(props) {
|
|
|
1934
1947
|
},
|
|
1935
1948
|
[propertyName, handleKeyRename]
|
|
1936
1949
|
);
|
|
1937
|
-
const onKeyRenameBlur = (0,
|
|
1950
|
+
const onKeyRenameBlur = (0, import_react9.useCallback)(
|
|
1938
1951
|
(event) => {
|
|
1939
1952
|
const {
|
|
1940
1953
|
target: { value }
|
|
@@ -1943,7 +1956,7 @@ function ObjectFieldProperty(props) {
|
|
|
1943
1956
|
},
|
|
1944
1957
|
[onKeyRename]
|
|
1945
1958
|
);
|
|
1946
|
-
const onRemoveProperty = (0,
|
|
1959
|
+
const onRemoveProperty = (0, import_react9.useCallback)(() => {
|
|
1947
1960
|
handleRemoveProperty(propertyName);
|
|
1948
1961
|
}, [propertyName, handleRemoveProperty]);
|
|
1949
1962
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
@@ -1990,19 +2003,19 @@ function ObjectField(props) {
|
|
|
1990
2003
|
} = props;
|
|
1991
2004
|
const { fields: fields2, schemaUtils, translateString, globalUiOptions } = registry;
|
|
1992
2005
|
const { OptionalDataControlsField: OptionalDataControlsField2 } = fields2;
|
|
1993
|
-
const formDataRef = (0,
|
|
2006
|
+
const formDataRef = (0, import_react9.useRef)(formData);
|
|
1994
2007
|
formDataRef.current = formData;
|
|
1995
2008
|
const schema = schemaUtils.retrieveSchema(rawSchema, formData, true);
|
|
1996
2009
|
const uiOptions = (0, import_utils9.getUiOptions)(uiSchema, globalUiOptions);
|
|
1997
2010
|
const { properties: schemaProperties = {} } = schema;
|
|
1998
2011
|
const childFieldPathId = props.childFieldPathId ?? fieldPathId;
|
|
1999
|
-
const lastRenamedProperty = (0,
|
|
2012
|
+
const lastRenamedProperty = (0, import_react9.useRef)({ previousKey: "", currentKey: void 0 });
|
|
2000
2013
|
const templateTitle = uiOptions.title ?? schema.title ?? title ?? name;
|
|
2001
2014
|
const description = uiOptions.description ?? schema.description;
|
|
2002
2015
|
const renderOptionalField = (0, import_utils9.shouldRenderOptionalField)(registry, schema, required, uiSchema);
|
|
2003
2016
|
const hasFormData = (0, import_utils9.isFormDataAvailable)(formData);
|
|
2004
2017
|
let orderedProperties = [];
|
|
2005
|
-
const getAvailableKey = (0,
|
|
2018
|
+
const getAvailableKey = (0, import_react9.useCallback)(
|
|
2006
2019
|
(preferredKey, formData2) => {
|
|
2007
2020
|
const { duplicateKeySuffixSeparator = "-" } = (0, import_utils9.getUiOptions)(uiSchema, globalUiOptions);
|
|
2008
2021
|
let index = 0;
|
|
@@ -2014,7 +2027,7 @@ function ObjectField(props) {
|
|
|
2014
2027
|
},
|
|
2015
2028
|
[uiSchema, globalUiOptions]
|
|
2016
2029
|
);
|
|
2017
|
-
const onAddProperty = (0,
|
|
2030
|
+
const onAddProperty = (0, import_react9.useCallback)(() => {
|
|
2018
2031
|
if (!(schema.additionalProperties || schema.patternProperties)) {
|
|
2019
2032
|
return;
|
|
2020
2033
|
}
|
|
@@ -2052,7 +2065,7 @@ function ObjectField(props) {
|
|
|
2052
2065
|
}
|
|
2053
2066
|
onChange(newFormData, childFieldPathId.path);
|
|
2054
2067
|
}, [formData, onChange, registry, childFieldPathId, getAvailableKey, schema]);
|
|
2055
|
-
const handleKeyRename = (0,
|
|
2068
|
+
const handleKeyRename = (0, import_react9.useCallback)(
|
|
2056
2069
|
(oldKey, newKey) => {
|
|
2057
2070
|
if (oldKey !== newKey) {
|
|
2058
2071
|
const currentFormData = formDataRef.current;
|
|
@@ -2076,13 +2089,13 @@ function ObjectField(props) {
|
|
|
2076
2089
|
},
|
|
2077
2090
|
[onChange, childFieldPathId, getAvailableKey]
|
|
2078
2091
|
);
|
|
2079
|
-
const handleRemoveProperty = (0,
|
|
2092
|
+
const handleRemoveProperty = (0, import_react9.useCallback)(
|
|
2080
2093
|
(key) => {
|
|
2081
2094
|
onChange(ADDITIONAL_PROPERTY_KEY_REMOVE, [...childFieldPathId.path, key]);
|
|
2082
2095
|
},
|
|
2083
2096
|
[onChange, childFieldPathId]
|
|
2084
2097
|
);
|
|
2085
|
-
const getStableKey = (0,
|
|
2098
|
+
const getStableKey = (0, import_react9.useCallback)((property) => {
|
|
2086
2099
|
if (lastRenamedProperty.current.currentKey === property) {
|
|
2087
2100
|
return lastRenamedProperty.current.previousKey;
|
|
2088
2101
|
}
|
|
@@ -2094,7 +2107,7 @@ function ObjectField(props) {
|
|
|
2094
2107
|
orderedProperties = (0, import_utils9.orderProperties)(properties, uiOptions.order);
|
|
2095
2108
|
} catch (err) {
|
|
2096
2109
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
|
|
2097
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "rjsf-config-error", style: { color: "red" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_markdown_to_jsx.
|
|
2110
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "rjsf-config-error", style: { color: "red" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_markdown_to_jsx.Markdown, { options: { disableParsingRawHTML: true }, children: translateString(import_utils9.TranslatableString.InvalidObjectField, [name || "root", err.message]) }) }),
|
|
2098
2111
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("pre", { children: JSON.stringify(schema) })
|
|
2099
2112
|
] });
|
|
2100
2113
|
}
|
|
@@ -2218,7 +2231,7 @@ function OptionalDataControlsField(props) {
|
|
|
2218
2231
|
}
|
|
2219
2232
|
|
|
2220
2233
|
// src/components/fields/SchemaField.tsx
|
|
2221
|
-
var
|
|
2234
|
+
var import_react10 = require("react");
|
|
2222
2235
|
var import_utils11 = require("@rjsf/utils");
|
|
2223
2236
|
var import_isObject5 = __toESM(require("lodash/isObject"), 1);
|
|
2224
2237
|
var import_omit3 = __toESM(require("lodash/omit"), 1);
|
|
@@ -2283,7 +2296,7 @@ function SchemaFieldRender(props) {
|
|
|
2283
2296
|
const FieldErrorTemplate2 = (0, import_utils11.getTemplate)("FieldErrorTemplate", registry, uiOptions);
|
|
2284
2297
|
const schema = schemaUtils.retrieveSchema(_schema, formData);
|
|
2285
2298
|
const fieldId = fieldPathId[import_utils11.ID_KEY];
|
|
2286
|
-
const handleFieldComponentChange = (0,
|
|
2299
|
+
const handleFieldComponentChange = (0, import_react10.useCallback)(
|
|
2287
2300
|
(formData2, path, newErrorSchema, id2) => {
|
|
2288
2301
|
const theId = id2 || fieldId;
|
|
2289
2302
|
return onChange(formData2, path, newErrorSchema, theId);
|
|
@@ -2451,7 +2464,7 @@ function SchemaFieldRender(props) {
|
|
|
2451
2464
|
)
|
|
2452
2465
|
] }) });
|
|
2453
2466
|
}
|
|
2454
|
-
var SchemaField = class extends
|
|
2467
|
+
var SchemaField = class extends import_react10.Component {
|
|
2455
2468
|
shouldComponentUpdate(nextProps) {
|
|
2456
2469
|
const {
|
|
2457
2470
|
registry: { globalFormOptions }
|
|
@@ -2466,7 +2479,7 @@ var SchemaField = class extends import_react9.Component {
|
|
|
2466
2479
|
var SchemaField_default = SchemaField;
|
|
2467
2480
|
|
|
2468
2481
|
// src/components/fields/StringField.tsx
|
|
2469
|
-
var
|
|
2482
|
+
var import_react11 = require("react");
|
|
2470
2483
|
var import_utils12 = require("@rjsf/utils");
|
|
2471
2484
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2472
2485
|
function StringField(props) {
|
|
@@ -2499,7 +2512,7 @@ function StringField(props) {
|
|
|
2499
2512
|
const displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema, globalUiOptions);
|
|
2500
2513
|
const label = uiTitle ?? title ?? schemaTitle ?? name;
|
|
2501
2514
|
const Widget = (0, import_utils12.getWidget)(schema, widget, widgets2);
|
|
2502
|
-
const onWidgetChange = (0,
|
|
2515
|
+
const onWidgetChange = (0, import_react11.useCallback)(
|
|
2503
2516
|
(value, errorSchema, id) => {
|
|
2504
2517
|
return onChange(value, fieldPathId.path, errorSchema, id);
|
|
2505
2518
|
},
|
|
@@ -2533,19 +2546,6 @@ function StringField(props) {
|
|
|
2533
2546
|
}
|
|
2534
2547
|
var StringField_default = StringField;
|
|
2535
2548
|
|
|
2536
|
-
// src/components/fields/NullField.tsx
|
|
2537
|
-
var import_react11 = require("react");
|
|
2538
|
-
function NullField(props) {
|
|
2539
|
-
const { formData, onChange, fieldPathId } = props;
|
|
2540
|
-
(0, import_react11.useEffect)(() => {
|
|
2541
|
-
if (formData === void 0) {
|
|
2542
|
-
onChange(null, fieldPathId.path);
|
|
2543
|
-
}
|
|
2544
|
-
}, [fieldPathId, formData, onChange]);
|
|
2545
|
-
return null;
|
|
2546
|
-
}
|
|
2547
|
-
var NullField_default = NullField;
|
|
2548
|
-
|
|
2549
2549
|
// src/components/fields/index.ts
|
|
2550
2550
|
function fields() {
|
|
2551
2551
|
return {
|
|
@@ -2595,35 +2595,9 @@ function ArrayFieldDescriptionTemplate(props) {
|
|
|
2595
2595
|
);
|
|
2596
2596
|
}
|
|
2597
2597
|
|
|
2598
|
-
// src/components/templates/
|
|
2598
|
+
// src/components/templates/ArrayFieldItemButtonsTemplate.tsx
|
|
2599
2599
|
var import_utils14 = require("@rjsf/utils");
|
|
2600
2600
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2601
|
-
function ArrayFieldItemTemplate(props) {
|
|
2602
|
-
const { children, className, buttonsProps, displayLabel, hasDescription, hasToolbar, registry, uiSchema } = props;
|
|
2603
|
-
const uiOptions = (0, import_utils14.getUiOptions)(uiSchema);
|
|
2604
|
-
const ArrayFieldItemButtonsTemplate2 = (0, import_utils14.getTemplate)(
|
|
2605
|
-
"ArrayFieldItemButtonsTemplate",
|
|
2606
|
-
registry,
|
|
2607
|
-
uiOptions
|
|
2608
|
-
);
|
|
2609
|
-
const btnStyle = {
|
|
2610
|
-
flex: 1,
|
|
2611
|
-
paddingLeft: 6,
|
|
2612
|
-
paddingRight: 6,
|
|
2613
|
-
fontWeight: "bold"
|
|
2614
|
-
};
|
|
2615
|
-
const margin = hasDescription ? 31 : 9;
|
|
2616
|
-
const containerStyle = { display: "flex", alignItems: displayLabel ? "center" : "baseline" };
|
|
2617
|
-
const toolbarStyle = { display: "flex", justifyContent: "flex-end", marginTop: displayLabel ? `${margin}px` : 0 };
|
|
2618
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className, style: containerStyle, children: [
|
|
2619
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: hasToolbar ? "col-xs-9 col-md-10 col-xl-11" : "col-xs-12", children }),
|
|
2620
|
-
hasToolbar && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "col-xs-3 col-md-2 col-xl-1 array-item-toolbox", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "btn-group", style: toolbarStyle, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ArrayFieldItemButtonsTemplate2, { ...buttonsProps, style: btnStyle }) }) })
|
|
2621
|
-
] });
|
|
2622
|
-
}
|
|
2623
|
-
|
|
2624
|
-
// src/components/templates/ArrayFieldItemButtonsTemplate.tsx
|
|
2625
|
-
var import_utils15 = require("@rjsf/utils");
|
|
2626
|
-
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2627
2601
|
function ArrayFieldItemButtonsTemplate(props) {
|
|
2628
2602
|
const {
|
|
2629
2603
|
disabled,
|
|
@@ -2641,11 +2615,11 @@ function ArrayFieldItemButtonsTemplate(props) {
|
|
|
2641
2615
|
uiSchema
|
|
2642
2616
|
} = props;
|
|
2643
2617
|
const { CopyButton: CopyButton2, MoveDownButton: MoveDownButton2, MoveUpButton: MoveUpButton2, RemoveButton: RemoveButton2 } = registry.templates.ButtonTemplates;
|
|
2644
|
-
return /* @__PURE__ */ (0,
|
|
2645
|
-
(hasMoveUp || hasMoveDown) && /* @__PURE__ */ (0,
|
|
2618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
2619
|
+
(hasMoveUp || hasMoveDown) && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2646
2620
|
MoveUpButton2,
|
|
2647
2621
|
{
|
|
2648
|
-
id: (0,
|
|
2622
|
+
id: (0, import_utils14.buttonId)(fieldPathId, "moveUp"),
|
|
2649
2623
|
className: "rjsf-array-item-move-up",
|
|
2650
2624
|
disabled: disabled || readonly || !hasMoveUp,
|
|
2651
2625
|
onClick: onMoveUpItem,
|
|
@@ -2653,10 +2627,10 @@ function ArrayFieldItemButtonsTemplate(props) {
|
|
|
2653
2627
|
registry
|
|
2654
2628
|
}
|
|
2655
2629
|
),
|
|
2656
|
-
(hasMoveUp || hasMoveDown) && /* @__PURE__ */ (0,
|
|
2630
|
+
(hasMoveUp || hasMoveDown) && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2657
2631
|
MoveDownButton2,
|
|
2658
2632
|
{
|
|
2659
|
-
id: (0,
|
|
2633
|
+
id: (0, import_utils14.buttonId)(fieldPathId, "moveDown"),
|
|
2660
2634
|
className: "rjsf-array-item-move-down",
|
|
2661
2635
|
disabled: disabled || readonly || !hasMoveDown,
|
|
2662
2636
|
onClick: onMoveDownItem,
|
|
@@ -2664,10 +2638,10 @@ function ArrayFieldItemButtonsTemplate(props) {
|
|
|
2664
2638
|
registry
|
|
2665
2639
|
}
|
|
2666
2640
|
),
|
|
2667
|
-
hasCopy && /* @__PURE__ */ (0,
|
|
2641
|
+
hasCopy && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2668
2642
|
CopyButton2,
|
|
2669
2643
|
{
|
|
2670
|
-
id: (0,
|
|
2644
|
+
id: (0, import_utils14.buttonId)(fieldPathId, "copy"),
|
|
2671
2645
|
className: "rjsf-array-item-copy",
|
|
2672
2646
|
disabled: disabled || readonly,
|
|
2673
2647
|
onClick: onCopyItem,
|
|
@@ -2675,10 +2649,10 @@ function ArrayFieldItemButtonsTemplate(props) {
|
|
|
2675
2649
|
registry
|
|
2676
2650
|
}
|
|
2677
2651
|
),
|
|
2678
|
-
hasRemove && /* @__PURE__ */ (0,
|
|
2652
|
+
hasRemove && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2679
2653
|
RemoveButton2,
|
|
2680
2654
|
{
|
|
2681
|
-
id: (0,
|
|
2655
|
+
id: (0, import_utils14.buttonId)(fieldPathId, "remove"),
|
|
2682
2656
|
className: "rjsf-array-item-remove",
|
|
2683
2657
|
disabled: disabled || readonly,
|
|
2684
2658
|
onClick: onRemoveItem,
|
|
@@ -2689,6 +2663,32 @@ function ArrayFieldItemButtonsTemplate(props) {
|
|
|
2689
2663
|
] });
|
|
2690
2664
|
}
|
|
2691
2665
|
|
|
2666
|
+
// src/components/templates/ArrayFieldItemTemplate.tsx
|
|
2667
|
+
var import_utils15 = require("@rjsf/utils");
|
|
2668
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2669
|
+
function ArrayFieldItemTemplate(props) {
|
|
2670
|
+
const { children, className, buttonsProps, displayLabel, hasDescription, hasToolbar, registry, uiSchema } = props;
|
|
2671
|
+
const uiOptions = (0, import_utils15.getUiOptions)(uiSchema);
|
|
2672
|
+
const ArrayFieldItemButtonsTemplate2 = (0, import_utils15.getTemplate)(
|
|
2673
|
+
"ArrayFieldItemButtonsTemplate",
|
|
2674
|
+
registry,
|
|
2675
|
+
uiOptions
|
|
2676
|
+
);
|
|
2677
|
+
const btnStyle = {
|
|
2678
|
+
flex: 1,
|
|
2679
|
+
paddingLeft: 6,
|
|
2680
|
+
paddingRight: 6,
|
|
2681
|
+
fontWeight: "bold"
|
|
2682
|
+
};
|
|
2683
|
+
const margin = hasDescription ? 31 : 9;
|
|
2684
|
+
const containerStyle = { display: "flex", alignItems: displayLabel ? "center" : "baseline" };
|
|
2685
|
+
const toolbarStyle = { display: "flex", justifyContent: "flex-end", marginTop: displayLabel ? `${margin}px` : 0 };
|
|
2686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className, style: containerStyle, children: [
|
|
2687
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: hasToolbar ? "col-xs-9 col-md-10 col-xl-11" : "col-xs-12", children }),
|
|
2688
|
+
hasToolbar && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "col-xs-3 col-md-2 col-xl-1 array-item-toolbox", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "btn-group", style: toolbarStyle, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ArrayFieldItemButtonsTemplate2, { ...buttonsProps, style: btnStyle }) }) })
|
|
2689
|
+
] });
|
|
2690
|
+
}
|
|
2691
|
+
|
|
2692
2692
|
// src/components/templates/ArrayFieldTemplate.tsx
|
|
2693
2693
|
var import_utils16 = require("@rjsf/utils");
|
|
2694
2694
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
@@ -2898,50 +2898,39 @@ function BaseInputTemplate(props) {
|
|
|
2898
2898
|
] });
|
|
2899
2899
|
}
|
|
2900
2900
|
|
|
2901
|
-
// src/components/templates/ButtonTemplates/SubmitButton.tsx
|
|
2902
|
-
var import_utils20 = require("@rjsf/utils");
|
|
2903
|
-
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2904
|
-
function SubmitButton({ uiSchema }) {
|
|
2905
|
-
const { submitText, norender, props: submitButtonProps = {} } = (0, import_utils20.getSubmitButtonOptions)(uiSchema);
|
|
2906
|
-
if (norender) {
|
|
2907
|
-
return null;
|
|
2908
|
-
}
|
|
2909
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "submit", ...submitButtonProps, className: `btn btn-info ${submitButtonProps.className || ""}`, children: submitText }) });
|
|
2910
|
-
}
|
|
2911
|
-
|
|
2912
2901
|
// src/components/templates/ButtonTemplates/AddButton.tsx
|
|
2913
|
-
var
|
|
2902
|
+
var import_utils21 = require("@rjsf/utils");
|
|
2914
2903
|
|
|
2915
2904
|
// src/components/templates/ButtonTemplates/IconButton.tsx
|
|
2916
|
-
var
|
|
2917
|
-
var
|
|
2905
|
+
var import_utils20 = require("@rjsf/utils");
|
|
2906
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2918
2907
|
function IconButton(props) {
|
|
2919
2908
|
const { iconType = "default", icon, className, uiSchema, registry, ...otherProps } = props;
|
|
2920
|
-
return /* @__PURE__ */ (0,
|
|
2909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", className: `btn btn-${iconType} ${className}`, ...otherProps, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("i", { className: `glyphicon glyphicon-${icon}` }) });
|
|
2921
2910
|
}
|
|
2922
2911
|
function CopyButton(props) {
|
|
2923
2912
|
const {
|
|
2924
2913
|
registry: { translateString }
|
|
2925
2914
|
} = props;
|
|
2926
|
-
return /* @__PURE__ */ (0,
|
|
2915
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(IconButton, { title: translateString(import_utils20.TranslatableString.CopyButton), ...props, icon: "copy" });
|
|
2927
2916
|
}
|
|
2928
2917
|
function MoveDownButton(props) {
|
|
2929
2918
|
const {
|
|
2930
2919
|
registry: { translateString }
|
|
2931
2920
|
} = props;
|
|
2932
|
-
return /* @__PURE__ */ (0,
|
|
2921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(IconButton, { title: translateString(import_utils20.TranslatableString.MoveDownButton), ...props, icon: "arrow-down" });
|
|
2933
2922
|
}
|
|
2934
2923
|
function MoveUpButton(props) {
|
|
2935
2924
|
const {
|
|
2936
2925
|
registry: { translateString }
|
|
2937
2926
|
} = props;
|
|
2938
|
-
return /* @__PURE__ */ (0,
|
|
2927
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(IconButton, { title: translateString(import_utils20.TranslatableString.MoveUpButton), ...props, icon: "arrow-up" });
|
|
2939
2928
|
}
|
|
2940
2929
|
function RemoveButton(props) {
|
|
2941
2930
|
const {
|
|
2942
2931
|
registry: { translateString }
|
|
2943
2932
|
} = props;
|
|
2944
|
-
return /* @__PURE__ */ (0,
|
|
2933
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(IconButton, { title: translateString(import_utils20.TranslatableString.RemoveButton), ...props, iconType: "danger", icon: "remove" });
|
|
2945
2934
|
}
|
|
2946
2935
|
function ClearButton({
|
|
2947
2936
|
id,
|
|
@@ -2952,14 +2941,14 @@ function ClearButton({
|
|
|
2952
2941
|
...props
|
|
2953
2942
|
}) {
|
|
2954
2943
|
const { translateString } = registry;
|
|
2955
|
-
return /* @__PURE__ */ (0,
|
|
2944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2956
2945
|
IconButton,
|
|
2957
2946
|
{
|
|
2958
2947
|
id,
|
|
2959
2948
|
iconType: "default",
|
|
2960
2949
|
icon: "remove",
|
|
2961
2950
|
className: "btn-clear col-xs-12",
|
|
2962
|
-
title: translateString(
|
|
2951
|
+
title: translateString(import_utils20.TranslatableString.ClearButton),
|
|
2963
2952
|
onClick,
|
|
2964
2953
|
disabled,
|
|
2965
2954
|
registry,
|
|
@@ -2969,7 +2958,7 @@ function ClearButton({
|
|
|
2969
2958
|
}
|
|
2970
2959
|
|
|
2971
2960
|
// src/components/templates/ButtonTemplates/AddButton.tsx
|
|
2972
|
-
var
|
|
2961
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2973
2962
|
function AddButton({
|
|
2974
2963
|
id,
|
|
2975
2964
|
className,
|
|
@@ -2978,18 +2967,18 @@ function AddButton({
|
|
|
2978
2967
|
registry
|
|
2979
2968
|
}) {
|
|
2980
2969
|
const { translateString } = registry;
|
|
2981
|
-
return /* @__PURE__ */ (0,
|
|
2970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2982
2971
|
"p",
|
|
2983
2972
|
{
|
|
2984
2973
|
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}`,
|
|
2985
|
-
children: /* @__PURE__ */ (0,
|
|
2974
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2986
2975
|
IconButton,
|
|
2987
2976
|
{
|
|
2988
2977
|
id,
|
|
2989
2978
|
iconType: "info",
|
|
2990
2979
|
icon: "plus",
|
|
2991
2980
|
className: "btn-add col-xs-12",
|
|
2992
|
-
title: translateString(
|
|
2981
|
+
title: translateString(import_utils21.TranslatableString.AddButton),
|
|
2993
2982
|
onClick,
|
|
2994
2983
|
disabled,
|
|
2995
2984
|
registry
|
|
@@ -2999,6 +2988,17 @@ function AddButton({
|
|
|
2999
2988
|
) });
|
|
3000
2989
|
}
|
|
3001
2990
|
|
|
2991
|
+
// src/components/templates/ButtonTemplates/SubmitButton.tsx
|
|
2992
|
+
var import_utils22 = require("@rjsf/utils");
|
|
2993
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2994
|
+
function SubmitButton({ uiSchema }) {
|
|
2995
|
+
const { submitText, norender, props: submitButtonProps = {} } = (0, import_utils22.getSubmitButtonOptions)(uiSchema);
|
|
2996
|
+
if (norender) {
|
|
2997
|
+
return null;
|
|
2998
|
+
}
|
|
2999
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { type: "submit", ...submitButtonProps, className: `btn btn-info ${submitButtonProps.className || ""}`, children: submitText }) });
|
|
3000
|
+
}
|
|
3001
|
+
|
|
3002
3002
|
// src/components/templates/ButtonTemplates/index.ts
|
|
3003
3003
|
function buttonTemplates() {
|
|
3004
3004
|
return {
|
|
@@ -3015,14 +3015,14 @@ var ButtonTemplates_default = buttonTemplates;
|
|
|
3015
3015
|
|
|
3016
3016
|
// src/components/RichDescription.tsx
|
|
3017
3017
|
var import_utils23 = require("@rjsf/utils");
|
|
3018
|
-
var
|
|
3018
|
+
var import_react13 = require("markdown-to-jsx/react");
|
|
3019
3019
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3020
3020
|
var TEST_IDS = (0, import_utils23.getTestIds)();
|
|
3021
3021
|
function RichDescription({ description, registry, uiSchema = {} }) {
|
|
3022
3022
|
const { globalUiOptions } = registry;
|
|
3023
3023
|
const uiOptions = (0, import_utils23.getUiOptions)(uiSchema, globalUiOptions);
|
|
3024
3024
|
if (uiOptions.enableMarkdownInDescription && typeof description === "string") {
|
|
3025
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3025
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react13.Markdown, { options: { disableParsingRawHTML: true }, "data-testid": TEST_IDS.markdown, children: description });
|
|
3026
3026
|
}
|
|
3027
3027
|
return description;
|
|
3028
3028
|
}
|
|
@@ -3074,95 +3074,95 @@ function FallbackFieldTemplate(props) {
|
|
|
3074
3074
|
);
|
|
3075
3075
|
}
|
|
3076
3076
|
|
|
3077
|
-
// src/components/templates/
|
|
3077
|
+
// src/components/templates/FieldErrorTemplate.tsx
|
|
3078
3078
|
var import_utils26 = require("@rjsf/utils");
|
|
3079
|
-
|
|
3080
|
-
// src/components/templates/FieldTemplate/Label.tsx
|
|
3081
3079
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
3082
|
-
var REQUIRED_FIELD_SYMBOL = "*";
|
|
3083
|
-
function Label(props) {
|
|
3084
|
-
const { label, required, id } = props;
|
|
3085
|
-
if (!label) {
|
|
3086
|
-
return null;
|
|
3087
|
-
}
|
|
3088
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { className: "control-label", htmlFor: id, children: [
|
|
3089
|
-
label,
|
|
3090
|
-
required && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "required", children: REQUIRED_FIELD_SYMBOL })
|
|
3091
|
-
] });
|
|
3092
|
-
}
|
|
3093
|
-
|
|
3094
|
-
// src/components/templates/FieldTemplate/FieldTemplate.tsx
|
|
3095
|
-
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
3096
|
-
function FieldTemplate(props) {
|
|
3097
|
-
const { id, label, children, errors, help, description, hidden, required, displayLabel, registry, uiSchema } = props;
|
|
3098
|
-
const uiOptions = (0, import_utils26.getUiOptions)(uiSchema);
|
|
3099
|
-
const WrapIfAdditionalTemplate2 = (0, import_utils26.getTemplate)(
|
|
3100
|
-
"WrapIfAdditionalTemplate",
|
|
3101
|
-
registry,
|
|
3102
|
-
uiOptions
|
|
3103
|
-
);
|
|
3104
|
-
if (hidden) {
|
|
3105
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "hidden", children });
|
|
3106
|
-
}
|
|
3107
|
-
const isCheckbox = uiOptions.widget === "checkbox";
|
|
3108
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(WrapIfAdditionalTemplate2, { ...props, children: [
|
|
3109
|
-
displayLabel && !isCheckbox && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Label, { label, required, id }),
|
|
3110
|
-
displayLabel && description ? description : null,
|
|
3111
|
-
children,
|
|
3112
|
-
errors,
|
|
3113
|
-
help
|
|
3114
|
-
] });
|
|
3115
|
-
}
|
|
3116
|
-
|
|
3117
|
-
// src/components/templates/FieldTemplate/index.ts
|
|
3118
|
-
var FieldTemplate_default = FieldTemplate;
|
|
3119
|
-
|
|
3120
|
-
// src/components/templates/FieldErrorTemplate.tsx
|
|
3121
|
-
var import_utils27 = require("@rjsf/utils");
|
|
3122
|
-
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
3123
3080
|
function FieldErrorTemplate(props) {
|
|
3124
3081
|
const { errors = [], fieldPathId } = props;
|
|
3125
3082
|
if (errors.length === 0) {
|
|
3126
3083
|
return null;
|
|
3127
3084
|
}
|
|
3128
|
-
const id = (0,
|
|
3129
|
-
return /* @__PURE__ */ (0,
|
|
3130
|
-
return /* @__PURE__ */ (0,
|
|
3085
|
+
const id = (0, import_utils26.errorId)(fieldPathId);
|
|
3086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("ul", { id, className: "error-detail bs-callout bs-callout-info", children: errors.filter((elem) => !!elem).map((error, index) => {
|
|
3087
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("li", { className: "text-danger", children: error }, index);
|
|
3131
3088
|
}) }) });
|
|
3132
3089
|
}
|
|
3133
3090
|
|
|
3134
3091
|
// src/components/templates/FieldHelpTemplate.tsx
|
|
3135
|
-
var
|
|
3092
|
+
var import_utils28 = require("@rjsf/utils");
|
|
3136
3093
|
|
|
3137
3094
|
// src/components/RichHelp.tsx
|
|
3138
|
-
var
|
|
3139
|
-
var
|
|
3140
|
-
var
|
|
3141
|
-
var TEST_IDS2 = (0,
|
|
3095
|
+
var import_utils27 = require("@rjsf/utils");
|
|
3096
|
+
var import_react14 = require("markdown-to-jsx/react");
|
|
3097
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
3098
|
+
var TEST_IDS2 = (0, import_utils27.getTestIds)();
|
|
3142
3099
|
function RichHelp({
|
|
3143
3100
|
help,
|
|
3144
3101
|
registry,
|
|
3145
3102
|
uiSchema = {}
|
|
3146
3103
|
}) {
|
|
3147
3104
|
const { globalUiOptions } = registry;
|
|
3148
|
-
const uiOptions = (0,
|
|
3105
|
+
const uiOptions = (0, import_utils27.getUiOptions)(uiSchema, globalUiOptions);
|
|
3149
3106
|
if (uiOptions.enableMarkdownInHelp && typeof help === "string") {
|
|
3150
|
-
return /* @__PURE__ */ (0,
|
|
3107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react14.Markdown, { options: { disableParsingRawHTML: true }, "data-testid": TEST_IDS2.markdown, children: help });
|
|
3151
3108
|
}
|
|
3152
3109
|
return help;
|
|
3153
3110
|
}
|
|
3154
3111
|
RichHelp.TEST_IDS = TEST_IDS2;
|
|
3155
3112
|
|
|
3156
3113
|
// src/components/templates/FieldHelpTemplate.tsx
|
|
3157
|
-
var
|
|
3114
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
3158
3115
|
function FieldHelpTemplate(props) {
|
|
3159
3116
|
const { fieldPathId, help, uiSchema, registry } = props;
|
|
3160
3117
|
if (!help) {
|
|
3161
3118
|
return null;
|
|
3162
3119
|
}
|
|
3163
|
-
return /* @__PURE__ */ (0,
|
|
3120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { id: (0, import_utils28.helpId)(fieldPathId), className: "help-block", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(RichHelp, { help, registry, uiSchema }) });
|
|
3121
|
+
}
|
|
3122
|
+
|
|
3123
|
+
// src/components/templates/FieldTemplate/FieldTemplate.tsx
|
|
3124
|
+
var import_utils29 = require("@rjsf/utils");
|
|
3125
|
+
|
|
3126
|
+
// src/components/templates/FieldTemplate/Label.tsx
|
|
3127
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
3128
|
+
var REQUIRED_FIELD_SYMBOL = "*";
|
|
3129
|
+
function Label(props) {
|
|
3130
|
+
const { label, required, id } = props;
|
|
3131
|
+
if (!label) {
|
|
3132
|
+
return null;
|
|
3133
|
+
}
|
|
3134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "control-label", htmlFor: id, children: [
|
|
3135
|
+
label,
|
|
3136
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "required", children: REQUIRED_FIELD_SYMBOL })
|
|
3137
|
+
] });
|
|
3164
3138
|
}
|
|
3165
3139
|
|
|
3140
|
+
// src/components/templates/FieldTemplate/FieldTemplate.tsx
|
|
3141
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
3142
|
+
function FieldTemplate(props) {
|
|
3143
|
+
const { id, label, children, errors, help, description, hidden, required, displayLabel, registry, uiSchema } = props;
|
|
3144
|
+
const uiOptions = (0, import_utils29.getUiOptions)(uiSchema);
|
|
3145
|
+
const WrapIfAdditionalTemplate2 = (0, import_utils29.getTemplate)(
|
|
3146
|
+
"WrapIfAdditionalTemplate",
|
|
3147
|
+
registry,
|
|
3148
|
+
uiOptions
|
|
3149
|
+
);
|
|
3150
|
+
if (hidden) {
|
|
3151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "hidden", children });
|
|
3152
|
+
}
|
|
3153
|
+
const isCheckbox = uiOptions.widget === "checkbox";
|
|
3154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(WrapIfAdditionalTemplate2, { ...props, children: [
|
|
3155
|
+
displayLabel && !isCheckbox && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Label, { label, required, id }),
|
|
3156
|
+
displayLabel && description ? description : null,
|
|
3157
|
+
children,
|
|
3158
|
+
errors,
|
|
3159
|
+
help
|
|
3160
|
+
] });
|
|
3161
|
+
}
|
|
3162
|
+
|
|
3163
|
+
// src/components/templates/FieldTemplate/index.ts
|
|
3164
|
+
var FieldTemplate_default = FieldTemplate;
|
|
3165
|
+
|
|
3166
3166
|
// src/components/templates/GridTemplate.tsx
|
|
3167
3167
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3168
3168
|
function GridTemplate(props) {
|
|
@@ -3300,7 +3300,7 @@ function TitleField(props) {
|
|
|
3300
3300
|
|
|
3301
3301
|
// src/components/templates/UnsupportedField.tsx
|
|
3302
3302
|
var import_utils31 = require("@rjsf/utils");
|
|
3303
|
-
var
|
|
3303
|
+
var import_markdown_to_jsx2 = require("markdown-to-jsx");
|
|
3304
3304
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3305
3305
|
function UnsupportedField(props) {
|
|
3306
3306
|
const { schema, fieldPathId, reason, registry } = props;
|
|
@@ -3316,7 +3316,7 @@ function UnsupportedField(props) {
|
|
|
3316
3316
|
translateParams.push(reason);
|
|
3317
3317
|
}
|
|
3318
3318
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "unsupported-field", children: [
|
|
3319
|
-
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3319
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_markdown_to_jsx2.Markdown, { options: { disableParsingRawHTML: true }, children: translateString(translateEnum, translateParams) }) }),
|
|
3320
3320
|
schema && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("pre", { children: JSON.stringify(schema, null, 2) })
|
|
3321
3321
|
] });
|
|
3322
3322
|
}
|
|
@@ -3418,15 +3418,26 @@ function templates() {
|
|
|
3418
3418
|
}
|
|
3419
3419
|
var templates_default = templates;
|
|
3420
3420
|
|
|
3421
|
+
// src/components/widgets/AltDateTimeWidget.tsx
|
|
3422
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3423
|
+
function AltDateTimeWidget({
|
|
3424
|
+
time = true,
|
|
3425
|
+
...props
|
|
3426
|
+
}) {
|
|
3427
|
+
const { AltDateWidget: AltDateWidget2 } = props.registry.widgets;
|
|
3428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AltDateWidget2, { time, ...props });
|
|
3429
|
+
}
|
|
3430
|
+
var AltDateTimeWidget_default = AltDateTimeWidget;
|
|
3431
|
+
|
|
3421
3432
|
// src/components/widgets/AltDateWidget.tsx
|
|
3422
3433
|
var import_utils33 = require("@rjsf/utils");
|
|
3423
|
-
var
|
|
3434
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3424
3435
|
function AltDateWidget(props) {
|
|
3425
3436
|
const { disabled = false, readonly = false, autofocus = false, options, id, name, registry, onBlur, onFocus } = props;
|
|
3426
3437
|
const { translateString } = registry;
|
|
3427
3438
|
const { elements, handleChange, handleClear, handleSetNow } = (0, import_utils33.useAltDateWidgetProps)(props);
|
|
3428
|
-
return /* @__PURE__ */ (0,
|
|
3429
|
-
elements.map((elemProps, i) => /* @__PURE__ */ (0,
|
|
3439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("ul", { className: "list-inline", children: [
|
|
3440
|
+
elements.map((elemProps, i) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("li", { className: "list-inline-item", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3430
3441
|
import_utils33.DateElement,
|
|
3431
3442
|
{
|
|
3432
3443
|
rootId: id,
|
|
@@ -3441,27 +3452,78 @@ function AltDateWidget(props) {
|
|
|
3441
3452
|
autofocus: autofocus && i === 0
|
|
3442
3453
|
}
|
|
3443
3454
|
) }, i)),
|
|
3444
|
-
(options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /* @__PURE__ */ (0,
|
|
3445
|
-
(options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /* @__PURE__ */ (0,
|
|
3455
|
+
(options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("li", { className: "list-inline-item", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("a", { href: "#", className: "btn btn-info btn-now", onClick: handleSetNow, children: translateString(import_utils33.TranslatableString.NowLabel) }) }),
|
|
3456
|
+
(options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("li", { className: "list-inline-item", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("a", { href: "#", className: "btn btn-warning btn-clear", onClick: handleClear, children: translateString(import_utils33.TranslatableString.ClearLabel) }) })
|
|
3446
3457
|
] });
|
|
3447
3458
|
}
|
|
3448
3459
|
var AltDateWidget_default = AltDateWidget;
|
|
3449
3460
|
|
|
3450
|
-
// src/components/widgets/
|
|
3451
|
-
var
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3461
|
+
// src/components/widgets/CheckboxesWidget.tsx
|
|
3462
|
+
var import_react15 = require("react");
|
|
3463
|
+
var import_utils34 = require("@rjsf/utils");
|
|
3464
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3465
|
+
function CheckboxesWidget({
|
|
3466
|
+
id,
|
|
3467
|
+
disabled,
|
|
3468
|
+
options,
|
|
3469
|
+
value,
|
|
3470
|
+
autofocus = false,
|
|
3471
|
+
readonly,
|
|
3472
|
+
onChange,
|
|
3473
|
+
onBlur,
|
|
3474
|
+
onFocus,
|
|
3475
|
+
htmlName
|
|
3455
3476
|
}) {
|
|
3456
|
-
const {
|
|
3457
|
-
|
|
3477
|
+
const { inline = false, enumOptions, enumDisabled, emptyValue } = options;
|
|
3478
|
+
const optionValueFormat = (0, import_utils34.getOptionValueFormat)(options);
|
|
3479
|
+
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
3480
|
+
const handleBlur = (0, import_react15.useCallback)(
|
|
3481
|
+
({ target }) => onBlur(id, (0, import_utils34.enumOptionValueDecoder)(target && target.value, enumOptions, optionValueFormat, emptyValue)),
|
|
3482
|
+
[onBlur, id, enumOptions, emptyValue, optionValueFormat]
|
|
3483
|
+
);
|
|
3484
|
+
const handleFocus = (0, import_react15.useCallback)(
|
|
3485
|
+
({ target }) => onFocus(id, (0, import_utils34.enumOptionValueDecoder)(target && target.value, enumOptions, optionValueFormat, emptyValue)),
|
|
3486
|
+
[onFocus, id, enumOptions, emptyValue, optionValueFormat]
|
|
3487
|
+
);
|
|
3488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "checkboxes", id, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
3489
|
+
const checked = (0, import_utils34.enumOptionsIsSelected)(option.value, checkboxesValues);
|
|
3490
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
3491
|
+
const disabledCls = disabled || itemDisabled || readonly ? "disabled" : "";
|
|
3492
|
+
const handleChange = (event) => {
|
|
3493
|
+
if (event.target.checked) {
|
|
3494
|
+
onChange((0, import_utils34.enumOptionsSelectValue)(index, checkboxesValues, enumOptions));
|
|
3495
|
+
} else {
|
|
3496
|
+
onChange((0, import_utils34.enumOptionsDeselectValue)(index, checkboxesValues, enumOptions));
|
|
3497
|
+
}
|
|
3498
|
+
};
|
|
3499
|
+
const checkbox = /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { children: [
|
|
3500
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3501
|
+
"input",
|
|
3502
|
+
{
|
|
3503
|
+
type: "checkbox",
|
|
3504
|
+
id: (0, import_utils34.optionId)(id, index),
|
|
3505
|
+
name: htmlName || id,
|
|
3506
|
+
checked,
|
|
3507
|
+
value: (0, import_utils34.enumOptionValueEncoder)(option.value, index, optionValueFormat),
|
|
3508
|
+
disabled: disabled || itemDisabled || readonly,
|
|
3509
|
+
autoFocus: autofocus && index === 0,
|
|
3510
|
+
onChange: handleChange,
|
|
3511
|
+
onBlur: handleBlur,
|
|
3512
|
+
onFocus: handleFocus,
|
|
3513
|
+
"aria-describedby": (0, import_utils34.ariaDescribedByIds)(id)
|
|
3514
|
+
}
|
|
3515
|
+
),
|
|
3516
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: option.label })
|
|
3517
|
+
] });
|
|
3518
|
+
return inline ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("label", { className: `checkbox-inline ${disabledCls}`, children: checkbox }, index) : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: `checkbox ${disabledCls}`, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("label", { children: checkbox }) }, index);
|
|
3519
|
+
}) });
|
|
3458
3520
|
}
|
|
3459
|
-
var
|
|
3521
|
+
var CheckboxesWidget_default = CheckboxesWidget;
|
|
3460
3522
|
|
|
3461
3523
|
// src/components/widgets/CheckboxWidget.tsx
|
|
3462
|
-
var
|
|
3463
|
-
var
|
|
3464
|
-
var
|
|
3524
|
+
var import_react16 = require("react");
|
|
3525
|
+
var import_utils35 = require("@rjsf/utils");
|
|
3526
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3465
3527
|
function CheckboxWidget({
|
|
3466
3528
|
schema,
|
|
3467
3529
|
uiSchema,
|
|
@@ -3479,40 +3541,40 @@ function CheckboxWidget({
|
|
|
3479
3541
|
registry,
|
|
3480
3542
|
htmlName
|
|
3481
3543
|
}) {
|
|
3482
|
-
const DescriptionFieldTemplate = (0,
|
|
3544
|
+
const DescriptionFieldTemplate = (0, import_utils35.getTemplate)(
|
|
3483
3545
|
"DescriptionFieldTemplate",
|
|
3484
3546
|
registry,
|
|
3485
3547
|
options
|
|
3486
3548
|
);
|
|
3487
|
-
const required = (0,
|
|
3488
|
-
const handleChange = (0,
|
|
3549
|
+
const required = (0, import_utils35.schemaRequiresTrueValue)(schema);
|
|
3550
|
+
const handleChange = (0, import_react16.useCallback)(
|
|
3489
3551
|
(event) => onChange(event.target.checked),
|
|
3490
3552
|
[onChange]
|
|
3491
3553
|
);
|
|
3492
|
-
const handleBlur = (0,
|
|
3554
|
+
const handleBlur = (0, import_react16.useCallback)(
|
|
3493
3555
|
(event) => onBlur(id, event.target.checked),
|
|
3494
3556
|
[onBlur, id]
|
|
3495
3557
|
);
|
|
3496
|
-
const handleFocus = (0,
|
|
3558
|
+
const handleFocus = (0, import_react16.useCallback)(
|
|
3497
3559
|
(event) => onFocus(id, event.target.checked),
|
|
3498
3560
|
[onFocus, id]
|
|
3499
3561
|
);
|
|
3500
|
-
const uiOptions = (0,
|
|
3562
|
+
const uiOptions = (0, import_utils35.getUiOptions)(uiSchema);
|
|
3501
3563
|
const isCheckboxWidget = uiOptions.widget === "checkbox";
|
|
3502
3564
|
const description = isCheckboxWidget ? void 0 : options.description ?? schema.description;
|
|
3503
|
-
return /* @__PURE__ */ (0,
|
|
3504
|
-
!hideLabel && description && /* @__PURE__ */ (0,
|
|
3565
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: `checkbox ${disabled || readonly ? "disabled" : ""}`, children: [
|
|
3566
|
+
!hideLabel && description && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3505
3567
|
DescriptionFieldTemplate,
|
|
3506
3568
|
{
|
|
3507
|
-
id: (0,
|
|
3569
|
+
id: (0, import_utils35.descriptionId)(id),
|
|
3508
3570
|
description,
|
|
3509
3571
|
schema,
|
|
3510
3572
|
uiSchema,
|
|
3511
3573
|
registry
|
|
3512
3574
|
}
|
|
3513
3575
|
),
|
|
3514
|
-
/* @__PURE__ */ (0,
|
|
3515
|
-
/* @__PURE__ */ (0,
|
|
3576
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("label", { children: [
|
|
3577
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3516
3578
|
"input",
|
|
3517
3579
|
{
|
|
3518
3580
|
type: "checkbox",
|
|
@@ -3525,77 +3587,15 @@ function CheckboxWidget({
|
|
|
3525
3587
|
onChange: handleChange,
|
|
3526
3588
|
onBlur: handleBlur,
|
|
3527
3589
|
onFocus: handleFocus,
|
|
3528
|
-
"aria-describedby": (0,
|
|
3590
|
+
"aria-describedby": (0, import_utils35.ariaDescribedByIds)(id)
|
|
3529
3591
|
}
|
|
3530
3592
|
),
|
|
3531
|
-
(0,
|
|
3593
|
+
(0, import_utils35.labelValue)(/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { children: label }), hideLabel)
|
|
3532
3594
|
] })
|
|
3533
3595
|
] });
|
|
3534
3596
|
}
|
|
3535
3597
|
var CheckboxWidget_default = CheckboxWidget;
|
|
3536
3598
|
|
|
3537
|
-
// src/components/widgets/CheckboxesWidget.tsx
|
|
3538
|
-
var import_react14 = require("react");
|
|
3539
|
-
var import_utils35 = require("@rjsf/utils");
|
|
3540
|
-
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3541
|
-
function CheckboxesWidget({
|
|
3542
|
-
id,
|
|
3543
|
-
disabled,
|
|
3544
|
-
options,
|
|
3545
|
-
value,
|
|
3546
|
-
autofocus = false,
|
|
3547
|
-
readonly,
|
|
3548
|
-
onChange,
|
|
3549
|
-
onBlur,
|
|
3550
|
-
onFocus,
|
|
3551
|
-
htmlName
|
|
3552
|
-
}) {
|
|
3553
|
-
const { inline = false, enumOptions, enumDisabled, emptyValue } = options;
|
|
3554
|
-
const optionValueFormat = (0, import_utils35.getOptionValueFormat)(options);
|
|
3555
|
-
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
3556
|
-
const handleBlur = (0, import_react14.useCallback)(
|
|
3557
|
-
({ target }) => onBlur(id, (0, import_utils35.enumOptionValueDecoder)(target && target.value, enumOptions, optionValueFormat, emptyValue)),
|
|
3558
|
-
[onBlur, id, enumOptions, emptyValue, optionValueFormat]
|
|
3559
|
-
);
|
|
3560
|
-
const handleFocus = (0, import_react14.useCallback)(
|
|
3561
|
-
({ target }) => onFocus(id, (0, import_utils35.enumOptionValueDecoder)(target && target.value, enumOptions, optionValueFormat, emptyValue)),
|
|
3562
|
-
[onFocus, id, enumOptions, emptyValue, optionValueFormat]
|
|
3563
|
-
);
|
|
3564
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "checkboxes", id, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
3565
|
-
const checked = (0, import_utils35.enumOptionsIsSelected)(option.value, checkboxesValues);
|
|
3566
|
-
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
3567
|
-
const disabledCls = disabled || itemDisabled || readonly ? "disabled" : "";
|
|
3568
|
-
const handleChange = (event) => {
|
|
3569
|
-
if (event.target.checked) {
|
|
3570
|
-
onChange((0, import_utils35.enumOptionsSelectValue)(index, checkboxesValues, enumOptions));
|
|
3571
|
-
} else {
|
|
3572
|
-
onChange((0, import_utils35.enumOptionsDeselectValue)(index, checkboxesValues, enumOptions));
|
|
3573
|
-
}
|
|
3574
|
-
};
|
|
3575
|
-
const checkbox = /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
|
|
3576
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3577
|
-
"input",
|
|
3578
|
-
{
|
|
3579
|
-
type: "checkbox",
|
|
3580
|
-
id: (0, import_utils35.optionId)(id, index),
|
|
3581
|
-
name: htmlName || id,
|
|
3582
|
-
checked,
|
|
3583
|
-
value: (0, import_utils35.enumOptionValueEncoder)(option.value, index, optionValueFormat),
|
|
3584
|
-
disabled: disabled || itemDisabled || readonly,
|
|
3585
|
-
autoFocus: autofocus && index === 0,
|
|
3586
|
-
onChange: handleChange,
|
|
3587
|
-
onBlur: handleBlur,
|
|
3588
|
-
onFocus: handleFocus,
|
|
3589
|
-
"aria-describedby": (0, import_utils35.ariaDescribedByIds)(id)
|
|
3590
|
-
}
|
|
3591
|
-
),
|
|
3592
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { children: option.label })
|
|
3593
|
-
] });
|
|
3594
|
-
return inline ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("label", { className: `checkbox-inline ${disabledCls}`, children: checkbox }, index) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: `checkbox ${disabledCls}`, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("label", { children: checkbox }) }, index);
|
|
3595
|
-
}) });
|
|
3596
|
-
}
|
|
3597
|
-
var CheckboxesWidget_default = CheckboxesWidget;
|
|
3598
|
-
|
|
3599
3599
|
// src/components/widgets/ColorWidget.tsx
|
|
3600
3600
|
var import_utils36 = require("@rjsf/utils");
|
|
3601
3601
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
@@ -3605,34 +3605,34 @@ function ColorWidget(props) {
|
|
|
3605
3605
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(BaseInputTemplate2, { type: "color", ...props, disabled: disabled || readonly });
|
|
3606
3606
|
}
|
|
3607
3607
|
|
|
3608
|
-
// src/components/widgets/
|
|
3609
|
-
var import_react15 = require("react");
|
|
3608
|
+
// src/components/widgets/DateTimeWidget.tsx
|
|
3610
3609
|
var import_utils37 = require("@rjsf/utils");
|
|
3611
3610
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3612
|
-
function DateWidget(props) {
|
|
3613
|
-
const { onChange, options, registry } = props;
|
|
3614
|
-
const BaseInputTemplate2 = (0, import_utils37.getTemplate)("BaseInputTemplate", registry, options);
|
|
3615
|
-
const handleChange = (0, import_react15.useCallback)((value) => onChange(value || void 0), [onChange]);
|
|
3616
|
-
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(BaseInputTemplate2, { type: "date", ...props, onChange: handleChange });
|
|
3617
|
-
}
|
|
3618
|
-
|
|
3619
|
-
// src/components/widgets/DateTimeWidget.tsx
|
|
3620
|
-
var import_utils38 = require("@rjsf/utils");
|
|
3621
|
-
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3622
3611
|
function DateTimeWidget(props) {
|
|
3623
3612
|
const { onChange, value, options, registry } = props;
|
|
3624
|
-
const BaseInputTemplate2 = (0,
|
|
3625
|
-
return /* @__PURE__ */ (0,
|
|
3613
|
+
const BaseInputTemplate2 = (0, import_utils37.getTemplate)("BaseInputTemplate", registry, options);
|
|
3614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3626
3615
|
BaseInputTemplate2,
|
|
3627
3616
|
{
|
|
3628
3617
|
type: "datetime-local",
|
|
3629
3618
|
...props,
|
|
3630
|
-
value: (0,
|
|
3631
|
-
onChange: (value2) => onChange((0,
|
|
3619
|
+
value: (0, import_utils37.utcToLocal)(value),
|
|
3620
|
+
onChange: (value2) => onChange((0, import_utils37.localToUTC)(value2))
|
|
3632
3621
|
}
|
|
3633
3622
|
);
|
|
3634
3623
|
}
|
|
3635
3624
|
|
|
3625
|
+
// src/components/widgets/DateWidget.tsx
|
|
3626
|
+
var import_react17 = require("react");
|
|
3627
|
+
var import_utils38 = require("@rjsf/utils");
|
|
3628
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3629
|
+
function DateWidget(props) {
|
|
3630
|
+
const { onChange, options, registry } = props;
|
|
3631
|
+
const BaseInputTemplate2 = (0, import_utils38.getTemplate)("BaseInputTemplate", registry, options);
|
|
3632
|
+
const handleChange = (0, import_react17.useCallback)((value) => onChange(value || void 0), [onChange]);
|
|
3633
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(BaseInputTemplate2, { type: "date", ...props, onChange: handleChange });
|
|
3634
|
+
}
|
|
3635
|
+
|
|
3636
3636
|
// src/components/widgets/EmailWidget.tsx
|
|
3637
3637
|
var import_utils39 = require("@rjsf/utils");
|
|
3638
3638
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
@@ -3644,7 +3644,7 @@ function EmailWidget(props) {
|
|
|
3644
3644
|
|
|
3645
3645
|
// src/components/widgets/FileWidget.tsx
|
|
3646
3646
|
var import_utils40 = require("@rjsf/utils");
|
|
3647
|
-
var
|
|
3647
|
+
var import_markdown_to_jsx3 = require("markdown-to-jsx");
|
|
3648
3648
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3649
3649
|
function FileInfoPreview({
|
|
3650
3650
|
fileInfo,
|
|
@@ -3679,7 +3679,7 @@ function FilesInfo({
|
|
|
3679
3679
|
const { name, size, type } = fileInfo;
|
|
3680
3680
|
const handleRemove = () => onRemove(key);
|
|
3681
3681
|
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("li", { children: [
|
|
3682
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3682
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_markdown_to_jsx3.Markdown, { children: translateString(import_utils40.TranslatableString.FilesInfo, [name, type, String(size)]) }),
|
|
3683
3683
|
preview && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FileInfoPreview, { fileInfo, registry }),
|
|
3684
3684
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(RemoveButton2, { onClick: handleRemove, registry })
|
|
3685
3685
|
] }, key);
|
|
@@ -3691,7 +3691,7 @@ function FileWidget(props) {
|
|
|
3691
3691
|
const BaseInputTemplate2 = (0, import_utils40.getTemplate)("BaseInputTemplate", registry, options);
|
|
3692
3692
|
const handleOnChangeEvent = (event) => {
|
|
3693
3693
|
if (event.target.files) {
|
|
3694
|
-
handleChange(event.target.files);
|
|
3694
|
+
void handleChange(event.target.files);
|
|
3695
3695
|
}
|
|
3696
3696
|
};
|
|
3697
3697
|
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { children: [
|
|
@@ -3742,7 +3742,7 @@ function PasswordWidget(props) {
|
|
|
3742
3742
|
}
|
|
3743
3743
|
|
|
3744
3744
|
// src/components/widgets/RadioWidget.tsx
|
|
3745
|
-
var
|
|
3745
|
+
var import_react18 = require("react");
|
|
3746
3746
|
var import_utils42 = require("@rjsf/utils");
|
|
3747
3747
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3748
3748
|
function RadioWidget({
|
|
@@ -3760,11 +3760,11 @@ function RadioWidget({
|
|
|
3760
3760
|
}) {
|
|
3761
3761
|
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
3762
3762
|
const optionValueFormat = (0, import_utils42.getOptionValueFormat)(options);
|
|
3763
|
-
const handleBlur = (0,
|
|
3763
|
+
const handleBlur = (0, import_react18.useCallback)(
|
|
3764
3764
|
({ target }) => onBlur(id, (0, import_utils42.enumOptionValueDecoder)(target && target.value, enumOptions, optionValueFormat, emptyValue)),
|
|
3765
3765
|
[onBlur, enumOptions, emptyValue, id, optionValueFormat]
|
|
3766
3766
|
);
|
|
3767
|
-
const handleFocus = (0,
|
|
3767
|
+
const handleFocus = (0, import_react18.useCallback)(
|
|
3768
3768
|
({ target }) => onFocus(id, (0, import_utils42.enumOptionValueDecoder)(target && target.value, enumOptions, optionValueFormat, emptyValue)),
|
|
3769
3769
|
[onFocus, enumOptions, emptyValue, id, optionValueFormat]
|
|
3770
3770
|
);
|
|
@@ -3814,7 +3814,7 @@ function RangeWidget(props) {
|
|
|
3814
3814
|
}
|
|
3815
3815
|
|
|
3816
3816
|
// src/components/widgets/RatingWidget.tsx
|
|
3817
|
-
var
|
|
3817
|
+
var import_react19 = require("react");
|
|
3818
3818
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3819
3819
|
function RatingWidget({
|
|
3820
3820
|
id,
|
|
@@ -3833,7 +3833,7 @@ function RatingWidget({
|
|
|
3833
3833
|
const { stars = 5, shape = "star" } = options;
|
|
3834
3834
|
const numStars = schema.maximum ? Math.min(schema.maximum, 5) : Math.min(Math.max(stars, 1), 5);
|
|
3835
3835
|
const min = schema.minimum || 0;
|
|
3836
|
-
const handleStarClick = (0,
|
|
3836
|
+
const handleStarClick = (0, import_react19.useCallback)(
|
|
3837
3837
|
(starValue) => {
|
|
3838
3838
|
if (!disabled && !readonly) {
|
|
3839
3839
|
onChange(starValue);
|
|
@@ -3841,7 +3841,7 @@ function RatingWidget({
|
|
|
3841
3841
|
},
|
|
3842
3842
|
[onChange, disabled, readonly]
|
|
3843
3843
|
);
|
|
3844
|
-
const handleFocus = (0,
|
|
3844
|
+
const handleFocus = (0, import_react19.useCallback)(
|
|
3845
3845
|
(event) => {
|
|
3846
3846
|
if (onFocus) {
|
|
3847
3847
|
const starValue = Number(event.target.dataset.value);
|
|
@@ -3850,7 +3850,7 @@ function RatingWidget({
|
|
|
3850
3850
|
},
|
|
3851
3851
|
[onFocus, id]
|
|
3852
3852
|
);
|
|
3853
|
-
const handleBlur = (0,
|
|
3853
|
+
const handleBlur = (0, import_react19.useCallback)(
|
|
3854
3854
|
(event) => {
|
|
3855
3855
|
if (onBlur) {
|
|
3856
3856
|
const starValue = Number(event.target.dataset.value);
|
|
@@ -3918,7 +3918,7 @@ function RatingWidget({
|
|
|
3918
3918
|
}
|
|
3919
3919
|
|
|
3920
3920
|
// src/components/widgets/SelectWidget.tsx
|
|
3921
|
-
var
|
|
3921
|
+
var import_react20 = require("react");
|
|
3922
3922
|
var import_utils43 = require("@rjsf/utils");
|
|
3923
3923
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3924
3924
|
function getValue(event, multiple) {
|
|
@@ -3946,21 +3946,21 @@ function SelectWidget({
|
|
|
3946
3946
|
const { enumOptions, enumDisabled, emptyValue: optEmptyVal } = options;
|
|
3947
3947
|
const emptyValue = multiple ? [] : "";
|
|
3948
3948
|
const optionValueFormat = (0, import_utils43.getOptionValueFormat)(options);
|
|
3949
|
-
const handleFocus = (0,
|
|
3949
|
+
const handleFocus = (0, import_react20.useCallback)(
|
|
3950
3950
|
(event) => {
|
|
3951
3951
|
const newValue = getValue(event, multiple);
|
|
3952
3952
|
return onFocus(id, (0, import_utils43.enumOptionValueDecoder)(newValue, enumOptions, optionValueFormat, optEmptyVal));
|
|
3953
3953
|
},
|
|
3954
3954
|
[onFocus, id, multiple, enumOptions, optEmptyVal, optionValueFormat]
|
|
3955
3955
|
);
|
|
3956
|
-
const handleBlur = (0,
|
|
3956
|
+
const handleBlur = (0, import_react20.useCallback)(
|
|
3957
3957
|
(event) => {
|
|
3958
3958
|
const newValue = getValue(event, multiple);
|
|
3959
3959
|
return onBlur(id, (0, import_utils43.enumOptionValueDecoder)(newValue, enumOptions, optionValueFormat, optEmptyVal));
|
|
3960
3960
|
},
|
|
3961
3961
|
[onBlur, id, multiple, enumOptions, optEmptyVal, optionValueFormat]
|
|
3962
3962
|
);
|
|
3963
|
-
const handleChange = (0,
|
|
3963
|
+
const handleChange = (0, import_react20.useCallback)(
|
|
3964
3964
|
(event) => {
|
|
3965
3965
|
const newValue = getValue(event, multiple);
|
|
3966
3966
|
return onChange((0, import_utils43.enumOptionValueDecoder)(newValue, enumOptions, optionValueFormat, optEmptyVal));
|
|
@@ -3998,7 +3998,7 @@ function SelectWidget({
|
|
|
3998
3998
|
var SelectWidget_default = SelectWidget;
|
|
3999
3999
|
|
|
4000
4000
|
// src/components/widgets/TextareaWidget.tsx
|
|
4001
|
-
var
|
|
4001
|
+
var import_react21 = require("react");
|
|
4002
4002
|
var import_utils44 = require("@rjsf/utils");
|
|
4003
4003
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4004
4004
|
function TextareaWidget({
|
|
@@ -4015,15 +4015,15 @@ function TextareaWidget({
|
|
|
4015
4015
|
onFocus,
|
|
4016
4016
|
htmlName
|
|
4017
4017
|
}) {
|
|
4018
|
-
const handleChange = (0,
|
|
4018
|
+
const handleChange = (0, import_react21.useCallback)(
|
|
4019
4019
|
({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2),
|
|
4020
4020
|
[onChange, options.emptyValue]
|
|
4021
4021
|
);
|
|
4022
|
-
const handleBlur = (0,
|
|
4022
|
+
const handleBlur = (0, import_react21.useCallback)(
|
|
4023
4023
|
({ target }) => onBlur(id, target && target.value),
|
|
4024
4024
|
[onBlur, id]
|
|
4025
4025
|
);
|
|
4026
|
-
const handleFocus = (0,
|
|
4026
|
+
const handleFocus = (0, import_react21.useCallback)(
|
|
4027
4027
|
({ target }) => onFocus(id, target && target.value),
|
|
4028
4028
|
[id, onFocus]
|
|
4029
4029
|
);
|
|
@@ -4059,32 +4059,32 @@ function TextWidget(props) {
|
|
|
4059
4059
|
}
|
|
4060
4060
|
|
|
4061
4061
|
// src/components/widgets/TimeWidget.tsx
|
|
4062
|
-
var
|
|
4062
|
+
var import_react22 = require("react");
|
|
4063
4063
|
var import_utils46 = require("@rjsf/utils");
|
|
4064
4064
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4065
4065
|
function TimeWidget(props) {
|
|
4066
4066
|
const { onChange, options, registry } = props;
|
|
4067
4067
|
const BaseInputTemplate2 = (0, import_utils46.getTemplate)("BaseInputTemplate", registry, options);
|
|
4068
|
-
const handleChange = (0,
|
|
4068
|
+
const handleChange = (0, import_react22.useCallback)((value) => onChange(value ? `${value}:00` : void 0), [onChange]);
|
|
4069
4069
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(BaseInputTemplate2, { type: "time", ...props, onChange: handleChange });
|
|
4070
4070
|
}
|
|
4071
4071
|
|
|
4072
|
-
// src/components/widgets/
|
|
4072
|
+
// src/components/widgets/UpDownWidget.tsx
|
|
4073
4073
|
var import_utils47 = require("@rjsf/utils");
|
|
4074
4074
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4075
|
-
function
|
|
4075
|
+
function UpDownWidget(props) {
|
|
4076
4076
|
const { options, registry } = props;
|
|
4077
4077
|
const BaseInputTemplate2 = (0, import_utils47.getTemplate)("BaseInputTemplate", registry, options);
|
|
4078
|
-
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(BaseInputTemplate2, { type: "
|
|
4078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(BaseInputTemplate2, { type: "number", ...props });
|
|
4079
4079
|
}
|
|
4080
4080
|
|
|
4081
|
-
// src/components/widgets/
|
|
4081
|
+
// src/components/widgets/URLWidget.tsx
|
|
4082
4082
|
var import_utils48 = require("@rjsf/utils");
|
|
4083
4083
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4084
|
-
function
|
|
4084
|
+
function URLWidget(props) {
|
|
4085
4085
|
const { options, registry } = props;
|
|
4086
4086
|
const BaseInputTemplate2 = (0, import_utils48.getTemplate)("BaseInputTemplate", registry, options);
|
|
4087
|
-
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(BaseInputTemplate2, { type: "
|
|
4087
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(BaseInputTemplate2, { type: "url", ...props });
|
|
4088
4088
|
}
|
|
4089
4089
|
|
|
4090
4090
|
// src/components/widgets/index.ts
|
|
@@ -4139,7 +4139,7 @@ function toIChangeEvent(state, status) {
|
|
|
4139
4139
|
...status !== void 0 && { status }
|
|
4140
4140
|
};
|
|
4141
4141
|
}
|
|
4142
|
-
var Form = class extends
|
|
4142
|
+
var Form = class extends import_react23.Component {
|
|
4143
4143
|
/** The ref used to hold the `form` element, this needs to be `any` because `tagName` or `_internalFormWrapper` can
|
|
4144
4144
|
* provide any possible type here
|
|
4145
4145
|
*/
|
|
@@ -4199,7 +4199,7 @@ var Form = class extends import_react21.Component {
|
|
|
4199
4199
|
if (onChange && !(0, import_utils50.deepEquals)(this.state.formData, formData)) {
|
|
4200
4200
|
onChange(toIChangeEvent(this.state));
|
|
4201
4201
|
}
|
|
4202
|
-
this.formElement = (0,
|
|
4202
|
+
this.formElement = (0, import_react23.createRef)();
|
|
4203
4203
|
}
|
|
4204
4204
|
/**
|
|
4205
4205
|
* `getSnapshotBeforeUpdate` is a React lifecycle method that is invoked right before the most recently rendered
|
|
@@ -4568,7 +4568,7 @@ var Form = class extends import_react21.Component {
|
|
|
4568
4568
|
this._isProcessingUserChange = true;
|
|
4569
4569
|
const { newValue, path, id } = this.pendingChanges[0];
|
|
4570
4570
|
const { newErrorSchema } = this.pendingChanges[0];
|
|
4571
|
-
const { extraErrors, omitExtraData, liveOmit, noValidate, liveValidate, onChange
|
|
4571
|
+
const { extraErrors, omitExtraData, liveOmit, noValidate, liveValidate, onChange } = this.props;
|
|
4572
4572
|
const { formData: oldFormData, schemaUtils, schema, fieldPathId, schemaValidationErrorSchema, errors } = this.state;
|
|
4573
4573
|
let { customErrors } = this.state;
|
|
4574
4574
|
let mergeBaseErrorSchema = schemaValidationErrorSchema;
|
|
@@ -4617,18 +4617,6 @@ var Form = class extends import_react21.Component {
|
|
|
4617
4617
|
formData: newFormData
|
|
4618
4618
|
};
|
|
4619
4619
|
}
|
|
4620
|
-
if (removeEmptyOptionalObjects) {
|
|
4621
|
-
newFormData = (0, import_utils50.removeOptionalEmptyObjects)(
|
|
4622
|
-
schemaUtils.getValidator(),
|
|
4623
|
-
schema,
|
|
4624
|
-
schemaUtils.getRootSchema(),
|
|
4625
|
-
newFormData
|
|
4626
|
-
);
|
|
4627
|
-
state = {
|
|
4628
|
-
...state,
|
|
4629
|
-
formData: newFormData
|
|
4630
|
-
};
|
|
4631
|
-
}
|
|
4632
4620
|
if (newErrorSchema) {
|
|
4633
4621
|
const oldValidationError = !isRootPath ? (0, import_get5.default)(schemaValidationErrorSchema, path) : schemaValidationErrorSchema;
|
|
4634
4622
|
if (!(0, import_isEmpty4.default)(oldValidationError)) {
|
|
@@ -4730,33 +4718,24 @@ var Form = class extends import_react21.Component {
|
|
|
4730
4718
|
* @param data - The data associated with the field that was blurred
|
|
4731
4719
|
*/
|
|
4732
4720
|
onBlur = (id, data) => {
|
|
4733
|
-
const { onBlur, omitExtraData, liveOmit, liveValidate
|
|
4721
|
+
const { onBlur, omitExtraData, liveOmit, liveValidate } = this.props;
|
|
4734
4722
|
if (onBlur) {
|
|
4735
4723
|
onBlur(id, data);
|
|
4736
4724
|
}
|
|
4737
4725
|
if (omitExtraData === true && liveOmit === "onBlur" || liveValidate === "onBlur") {
|
|
4738
4726
|
const { onChange, extraErrors } = this.props;
|
|
4739
|
-
const { formData
|
|
4727
|
+
const { formData } = this.state;
|
|
4740
4728
|
let newFormData = formData;
|
|
4741
4729
|
let state = { formData: newFormData };
|
|
4742
4730
|
if (omitExtraData === true && liveOmit === "onBlur") {
|
|
4743
4731
|
newFormData = this.omitExtraData(formData);
|
|
4744
4732
|
state = { formData: newFormData };
|
|
4745
4733
|
}
|
|
4746
|
-
if (removeEmptyOptionalObjects) {
|
|
4747
|
-
newFormData = (0, import_utils50.removeOptionalEmptyObjects)(
|
|
4748
|
-
schemaUtils.getValidator(),
|
|
4749
|
-
schema,
|
|
4750
|
-
schemaUtils.getRootSchema(),
|
|
4751
|
-
newFormData
|
|
4752
|
-
);
|
|
4753
|
-
state = { ...state, formData: newFormData };
|
|
4754
|
-
}
|
|
4755
4734
|
if (liveValidate === "onBlur") {
|
|
4756
|
-
const { schema
|
|
4735
|
+
const { schema, schemaUtils, errorSchema, customErrors, retrievedSchema } = this.state;
|
|
4757
4736
|
const liveValidation = this.liveValidate(
|
|
4758
|
-
|
|
4759
|
-
|
|
4737
|
+
schema,
|
|
4738
|
+
schemaUtils,
|
|
4760
4739
|
errorSchema,
|
|
4761
4740
|
newFormData,
|
|
4762
4741
|
extraErrors,
|
|
@@ -4803,20 +4782,11 @@ var Form = class extends import_react21.Component {
|
|
|
4803
4782
|
return;
|
|
4804
4783
|
}
|
|
4805
4784
|
event.persist();
|
|
4806
|
-
const { omitExtraData, extraErrors, noValidate, onSubmit
|
|
4785
|
+
const { omitExtraData, extraErrors, noValidate, onSubmit } = this.props;
|
|
4807
4786
|
let { formData: newFormData } = this.state;
|
|
4808
4787
|
if (omitExtraData === true) {
|
|
4809
4788
|
newFormData = this.omitExtraData(newFormData);
|
|
4810
4789
|
}
|
|
4811
|
-
if (removeEmptyOptionalObjects) {
|
|
4812
|
-
const { schemaUtils, schema } = this.state;
|
|
4813
|
-
newFormData = (0, import_utils50.removeOptionalEmptyObjects)(
|
|
4814
|
-
schemaUtils.getValidator(),
|
|
4815
|
-
schema,
|
|
4816
|
-
schemaUtils.getRootSchema(),
|
|
4817
|
-
newFormData
|
|
4818
|
-
);
|
|
4819
|
-
}
|
|
4820
4790
|
if (noValidate || this.validateFormWithFormData(newFormData)) {
|
|
4821
4791
|
const errorSchema = extraErrors || {};
|
|
4822
4792
|
const errors = extraErrors ? (0, import_utils50.toErrorList)(extraErrors) : [];
|
|
@@ -4981,20 +4951,11 @@ var Form = class extends import_react21.Component {
|
|
|
4981
4951
|
* @returns - True if the form is valid, false otherwise.
|
|
4982
4952
|
*/
|
|
4983
4953
|
validateForm() {
|
|
4984
|
-
const { omitExtraData
|
|
4954
|
+
const { omitExtraData } = this.props;
|
|
4985
4955
|
let { formData: newFormData } = this.state;
|
|
4986
4956
|
if (omitExtraData === true) {
|
|
4987
4957
|
newFormData = this.omitExtraData(newFormData);
|
|
4988
4958
|
}
|
|
4989
|
-
if (removeEmptyOptionalObjects) {
|
|
4990
|
-
const { schemaUtils, schema } = this.state;
|
|
4991
|
-
newFormData = (0, import_utils50.removeOptionalEmptyObjects)(
|
|
4992
|
-
schemaUtils.getValidator(),
|
|
4993
|
-
schema,
|
|
4994
|
-
schemaUtils.getRootSchema(),
|
|
4995
|
-
newFormData
|
|
4996
|
-
);
|
|
4997
|
-
}
|
|
4998
4959
|
return this.validateFormWithFormData(newFormData);
|
|
4999
4960
|
}
|
|
5000
4961
|
/** Renders the `Form` fields inside the <form> | `tagName` or `_internalFormWrapper`, rendering any errors if
|
|
@@ -5072,11 +5033,33 @@ var Form = class extends import_react21.Component {
|
|
|
5072
5033
|
}
|
|
5073
5034
|
};
|
|
5074
5035
|
|
|
5036
|
+
// src/getTestRegistry.tsx
|
|
5037
|
+
var import_utils51 = require("@rjsf/utils");
|
|
5038
|
+
var import_validator_ajv8 = __toESM(require("@rjsf/validator-ajv8"), 1);
|
|
5039
|
+
function getTestRegistry(rootSchema, fields2 = {}, templates2 = {}, widgets2 = {}, formContext = {}, globalFormOptions = {
|
|
5040
|
+
idPrefix: import_utils51.DEFAULT_ID_PREFIX,
|
|
5041
|
+
idSeparator: import_utils51.DEFAULT_ID_SEPARATOR,
|
|
5042
|
+
useFallbackUiForUnsupportedType: false
|
|
5043
|
+
}) {
|
|
5044
|
+
const defaults = getDefaultRegistry();
|
|
5045
|
+
const schemaUtils = (0, import_utils51.createSchemaUtils)(import_validator_ajv8.default, rootSchema);
|
|
5046
|
+
return {
|
|
5047
|
+
fields: { ...defaults.fields, ...fields2 },
|
|
5048
|
+
templates: { ...defaults.templates, ...templates2 },
|
|
5049
|
+
widgets: { ...defaults.widgets, ...widgets2 },
|
|
5050
|
+
formContext,
|
|
5051
|
+
rootSchema,
|
|
5052
|
+
schemaUtils,
|
|
5053
|
+
translateString: import_utils51.englishStringTranslator,
|
|
5054
|
+
globalFormOptions
|
|
5055
|
+
};
|
|
5056
|
+
}
|
|
5057
|
+
|
|
5075
5058
|
// src/withTheme.tsx
|
|
5076
|
-
var
|
|
5059
|
+
var import_react24 = require("react");
|
|
5077
5060
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
5078
5061
|
function withTheme(themeProps) {
|
|
5079
|
-
return (0,
|
|
5062
|
+
return (0, import_react24.forwardRef)(
|
|
5080
5063
|
({ fields: fields2, widgets: widgets2, templates: templates2, ...directProps }, ref) => {
|
|
5081
5064
|
fields2 = { ...themeProps?.fields, ...fields2 };
|
|
5082
5065
|
widgets2 = { ...themeProps?.widgets, ...widgets2 };
|
|
@@ -5103,28 +5086,6 @@ function withTheme(themeProps) {
|
|
|
5103
5086
|
);
|
|
5104
5087
|
}
|
|
5105
5088
|
|
|
5106
|
-
// src/getTestRegistry.tsx
|
|
5107
|
-
var import_utils51 = require("@rjsf/utils");
|
|
5108
|
-
var import_validator_ajv8 = __toESM(require("@rjsf/validator-ajv8"), 1);
|
|
5109
|
-
function getTestRegistry(rootSchema, fields2 = {}, templates2 = {}, widgets2 = {}, formContext = {}, globalFormOptions = {
|
|
5110
|
-
idPrefix: import_utils51.DEFAULT_ID_PREFIX,
|
|
5111
|
-
idSeparator: import_utils51.DEFAULT_ID_SEPARATOR,
|
|
5112
|
-
useFallbackUiForUnsupportedType: false
|
|
5113
|
-
}) {
|
|
5114
|
-
const defaults = getDefaultRegistry();
|
|
5115
|
-
const schemaUtils = (0, import_utils51.createSchemaUtils)(import_validator_ajv8.default, rootSchema);
|
|
5116
|
-
return {
|
|
5117
|
-
fields: { ...defaults.fields, ...fields2 },
|
|
5118
|
-
templates: { ...defaults.templates, ...templates2 },
|
|
5119
|
-
widgets: { ...defaults.widgets, ...widgets2 },
|
|
5120
|
-
formContext,
|
|
5121
|
-
rootSchema,
|
|
5122
|
-
schemaUtils,
|
|
5123
|
-
translateString: import_utils51.englishStringTranslator,
|
|
5124
|
-
globalFormOptions
|
|
5125
|
-
};
|
|
5126
|
-
}
|
|
5127
|
-
|
|
5128
5089
|
// src/index.ts
|
|
5129
5090
|
var index_default = Form;
|
|
5130
5091
|
//# sourceMappingURL=index.cjs.map
|