@rjsf/mantine 6.0.0-beta.21 → 6.0.0-beta.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +71 -75
- package/dist/index.cjs.map +3 -3
- package/dist/mantine.esm.js +68 -72
- package/dist/mantine.esm.js.map +3 -3
- package/dist/mantine.umd.js +20 -23
- package/lib/templates/ArrayFieldItemTemplate.d.ts +3 -3
- package/lib/templates/ArrayFieldItemTemplate.js +1 -1
- package/lib/templates/ArrayFieldItemTemplate.js.map +1 -1
- package/lib/templates/ArrayFieldTemplate.d.ts +1 -1
- package/lib/templates/ArrayFieldTemplate.js +2 -3
- package/lib/templates/ArrayFieldTemplate.js.map +1 -1
- package/lib/templates/BaseInputTemplate.js +2 -2
- package/lib/templates/BaseInputTemplate.js.map +1 -1
- package/lib/templates/ObjectFieldTemplate.js +2 -2
- package/lib/templates/ObjectFieldTemplate.js.map +1 -1
- package/lib/templates/WrapIfAdditionalTemplate.js +2 -4
- package/lib/templates/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/widgets/CheckboxWidget.js +2 -2
- package/lib/widgets/CheckboxWidget.js.map +1 -1
- package/lib/widgets/CheckboxesWidget.js +2 -2
- package/lib/widgets/CheckboxesWidget.js.map +1 -1
- package/lib/widgets/RadioWidget.js +2 -2
- package/lib/widgets/RadioWidget.js.map +1 -1
- package/lib/widgets/SelectWidget.js +2 -2
- package/lib/widgets/SelectWidget.js.map +1 -1
- package/lib/widgets/TextareaWidget.js +2 -2
- package/lib/widgets/TextareaWidget.js.map +1 -1
- package/package.json +7 -7
- package/src/templates/ArrayFieldItemTemplate.tsx +3 -3
- package/src/templates/ArrayFieldTemplate.tsx +2 -10
- package/src/templates/BaseInputTemplate.tsx +3 -2
- package/src/templates/ObjectFieldTemplate.tsx +2 -2
- package/src/templates/WrapIfAdditionalTemplate.tsx +4 -10
- package/src/widgets/CheckboxWidget.tsx +2 -1
- package/src/widgets/CheckboxesWidget.tsx +2 -1
- package/src/widgets/RadioWidget.tsx +2 -1
- package/src/widgets/SelectWidget.tsx +2 -1
- package/src/widgets/TextareaWidget.tsx +2 -1
package/dist/index.cjs
CHANGED
|
@@ -89,11 +89,6 @@ function ArrayFieldTemplate(props) {
|
|
|
89
89
|
registry,
|
|
90
90
|
uiOptions
|
|
91
91
|
);
|
|
92
|
-
const ArrayFieldItemTemplate2 = (0, import_utils2.getTemplate)(
|
|
93
|
-
"ArrayFieldItemTemplate",
|
|
94
|
-
registry,
|
|
95
|
-
uiOptions
|
|
96
|
-
);
|
|
97
92
|
const ArrayFieldTitleTemplate2 = (0, import_utils2.getTemplate)(
|
|
98
93
|
"ArrayFieldTitleTemplate",
|
|
99
94
|
registry,
|
|
@@ -128,7 +123,7 @@ function ArrayFieldTemplate(props) {
|
|
|
128
123
|
),
|
|
129
124
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.Box, { className: "row rjsf-array-item-list", children: [
|
|
130
125
|
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
131
|
-
items
|
|
126
|
+
items
|
|
132
127
|
] }),
|
|
133
128
|
canAdd && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.Group, { justify: "flex-end", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
134
129
|
AddButton2,
|
|
@@ -205,6 +200,7 @@ var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
|
205
200
|
function BaseInputTemplate(props) {
|
|
206
201
|
const {
|
|
207
202
|
id,
|
|
203
|
+
htmlName,
|
|
208
204
|
type,
|
|
209
205
|
schema,
|
|
210
206
|
value,
|
|
@@ -250,7 +246,7 @@ function BaseInputTemplate(props) {
|
|
|
250
246
|
import_core4.NumberInput,
|
|
251
247
|
{
|
|
252
248
|
id,
|
|
253
|
-
name: id,
|
|
249
|
+
name: htmlName || id,
|
|
254
250
|
label: (0, import_utils4.labelValue)(label || void 0, hideLabel, false),
|
|
255
251
|
required,
|
|
256
252
|
autoFocus: autofocus,
|
|
@@ -272,7 +268,7 @@ function BaseInputTemplate(props) {
|
|
|
272
268
|
import_core4.TextInput,
|
|
273
269
|
{
|
|
274
270
|
id,
|
|
275
|
-
name: id,
|
|
271
|
+
name: htmlName || id,
|
|
276
272
|
label: (0, import_utils4.labelValue)(label || void 0, hideLabel, false),
|
|
277
273
|
required,
|
|
278
274
|
autoFocus: autofocus,
|
|
@@ -680,7 +676,7 @@ function ObjectFieldTemplate(props) {
|
|
|
680
676
|
disabled,
|
|
681
677
|
properties,
|
|
682
678
|
optionalDataControl,
|
|
683
|
-
|
|
679
|
+
onAddProperty,
|
|
684
680
|
readonly,
|
|
685
681
|
required,
|
|
686
682
|
schema,
|
|
@@ -744,7 +740,7 @@ function ObjectFieldTemplate(props) {
|
|
|
744
740
|
{
|
|
745
741
|
id: (0, import_utils13.buttonId)(fieldPathId, "add"),
|
|
746
742
|
disabled: disabled || readonly,
|
|
747
|
-
onClick:
|
|
743
|
+
onClick: onAddProperty,
|
|
748
744
|
className: "rjsf-object-property-expand",
|
|
749
745
|
uiSchema,
|
|
750
746
|
registry
|
|
@@ -801,7 +797,6 @@ function TitleField(props) {
|
|
|
801
797
|
}
|
|
802
798
|
|
|
803
799
|
// src/templates/WrapIfAdditionalTemplate.tsx
|
|
804
|
-
var import_react2 = require("react");
|
|
805
800
|
var import_utils14 = require("@rjsf/utils");
|
|
806
801
|
var import_core16 = require("@mantine/core");
|
|
807
802
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
@@ -816,8 +811,8 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
816
811
|
disabled,
|
|
817
812
|
schema,
|
|
818
813
|
uiSchema,
|
|
819
|
-
|
|
820
|
-
|
|
814
|
+
onKeyRenameBlur,
|
|
815
|
+
onRemoveProperty,
|
|
821
816
|
registry,
|
|
822
817
|
children
|
|
823
818
|
} = props;
|
|
@@ -825,10 +820,6 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
825
820
|
const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
|
|
826
821
|
const keyLabel = translateString(import_utils14.TranslatableString.KeyLabel, [label]);
|
|
827
822
|
const additional = import_utils14.ADDITIONAL_PROPERTY_FLAG in schema;
|
|
828
|
-
const handleBlur = (0, import_react2.useCallback)(
|
|
829
|
-
({ target }) => onKeyChange(target && target.value),
|
|
830
|
-
[onKeyChange]
|
|
831
|
-
);
|
|
832
823
|
if (!additional) {
|
|
833
824
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: classNames, style, children });
|
|
834
825
|
}
|
|
@@ -849,7 +840,7 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
849
840
|
disabled: disabled || readonly,
|
|
850
841
|
id: `${id}-key`,
|
|
851
842
|
name: `${id}-key`,
|
|
852
|
-
onBlur: !readonly ?
|
|
843
|
+
onBlur: !readonly ? onKeyRenameBlur : void 0
|
|
853
844
|
}
|
|
854
845
|
) }) }),
|
|
855
846
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core16.Grid.Col, { span: 6, className: "form-additional", children })
|
|
@@ -861,7 +852,7 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
861
852
|
iconType: "sm",
|
|
862
853
|
className: "rjsf-array-item-remove",
|
|
863
854
|
disabled: disabled || readonly,
|
|
864
|
-
onClick:
|
|
855
|
+
onClick: onRemoveProperty,
|
|
865
856
|
uiSchema: buttonUiOptions,
|
|
866
857
|
registry
|
|
867
858
|
}
|
|
@@ -907,7 +898,7 @@ var import_dayjs2 = __toESM(require("dayjs"), 1);
|
|
|
907
898
|
var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat"), 1);
|
|
908
899
|
|
|
909
900
|
// src/widgets/DateTime/AltDateWidget.tsx
|
|
910
|
-
var
|
|
901
|
+
var import_react2 = require("react");
|
|
911
902
|
var import_utils15 = require("@rjsf/utils");
|
|
912
903
|
var import_core18 = require("@mantine/core");
|
|
913
904
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
@@ -930,11 +921,11 @@ function AltDateWidget(props) {
|
|
|
930
921
|
registry
|
|
931
922
|
} = props;
|
|
932
923
|
const { translateString } = registry;
|
|
933
|
-
const [state, setState] = (0,
|
|
934
|
-
(0,
|
|
924
|
+
const [state, setState] = (0, import_react2.useState)((0, import_utils15.parseDateString)(value, showTime));
|
|
925
|
+
(0, import_react2.useEffect)(() => {
|
|
935
926
|
setState((0, import_utils15.parseDateString)(value, showTime));
|
|
936
927
|
}, [showTime, value]);
|
|
937
|
-
const handleChange = (0,
|
|
928
|
+
const handleChange = (0, import_react2.useCallback)(
|
|
938
929
|
(property, nextValue) => {
|
|
939
930
|
const nextState = {
|
|
940
931
|
...state,
|
|
@@ -948,13 +939,13 @@ function AltDateWidget(props) {
|
|
|
948
939
|
},
|
|
949
940
|
[state, onChange, showTime]
|
|
950
941
|
);
|
|
951
|
-
const handleSetNow = (0,
|
|
942
|
+
const handleSetNow = (0, import_react2.useCallback)(() => {
|
|
952
943
|
if (!disabled && !readonly) {
|
|
953
944
|
const nextState = (0, import_utils15.parseDateString)((/* @__PURE__ */ new Date()).toJSON(), showTime);
|
|
954
945
|
onChange((0, import_utils15.toDateString)(nextState, showTime));
|
|
955
946
|
}
|
|
956
947
|
}, [disabled, readonly, showTime, onChange]);
|
|
957
|
-
const handleClear = (0,
|
|
948
|
+
const handleClear = (0, import_react2.useCallback)(() => {
|
|
958
949
|
if (!disabled && !readonly) {
|
|
959
950
|
onChange("");
|
|
960
951
|
}
|
|
@@ -1010,7 +1001,7 @@ AltDateTimeWidget.defaultProps = {
|
|
|
1010
1001
|
};
|
|
1011
1002
|
|
|
1012
1003
|
// src/widgets/DateTime/DateTimeInput.tsx
|
|
1013
|
-
var
|
|
1004
|
+
var import_react3 = require("react");
|
|
1014
1005
|
var import_utils16 = require("@rjsf/utils");
|
|
1015
1006
|
var import_dayjs = __toESM(require("dayjs"), 1);
|
|
1016
1007
|
var import_dates = require("@mantine/dates");
|
|
@@ -1048,18 +1039,18 @@ function DateTimeInput(props) {
|
|
|
1048
1039
|
valueFormat,
|
|
1049
1040
|
displayFormat
|
|
1050
1041
|
} = props;
|
|
1051
|
-
const handleChange = (0,
|
|
1042
|
+
const handleChange = (0, import_react3.useCallback)(
|
|
1052
1043
|
(nextValue) => {
|
|
1053
1044
|
onChange(dateFormat(nextValue, valueFormat));
|
|
1054
1045
|
},
|
|
1055
1046
|
[onChange, valueFormat]
|
|
1056
1047
|
);
|
|
1057
|
-
const handleBlur = (0,
|
|
1048
|
+
const handleBlur = (0, import_react3.useCallback)(() => {
|
|
1058
1049
|
if (onBlur) {
|
|
1059
1050
|
onBlur(id, value);
|
|
1060
1051
|
}
|
|
1061
1052
|
}, [onBlur, id, value]);
|
|
1062
|
-
const handleFocus = (0,
|
|
1053
|
+
const handleFocus = (0, import_react3.useCallback)(() => {
|
|
1063
1054
|
if (onFocus) {
|
|
1064
1055
|
onFocus(id, value);
|
|
1065
1056
|
}
|
|
@@ -1120,7 +1111,7 @@ function DateTimeWidget(props) {
|
|
|
1120
1111
|
}
|
|
1121
1112
|
|
|
1122
1113
|
// src/widgets/DateTime/TimeWidget.tsx
|
|
1123
|
-
var
|
|
1114
|
+
var import_react4 = require("react");
|
|
1124
1115
|
var import_utils17 = require("@rjsf/utils");
|
|
1125
1116
|
var import_dates2 = require("@mantine/dates");
|
|
1126
1117
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
@@ -1143,13 +1134,13 @@ function TimeWidget(props) {
|
|
|
1143
1134
|
onFocus
|
|
1144
1135
|
} = props;
|
|
1145
1136
|
const emptyValue = options.emptyValue || "";
|
|
1146
|
-
const handleChange = (0,
|
|
1137
|
+
const handleChange = (0, import_react4.useCallback)(
|
|
1147
1138
|
(e) => {
|
|
1148
1139
|
onChange(e.target.value === "" ? emptyValue : e.target.value);
|
|
1149
1140
|
},
|
|
1150
1141
|
[onChange, emptyValue]
|
|
1151
1142
|
);
|
|
1152
|
-
const handleBlur = (0,
|
|
1143
|
+
const handleBlur = (0, import_react4.useCallback)(
|
|
1153
1144
|
({ target }) => {
|
|
1154
1145
|
if (onBlur) {
|
|
1155
1146
|
onBlur(id, target && target.value);
|
|
@@ -1157,7 +1148,7 @@ function TimeWidget(props) {
|
|
|
1157
1148
|
},
|
|
1158
1149
|
[onBlur, id]
|
|
1159
1150
|
);
|
|
1160
|
-
const handleFocus = (0,
|
|
1151
|
+
const handleFocus = (0, import_react4.useCallback)(
|
|
1161
1152
|
({ target }) => {
|
|
1162
1153
|
if (onFocus) {
|
|
1163
1154
|
onFocus(id, target && target.value);
|
|
@@ -1188,13 +1179,14 @@ function TimeWidget(props) {
|
|
|
1188
1179
|
}
|
|
1189
1180
|
|
|
1190
1181
|
// src/widgets/CheckboxesWidget.tsx
|
|
1191
|
-
var
|
|
1182
|
+
var import_react5 = require("react");
|
|
1192
1183
|
var import_utils18 = require("@rjsf/utils");
|
|
1193
1184
|
var import_core19 = require("@mantine/core");
|
|
1194
1185
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1195
1186
|
function CheckboxesWidget(props) {
|
|
1196
1187
|
const {
|
|
1197
1188
|
id,
|
|
1189
|
+
htmlName,
|
|
1198
1190
|
value,
|
|
1199
1191
|
required,
|
|
1200
1192
|
disabled,
|
|
@@ -1210,7 +1202,7 @@ function CheckboxesWidget(props) {
|
|
|
1210
1202
|
} = props;
|
|
1211
1203
|
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
1212
1204
|
const themeProps = cleanupOptions(options);
|
|
1213
|
-
const handleChange = (0,
|
|
1205
|
+
const handleChange = (0, import_react5.useCallback)(
|
|
1214
1206
|
(nextValue) => {
|
|
1215
1207
|
if (!disabled && !readonly && onChange) {
|
|
1216
1208
|
onChange((0, import_utils18.enumOptionsValueForIndex)(nextValue, enumOptions, emptyValue));
|
|
@@ -1218,7 +1210,7 @@ function CheckboxesWidget(props) {
|
|
|
1218
1210
|
},
|
|
1219
1211
|
[onChange, disabled, readonly, enumOptions, emptyValue]
|
|
1220
1212
|
);
|
|
1221
|
-
const handleBlur = (0,
|
|
1213
|
+
const handleBlur = (0, import_react5.useCallback)(
|
|
1222
1214
|
({ target }) => {
|
|
1223
1215
|
if (onBlur) {
|
|
1224
1216
|
onBlur(id, (0, import_utils18.enumOptionsValueForIndex)(target.value, enumOptions, emptyValue));
|
|
@@ -1226,7 +1218,7 @@ function CheckboxesWidget(props) {
|
|
|
1226
1218
|
},
|
|
1227
1219
|
[onBlur, id, enumOptions, emptyValue]
|
|
1228
1220
|
);
|
|
1229
|
-
const handleFocus = (0,
|
|
1221
|
+
const handleFocus = (0, import_react5.useCallback)(
|
|
1230
1222
|
({ target }) => {
|
|
1231
1223
|
if (onFocus) {
|
|
1232
1224
|
onFocus(id, (0, import_utils18.enumOptionsValueForIndex)(target.value, enumOptions, emptyValue));
|
|
@@ -1252,7 +1244,7 @@ function CheckboxesWidget(props) {
|
|
|
1252
1244
|
import_core19.Checkbox,
|
|
1253
1245
|
{
|
|
1254
1246
|
id: (0, import_utils18.optionId)(id, i),
|
|
1255
|
-
name: id,
|
|
1247
|
+
name: htmlName || id,
|
|
1256
1248
|
value: String(i),
|
|
1257
1249
|
label: option.label,
|
|
1258
1250
|
disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1,
|
|
@@ -1268,7 +1260,7 @@ function CheckboxesWidget(props) {
|
|
|
1268
1260
|
}
|
|
1269
1261
|
|
|
1270
1262
|
// src/widgets/CheckboxWidget.tsx
|
|
1271
|
-
var
|
|
1263
|
+
var import_react6 = require("react");
|
|
1272
1264
|
var import_utils20 = require("@rjsf/utils");
|
|
1273
1265
|
var import_core20 = require("@mantine/core");
|
|
1274
1266
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
@@ -1276,6 +1268,7 @@ function CheckboxWidget(props) {
|
|
|
1276
1268
|
const {
|
|
1277
1269
|
id,
|
|
1278
1270
|
name,
|
|
1271
|
+
htmlName,
|
|
1279
1272
|
value = false,
|
|
1280
1273
|
required,
|
|
1281
1274
|
disabled,
|
|
@@ -1298,7 +1291,7 @@ function CheckboxWidget(props) {
|
|
|
1298
1291
|
registry,
|
|
1299
1292
|
options
|
|
1300
1293
|
);
|
|
1301
|
-
const handleCheckboxChange = (0,
|
|
1294
|
+
const handleCheckboxChange = (0, import_react6.useCallback)(
|
|
1302
1295
|
(e) => {
|
|
1303
1296
|
if (!disabled && !readonly && onChange) {
|
|
1304
1297
|
onChange(e.currentTarget.checked);
|
|
@@ -1306,7 +1299,7 @@ function CheckboxWidget(props) {
|
|
|
1306
1299
|
},
|
|
1307
1300
|
[onChange, disabled, readonly]
|
|
1308
1301
|
);
|
|
1309
|
-
const handleBlur = (0,
|
|
1302
|
+
const handleBlur = (0, import_react6.useCallback)(
|
|
1310
1303
|
({ target }) => {
|
|
1311
1304
|
if (onBlur) {
|
|
1312
1305
|
onBlur(id, target.checked);
|
|
@@ -1314,7 +1307,7 @@ function CheckboxWidget(props) {
|
|
|
1314
1307
|
},
|
|
1315
1308
|
[onBlur, id]
|
|
1316
1309
|
);
|
|
1317
|
-
const handleFocus = (0,
|
|
1310
|
+
const handleFocus = (0, import_react6.useCallback)(
|
|
1318
1311
|
({ target }) => {
|
|
1319
1312
|
if (onFocus) {
|
|
1320
1313
|
onFocus(id, target.checked);
|
|
@@ -1338,7 +1331,7 @@ function CheckboxWidget(props) {
|
|
|
1338
1331
|
import_core20.Checkbox,
|
|
1339
1332
|
{
|
|
1340
1333
|
id,
|
|
1341
|
-
name,
|
|
1334
|
+
name: htmlName || name,
|
|
1342
1335
|
label: (0, import_utils20.labelValue)(label || void 0, hideLabel, false),
|
|
1343
1336
|
disabled: disabled || readonly,
|
|
1344
1337
|
required,
|
|
@@ -1356,7 +1349,7 @@ function CheckboxWidget(props) {
|
|
|
1356
1349
|
}
|
|
1357
1350
|
|
|
1358
1351
|
// src/widgets/ColorWidget.tsx
|
|
1359
|
-
var
|
|
1352
|
+
var import_react7 = require("react");
|
|
1360
1353
|
var import_utils22 = require("@rjsf/utils");
|
|
1361
1354
|
var import_core21 = require("@mantine/core");
|
|
1362
1355
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
@@ -1379,13 +1372,13 @@ function ColorWidget(props) {
|
|
|
1379
1372
|
onFocus
|
|
1380
1373
|
} = props;
|
|
1381
1374
|
const themeProps = cleanupOptions(options);
|
|
1382
|
-
const handleChange = (0,
|
|
1375
|
+
const handleChange = (0, import_react7.useCallback)(
|
|
1383
1376
|
(nextValue) => {
|
|
1384
1377
|
onChange(nextValue);
|
|
1385
1378
|
},
|
|
1386
1379
|
[onChange]
|
|
1387
1380
|
);
|
|
1388
|
-
const handleBlur = (0,
|
|
1381
|
+
const handleBlur = (0, import_react7.useCallback)(
|
|
1389
1382
|
({ target }) => {
|
|
1390
1383
|
if (onBlur) {
|
|
1391
1384
|
onBlur(id, target && target.value);
|
|
@@ -1393,7 +1386,7 @@ function ColorWidget(props) {
|
|
|
1393
1386
|
},
|
|
1394
1387
|
[onBlur, id]
|
|
1395
1388
|
);
|
|
1396
|
-
const handleFocus = (0,
|
|
1389
|
+
const handleFocus = (0, import_react7.useCallback)(
|
|
1397
1390
|
({ target }) => {
|
|
1398
1391
|
if (onFocus) {
|
|
1399
1392
|
onFocus(id, target && target.value);
|
|
@@ -1424,7 +1417,7 @@ function ColorWidget(props) {
|
|
|
1424
1417
|
}
|
|
1425
1418
|
|
|
1426
1419
|
// src/widgets/FileWidget.tsx
|
|
1427
|
-
var
|
|
1420
|
+
var import_react8 = require("react");
|
|
1428
1421
|
var import_utils24 = require("@rjsf/utils");
|
|
1429
1422
|
var import_core22 = require("@mantine/core");
|
|
1430
1423
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
@@ -1502,7 +1495,7 @@ function FileWidget(props) {
|
|
|
1502
1495
|
onChange
|
|
1503
1496
|
} = props;
|
|
1504
1497
|
const themeProps = cleanupOptions(options);
|
|
1505
|
-
const handleChange = (0,
|
|
1498
|
+
const handleChange = (0, import_react8.useCallback)(
|
|
1506
1499
|
(files) => {
|
|
1507
1500
|
if (typeof files === "object") {
|
|
1508
1501
|
processFiles(multiple ? files : [files]).then((filesInfoEvent) => {
|
|
@@ -1518,7 +1511,7 @@ function FileWidget(props) {
|
|
|
1518
1511
|
},
|
|
1519
1512
|
[multiple, value, onChange]
|
|
1520
1513
|
);
|
|
1521
|
-
const handleRemoveFile = (0,
|
|
1514
|
+
const handleRemoveFile = (0, import_react8.useCallback)(
|
|
1522
1515
|
(index) => {
|
|
1523
1516
|
if (multiple) {
|
|
1524
1517
|
const newValue = value.filter((_, i) => i !== index);
|
|
@@ -1529,7 +1522,7 @@ function FileWidget(props) {
|
|
|
1529
1522
|
},
|
|
1530
1523
|
[multiple, value, onChange]
|
|
1531
1524
|
);
|
|
1532
|
-
const ValueComponent = (0,
|
|
1525
|
+
const ValueComponent = (0, import_react8.useCallback)(
|
|
1533
1526
|
(props2) => {
|
|
1534
1527
|
const filesInfo = props2.value ? extractFileInfo(Array.isArray(props2.value) ? props2.value : [props2.value]) : null;
|
|
1535
1528
|
if (Array.isArray(filesInfo) && filesInfo.length > 0) {
|
|
@@ -1561,7 +1554,7 @@ function FileWidget(props) {
|
|
|
1561
1554
|
}
|
|
1562
1555
|
|
|
1563
1556
|
// src/widgets/PasswordWidget.tsx
|
|
1564
|
-
var
|
|
1557
|
+
var import_react9 = require("react");
|
|
1565
1558
|
var import_utils26 = require("@rjsf/utils");
|
|
1566
1559
|
var import_core23 = require("@mantine/core");
|
|
1567
1560
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
@@ -1585,13 +1578,13 @@ function PasswordWidget(props) {
|
|
|
1585
1578
|
} = props;
|
|
1586
1579
|
const emptyValue = options.emptyValue || "";
|
|
1587
1580
|
const themeProps = cleanupOptions(options);
|
|
1588
|
-
const handleChange = (0,
|
|
1581
|
+
const handleChange = (0, import_react9.useCallback)(
|
|
1589
1582
|
(e) => {
|
|
1590
1583
|
onChange(e.target.value === "" ? emptyValue : e.target.value);
|
|
1591
1584
|
},
|
|
1592
1585
|
[onChange, emptyValue]
|
|
1593
1586
|
);
|
|
1594
|
-
const handleBlur = (0,
|
|
1587
|
+
const handleBlur = (0, import_react9.useCallback)(
|
|
1595
1588
|
({ target }) => {
|
|
1596
1589
|
if (onBlur) {
|
|
1597
1590
|
onBlur(id, target && target.value);
|
|
@@ -1599,7 +1592,7 @@ function PasswordWidget(props) {
|
|
|
1599
1592
|
},
|
|
1600
1593
|
[onBlur, id]
|
|
1601
1594
|
);
|
|
1602
|
-
const handleFocus = (0,
|
|
1595
|
+
const handleFocus = (0, import_react9.useCallback)(
|
|
1603
1596
|
({ target }) => {
|
|
1604
1597
|
if (onFocus) {
|
|
1605
1598
|
onFocus(id, target && target.value);
|
|
@@ -1629,13 +1622,14 @@ function PasswordWidget(props) {
|
|
|
1629
1622
|
}
|
|
1630
1623
|
|
|
1631
1624
|
// src/widgets/RadioWidget.tsx
|
|
1632
|
-
var
|
|
1625
|
+
var import_react10 = require("react");
|
|
1633
1626
|
var import_utils28 = require("@rjsf/utils");
|
|
1634
1627
|
var import_core24 = require("@mantine/core");
|
|
1635
1628
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1636
1629
|
function RadioWidget(props) {
|
|
1637
1630
|
const {
|
|
1638
1631
|
id,
|
|
1632
|
+
htmlName,
|
|
1639
1633
|
value,
|
|
1640
1634
|
required,
|
|
1641
1635
|
disabled,
|
|
@@ -1651,7 +1645,7 @@ function RadioWidget(props) {
|
|
|
1651
1645
|
} = props;
|
|
1652
1646
|
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
1653
1647
|
const themeProps = cleanupOptions(options);
|
|
1654
|
-
const handleChange = (0,
|
|
1648
|
+
const handleChange = (0, import_react10.useCallback)(
|
|
1655
1649
|
(nextValue) => {
|
|
1656
1650
|
if (!disabled && !readonly && onChange) {
|
|
1657
1651
|
onChange((0, import_utils28.enumOptionsValueForIndex)(nextValue, enumOptions, emptyValue));
|
|
@@ -1659,7 +1653,7 @@ function RadioWidget(props) {
|
|
|
1659
1653
|
},
|
|
1660
1654
|
[onChange, disabled, readonly, enumOptions, emptyValue]
|
|
1661
1655
|
);
|
|
1662
|
-
const handleBlur = (0,
|
|
1656
|
+
const handleBlur = (0, import_react10.useCallback)(
|
|
1663
1657
|
({ target }) => {
|
|
1664
1658
|
if (onBlur) {
|
|
1665
1659
|
onBlur(id, (0, import_utils28.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
@@ -1667,7 +1661,7 @@ function RadioWidget(props) {
|
|
|
1667
1661
|
},
|
|
1668
1662
|
[onBlur, id, enumOptions, emptyValue]
|
|
1669
1663
|
);
|
|
1670
|
-
const handleFocus = (0,
|
|
1664
|
+
const handleFocus = (0, import_react10.useCallback)(
|
|
1671
1665
|
({ target }) => {
|
|
1672
1666
|
if (onFocus) {
|
|
1673
1667
|
onFocus(id, (0, import_utils28.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
@@ -1680,7 +1674,7 @@ function RadioWidget(props) {
|
|
|
1680
1674
|
import_core24.Radio.Group,
|
|
1681
1675
|
{
|
|
1682
1676
|
id,
|
|
1683
|
-
name: id,
|
|
1677
|
+
name: htmlName || id,
|
|
1684
1678
|
value: selected,
|
|
1685
1679
|
label: !hideLabel ? label : void 0,
|
|
1686
1680
|
onChange: handleChange,
|
|
@@ -1707,7 +1701,7 @@ function RadioWidget(props) {
|
|
|
1707
1701
|
}
|
|
1708
1702
|
|
|
1709
1703
|
// src/widgets/RangeWidget.tsx
|
|
1710
|
-
var
|
|
1704
|
+
var import_react11 = require("react");
|
|
1711
1705
|
var import_utils30 = require("@rjsf/utils");
|
|
1712
1706
|
var import_core25 = require("@mantine/core");
|
|
1713
1707
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
@@ -1731,7 +1725,7 @@ function RangeWidget(props) {
|
|
|
1731
1725
|
} = props;
|
|
1732
1726
|
const themeProps = cleanupOptions(options);
|
|
1733
1727
|
const { min, max, step } = (0, import_utils30.rangeSpec)(schema);
|
|
1734
|
-
const handleChange = (0,
|
|
1728
|
+
const handleChange = (0, import_react11.useCallback)(
|
|
1735
1729
|
(nextValue) => {
|
|
1736
1730
|
if (!disabled && !readonly && onChange) {
|
|
1737
1731
|
onChange(nextValue);
|
|
@@ -1739,12 +1733,12 @@ function RangeWidget(props) {
|
|
|
1739
1733
|
},
|
|
1740
1734
|
[onChange, disabled, readonly]
|
|
1741
1735
|
);
|
|
1742
|
-
const handleBlur = (0,
|
|
1736
|
+
const handleBlur = (0, import_react11.useCallback)(() => {
|
|
1743
1737
|
if (onBlur) {
|
|
1744
1738
|
onBlur(id, value);
|
|
1745
1739
|
}
|
|
1746
1740
|
}, [onBlur, id, value]);
|
|
1747
|
-
const handleFocus = (0,
|
|
1741
|
+
const handleFocus = (0, import_react11.useCallback)(() => {
|
|
1748
1742
|
if (onFocus) {
|
|
1749
1743
|
onFocus(id, value);
|
|
1750
1744
|
}
|
|
@@ -1775,13 +1769,14 @@ function RangeWidget(props) {
|
|
|
1775
1769
|
}
|
|
1776
1770
|
|
|
1777
1771
|
// src/widgets/SelectWidget.tsx
|
|
1778
|
-
var
|
|
1772
|
+
var import_react12 = require("react");
|
|
1779
1773
|
var import_utils32 = require("@rjsf/utils");
|
|
1780
1774
|
var import_core26 = require("@mantine/core");
|
|
1781
1775
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1782
1776
|
function SelectWidget(props) {
|
|
1783
1777
|
const {
|
|
1784
1778
|
id,
|
|
1779
|
+
htmlName,
|
|
1785
1780
|
value,
|
|
1786
1781
|
placeholder,
|
|
1787
1782
|
required,
|
|
@@ -1799,7 +1794,7 @@ function SelectWidget(props) {
|
|
|
1799
1794
|
} = props;
|
|
1800
1795
|
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
1801
1796
|
const themeProps = cleanupOptions(options);
|
|
1802
|
-
const handleChange = (0,
|
|
1797
|
+
const handleChange = (0, import_react12.useCallback)(
|
|
1803
1798
|
(nextValue) => {
|
|
1804
1799
|
if (!disabled && !readonly && onChange) {
|
|
1805
1800
|
onChange((0, import_utils32.enumOptionsValueForIndex)(nextValue, enumOptions, emptyValue));
|
|
@@ -1807,7 +1802,7 @@ function SelectWidget(props) {
|
|
|
1807
1802
|
},
|
|
1808
1803
|
[onChange, disabled, readonly, enumOptions, emptyValue]
|
|
1809
1804
|
);
|
|
1810
|
-
const handleBlur = (0,
|
|
1805
|
+
const handleBlur = (0, import_react12.useCallback)(
|
|
1811
1806
|
({ target }) => {
|
|
1812
1807
|
if (onBlur) {
|
|
1813
1808
|
onBlur(id, (0, import_utils32.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
@@ -1815,7 +1810,7 @@ function SelectWidget(props) {
|
|
|
1815
1810
|
},
|
|
1816
1811
|
[onBlur, id, enumOptions, emptyValue]
|
|
1817
1812
|
);
|
|
1818
|
-
const handleFocus = (0,
|
|
1813
|
+
const handleFocus = (0, import_react12.useCallback)(
|
|
1819
1814
|
({ target }) => {
|
|
1820
1815
|
if (onFocus) {
|
|
1821
1816
|
onFocus(id, (0, import_utils32.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
@@ -1824,7 +1819,7 @@ function SelectWidget(props) {
|
|
|
1824
1819
|
[onFocus, id, enumOptions, emptyValue]
|
|
1825
1820
|
);
|
|
1826
1821
|
const selectedIndexes = (0, import_utils32.enumOptionsIndexForValue)(value, enumOptions, multiple);
|
|
1827
|
-
const selectOptions = (0,
|
|
1822
|
+
const selectOptions = (0, import_react12.useMemo)(() => {
|
|
1828
1823
|
if (Array.isArray(enumOptions)) {
|
|
1829
1824
|
return enumOptions.map((option, index) => ({
|
|
1830
1825
|
key: String(index),
|
|
@@ -1840,7 +1835,7 @@ function SelectWidget(props) {
|
|
|
1840
1835
|
Component,
|
|
1841
1836
|
{
|
|
1842
1837
|
id,
|
|
1843
|
-
name: id,
|
|
1838
|
+
name: htmlName || id,
|
|
1844
1839
|
label: (0, import_utils32.labelValue)(label || void 0, hideLabel, false),
|
|
1845
1840
|
data: selectOptions,
|
|
1846
1841
|
value: multiple ? selectedIndexes : selectedIndexes,
|
|
@@ -1861,7 +1856,7 @@ function SelectWidget(props) {
|
|
|
1861
1856
|
}
|
|
1862
1857
|
|
|
1863
1858
|
// src/widgets/TextareaWidget.tsx
|
|
1864
|
-
var
|
|
1859
|
+
var import_react13 = require("react");
|
|
1865
1860
|
var import_utils34 = require("@rjsf/utils");
|
|
1866
1861
|
var import_core27 = require("@mantine/core");
|
|
1867
1862
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
@@ -1869,6 +1864,7 @@ function TextareaWidget(props) {
|
|
|
1869
1864
|
const {
|
|
1870
1865
|
id,
|
|
1871
1866
|
name,
|
|
1867
|
+
htmlName,
|
|
1872
1868
|
value,
|
|
1873
1869
|
placeholder,
|
|
1874
1870
|
required,
|
|
@@ -1885,13 +1881,13 @@ function TextareaWidget(props) {
|
|
|
1885
1881
|
} = props;
|
|
1886
1882
|
const themeProps = cleanupOptions(options);
|
|
1887
1883
|
const emptyValue = options?.emptyValue ?? "";
|
|
1888
|
-
const handleChange = (0,
|
|
1884
|
+
const handleChange = (0, import_react13.useCallback)(
|
|
1889
1885
|
(e) => {
|
|
1890
1886
|
onChange(e.target.value === "" ? emptyValue : e.target.value);
|
|
1891
1887
|
},
|
|
1892
1888
|
[onChange, emptyValue]
|
|
1893
1889
|
);
|
|
1894
|
-
const handleBlur = (0,
|
|
1890
|
+
const handleBlur = (0, import_react13.useCallback)(
|
|
1895
1891
|
({ target }) => {
|
|
1896
1892
|
if (onBlur) {
|
|
1897
1893
|
onBlur(id, target && target.value);
|
|
@@ -1899,7 +1895,7 @@ function TextareaWidget(props) {
|
|
|
1899
1895
|
},
|
|
1900
1896
|
[onBlur, id]
|
|
1901
1897
|
);
|
|
1902
|
-
const handleFocus = (0,
|
|
1898
|
+
const handleFocus = (0, import_react13.useCallback)(
|
|
1903
1899
|
({ target }) => {
|
|
1904
1900
|
if (onFocus) {
|
|
1905
1901
|
onFocus(id, target && target.value);
|
|
@@ -1911,7 +1907,7 @@ function TextareaWidget(props) {
|
|
|
1911
1907
|
import_core27.Textarea,
|
|
1912
1908
|
{
|
|
1913
1909
|
id,
|
|
1914
|
-
name,
|
|
1910
|
+
name: htmlName || name,
|
|
1915
1911
|
value: value || "",
|
|
1916
1912
|
placeholder: placeholder || void 0,
|
|
1917
1913
|
required,
|