@rjsf/antd 6.6.0 → 6.6.2
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/antd.esm.js +79 -136
- package/dist/antd.esm.js.map +4 -4
- package/dist/antd.umd.js +55 -63
- package/dist/index.cjs +80 -91
- package/dist/index.cjs.map +4 -4
- package/lib/index.d.ts +3 -3
- package/lib/index.js.map +1 -1
- package/lib/templates/ArrayFieldItemTemplate/index.d.ts +1 -1
- package/lib/templates/ArrayFieldItemTemplate/index.js +1 -1
- package/lib/templates/ArrayFieldItemTemplate/index.js.map +1 -1
- package/lib/templates/ArrayFieldTemplate/index.d.ts +1 -1
- package/lib/templates/ArrayFieldTemplate/index.js +1 -1
- package/lib/templates/ArrayFieldTemplate/index.js.map +1 -1
- package/lib/templates/BaseInputTemplate/index.d.ts +1 -1
- package/lib/templates/BaseInputTemplate/index.js +3 -4
- package/lib/templates/BaseInputTemplate/index.js.map +1 -1
- package/lib/templates/ErrorList/index.d.ts +1 -1
- package/lib/templates/ErrorList/index.js +2 -2
- package/lib/templates/ErrorList/index.js.map +1 -1
- package/lib/templates/FieldDescriptionTemplate/index.d.ts +1 -1
- package/lib/templates/FieldErrorTemplate/index.d.ts +1 -1
- package/lib/templates/FieldErrorTemplate/index.js.map +1 -1
- package/lib/templates/FieldHelpTemplate/index.d.ts +1 -1
- package/lib/templates/FieldHelpTemplate/index.js.map +1 -1
- package/lib/templates/FieldTemplate/index.d.ts +1 -1
- package/lib/templates/FieldTemplate/index.js +1 -1
- package/lib/templates/FieldTemplate/index.js.map +1 -1
- package/lib/templates/GridTemplate/index.d.ts +1 -1
- package/lib/templates/IconButton/index.d.ts +2 -2
- package/lib/templates/IconButton/index.js +1 -1
- package/lib/templates/IconButton/index.js.map +1 -1
- package/lib/templates/MultiSchemaFieldTemplate/index.d.ts +1 -1
- package/lib/templates/ObjectFieldTemplate/index.d.ts +1 -1
- package/lib/templates/ObjectFieldTemplate/index.js +1 -1
- package/lib/templates/ObjectFieldTemplate/index.js.map +1 -1
- package/lib/templates/OptionalDataControlsTemplate/index.d.ts +1 -1
- package/lib/templates/OptionalDataControlsTemplate/index.js +1 -1
- package/lib/templates/OptionalDataControlsTemplate/index.js.map +1 -1
- package/lib/templates/SubmitButton/index.d.ts +1 -1
- package/lib/templates/SubmitButton/index.js.map +1 -1
- package/lib/templates/TitleField/index.d.ts +1 -1
- package/lib/templates/TitleField/index.js +4 -1
- package/lib/templates/TitleField/index.js.map +1 -1
- package/lib/templates/WrapIfAdditionalTemplate/index.d.ts +1 -1
- package/lib/templates/WrapIfAdditionalTemplate/index.js +1 -1
- package/lib/templates/WrapIfAdditionalTemplate/index.js.map +1 -1
- package/lib/templates/index.d.ts +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/widgets/AltDateTimeWidget/index.d.ts +1 -1
- package/lib/widgets/AltDateWidget/index.d.ts +1 -1
- package/lib/widgets/AltDateWidget/index.js +1 -1
- package/lib/widgets/AltDateWidget/index.js.map +1 -1
- package/lib/widgets/CheckboxWidget/index.d.ts +1 -1
- package/lib/widgets/CheckboxWidget/index.js +1 -1
- package/lib/widgets/CheckboxWidget/index.js.map +1 -1
- package/lib/widgets/CheckboxesWidget/index.d.ts +1 -1
- package/lib/widgets/CheckboxesWidget/index.js +3 -3
- package/lib/widgets/CheckboxesWidget/index.js.map +1 -1
- package/lib/widgets/DateTimeWidget/index.d.ts +3 -3
- package/lib/widgets/DateTimeWidget/index.js +4 -16
- package/lib/widgets/DateTimeWidget/index.js.map +1 -1
- package/lib/widgets/DateWidget/index.d.ts +9 -2
- package/lib/widgets/DateWidget/index.js +10 -6
- package/lib/widgets/DateWidget/index.js.map +1 -1
- package/lib/widgets/PasswordWidget/index.d.ts +1 -1
- package/lib/widgets/PasswordWidget/index.js +1 -1
- package/lib/widgets/PasswordWidget/index.js.map +1 -1
- package/lib/widgets/RadioWidget/index.d.ts +1 -1
- package/lib/widgets/RadioWidget/index.js +1 -1
- package/lib/widgets/RadioWidget/index.js.map +1 -1
- package/lib/widgets/RangeWidget/index.d.ts +1 -1
- package/lib/widgets/RangeWidget/index.js +1 -1
- package/lib/widgets/RangeWidget/index.js.map +1 -1
- package/lib/widgets/SelectWidget/index.d.ts +1 -1
- package/lib/widgets/SelectWidget/index.js +6 -6
- package/lib/widgets/SelectWidget/index.js.map +1 -1
- package/lib/widgets/TextareaWidget/index.d.ts +1 -1
- package/lib/widgets/TextareaWidget/index.js +1 -1
- package/lib/widgets/TextareaWidget/index.js.map +1 -1
- package/lib/widgets/index.d.ts +1 -1
- package/package.json +9 -9
- package/src/index.ts +4 -3
- package/src/templates/ArrayFieldItemTemplate/index.tsx +2 -8
- package/src/templates/ArrayFieldTemplate/index.tsx +2 -4
- package/src/templates/BaseInputTemplate/index.tsx +7 -8
- package/src/templates/ErrorList/index.tsx +4 -2
- package/src/templates/FieldDescriptionTemplate/index.tsx +1 -1
- package/src/templates/FieldErrorTemplate/index.tsx +2 -1
- package/src/templates/FieldHelpTemplate/index.tsx +2 -1
- package/src/templates/FieldTemplate/index.tsx +2 -9
- package/src/templates/GridTemplate/index.tsx +1 -1
- package/src/templates/IconButton/index.tsx +5 -10
- package/src/templates/MultiSchemaFieldTemplate/index.tsx +1 -1
- package/src/templates/ObjectFieldTemplate/index.tsx +2 -6
- package/src/templates/OptionalDataControlsTemplate/index.tsx +3 -2
- package/src/templates/SubmitButton/index.tsx +4 -2
- package/src/templates/TitleField/index.tsx +5 -1
- package/src/templates/WrapIfAdditionalTemplate/index.tsx +2 -10
- package/src/templates/index.ts +1 -1
- package/src/widgets/AltDateTimeWidget/index.tsx +1 -1
- package/src/widgets/AltDateWidget/index.tsx +2 -10
- package/src/widgets/CheckboxWidget/index.tsx +5 -11
- package/src/widgets/CheckboxesWidget/index.tsx +27 -32
- package/src/widgets/DateTimeWidget/index.tsx +5 -43
- package/src/widgets/DateWidget/index.tsx +28 -15
- package/src/widgets/PasswordWidget/index.tsx +3 -9
- package/src/widgets/RadioWidget/index.tsx +6 -9
- package/src/widgets/RangeWidget/index.tsx +2 -9
- package/src/widgets/SelectWidget/index.tsx +16 -17
- package/src/widgets/TextareaWidget/index.tsx +3 -9
- package/src/widgets/index.ts +1 -1
package/dist/antd.esm.js
CHANGED
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
import { withTheme } from "@rjsf/core";
|
|
3
3
|
|
|
4
4
|
// src/templates/ArrayFieldItemTemplate/index.tsx
|
|
5
|
-
import {
|
|
6
|
-
getUiOptions,
|
|
7
|
-
getTemplate
|
|
8
|
-
} from "@rjsf/utils";
|
|
5
|
+
import { getUiOptions, getTemplate } from "@rjsf/utils";
|
|
9
6
|
import { Col, Row, Space } from "antd";
|
|
10
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
8
|
var BTN_GRP_STYLE = {
|
|
@@ -33,11 +30,7 @@ function ArrayFieldItemTemplate(props) {
|
|
|
33
30
|
|
|
34
31
|
// src/templates/ArrayFieldTemplate/index.tsx
|
|
35
32
|
import { useContext } from "react";
|
|
36
|
-
import {
|
|
37
|
-
getTemplate as getTemplate2,
|
|
38
|
-
getUiOptions as getUiOptions2,
|
|
39
|
-
buttonId
|
|
40
|
-
} from "@rjsf/utils";
|
|
33
|
+
import { getTemplate as getTemplate2, getUiOptions as getUiOptions2, buttonId } from "@rjsf/utils";
|
|
41
34
|
import { Col as Col2, Row as Row2, ConfigProvider } from "antd";
|
|
42
35
|
import classNames from "classnames";
|
|
43
36
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
@@ -111,11 +104,7 @@ function ArrayFieldTemplate(props) {
|
|
|
111
104
|
// src/templates/BaseInputTemplate/index.tsx
|
|
112
105
|
import { useCallback } from "react";
|
|
113
106
|
import { SchemaExamples } from "@rjsf/core";
|
|
114
|
-
import {
|
|
115
|
-
ariaDescribedByIds,
|
|
116
|
-
examplesId,
|
|
117
|
-
getInputProps
|
|
118
|
-
} from "@rjsf/utils";
|
|
107
|
+
import { ariaDescribedByIds, examplesId, getInputProps } from "@rjsf/utils";
|
|
119
108
|
import { Input, InputNumber } from "antd";
|
|
120
109
|
import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
121
110
|
var INPUT_STYLE = {
|
|
@@ -144,7 +133,7 @@ function BaseInputTemplate(props) {
|
|
|
144
133
|
const { readonlyAsDisabled = true } = formContext;
|
|
145
134
|
const { ClearButton: ClearButton2 } = registry.templates.ButtonTemplates;
|
|
146
135
|
const handleNumberChange = (nextValue) => onChange(nextValue);
|
|
147
|
-
const handleTextChange = onChangeOverride
|
|
136
|
+
const handleTextChange = onChangeOverride || (({ target }) => onChange(target.value === "" ? options.emptyValue : target.value));
|
|
148
137
|
const handleBlur = ({ target }) => onBlur(id, target && target.value);
|
|
149
138
|
const handleFocus = ({ target }) => onFocus(id, target && target.value);
|
|
150
139
|
const handleClear = useCallback(
|
|
@@ -203,9 +192,9 @@ function BaseInputTemplate(props) {
|
|
|
203
192
|
}
|
|
204
193
|
|
|
205
194
|
// src/templates/ErrorList/index.tsx
|
|
206
|
-
import { Alert, Space as Space2, theme, version } from "antd";
|
|
207
195
|
import { ExclamationCircleOutlined } from "@ant-design/icons";
|
|
208
196
|
import { TranslatableString } from "@rjsf/utils";
|
|
197
|
+
import { Alert, Space as Space2, theme, version } from "antd";
|
|
209
198
|
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
210
199
|
var antdMajor = parseInt(version.split(".")[0], 10);
|
|
211
200
|
function ErrorList({
|
|
@@ -260,10 +249,7 @@ function FieldErrorTemplate(props) {
|
|
|
260
249
|
}
|
|
261
250
|
|
|
262
251
|
// src/templates/FieldTemplate/index.tsx
|
|
263
|
-
import {
|
|
264
|
-
getTemplate as getTemplate3,
|
|
265
|
-
getUiOptions as getUiOptions3
|
|
266
|
-
} from "@rjsf/utils";
|
|
252
|
+
import { getTemplate as getTemplate3, getUiOptions as getUiOptions3 } from "@rjsf/utils";
|
|
267
253
|
import { Form } from "antd";
|
|
268
254
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
269
255
|
var VERTICAL_LABEL_COL = { span: 24 };
|
|
@@ -354,10 +340,7 @@ import {
|
|
|
354
340
|
PlusCircleOutlined,
|
|
355
341
|
CloseOutlined
|
|
356
342
|
} from "@ant-design/icons";
|
|
357
|
-
import {
|
|
358
|
-
getUiOptions as getUiOptions4,
|
|
359
|
-
TranslatableString as TranslatableString2
|
|
360
|
-
} from "@rjsf/utils";
|
|
343
|
+
import { getUiOptions as getUiOptions4, TranslatableString as TranslatableString2 } from "@rjsf/utils";
|
|
361
344
|
import { Button } from "antd";
|
|
362
345
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
363
346
|
function IconButton(props) {
|
|
@@ -454,13 +437,7 @@ function MultiSchemaFieldTemplate(props) {
|
|
|
454
437
|
|
|
455
438
|
// src/templates/ObjectFieldTemplate/index.tsx
|
|
456
439
|
import { useContext as useContext2 } from "react";
|
|
457
|
-
import {
|
|
458
|
-
canExpand,
|
|
459
|
-
getTemplate as getTemplate4,
|
|
460
|
-
getUiOptions as getUiOptions5,
|
|
461
|
-
titleId,
|
|
462
|
-
buttonId as buttonId2
|
|
463
|
-
} from "@rjsf/utils";
|
|
440
|
+
import { canExpand, getTemplate as getTemplate4, getUiOptions as getUiOptions5, titleId, buttonId as buttonId2 } from "@rjsf/utils";
|
|
464
441
|
import { Col as Col4, Row as Row4, ConfigProvider as ConfigProvider2 } from "antd";
|
|
465
442
|
import classNames2 from "classnames";
|
|
466
443
|
import isNumber from "lodash/isNumber";
|
|
@@ -575,7 +552,8 @@ function OptionalDataControlsTemplate(props) {
|
|
|
575
552
|
block: false
|
|
576
553
|
}
|
|
577
554
|
);
|
|
578
|
-
}
|
|
555
|
+
}
|
|
556
|
+
if (onRemoveClick) {
|
|
579
557
|
return /* @__PURE__ */ jsx12(
|
|
580
558
|
RemoveButton,
|
|
581
559
|
{
|
|
@@ -644,6 +622,7 @@ function TitleField({
|
|
|
644
622
|
className: labelClassName,
|
|
645
623
|
htmlFor: id,
|
|
646
624
|
onClick: handleLabelClick,
|
|
625
|
+
onKeyDown: (e) => (e.key === "Enter" || e.key === " ") && handleLabelClick(),
|
|
647
626
|
title: typeof title === "string" ? title : "",
|
|
648
627
|
children: labelChildren
|
|
649
628
|
}
|
|
@@ -664,12 +643,7 @@ function TitleField({
|
|
|
664
643
|
}
|
|
665
644
|
|
|
666
645
|
// src/templates/WrapIfAdditionalTemplate/index.tsx
|
|
667
|
-
import {
|
|
668
|
-
ADDITIONAL_PROPERTY_FLAG,
|
|
669
|
-
UI_OPTIONS_KEY,
|
|
670
|
-
TranslatableString as TranslatableString3,
|
|
671
|
-
buttonId as buttonId3
|
|
672
|
-
} from "@rjsf/utils";
|
|
646
|
+
import { ADDITIONAL_PROPERTY_FLAG, UI_OPTIONS_KEY, TranslatableString as TranslatableString3, buttonId as buttonId3 } from "@rjsf/utils";
|
|
673
647
|
import { Col as Col6, Row as Row6, Form as Form2, Input as Input2 } from "antd";
|
|
674
648
|
import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
675
649
|
var VERTICAL_LABEL_COL2 = { span: 24 };
|
|
@@ -796,11 +770,7 @@ function AltDateTimeWidget({ time = true, ...props }) {
|
|
|
796
770
|
}
|
|
797
771
|
|
|
798
772
|
// src/widgets/AltDateWidget/index.tsx
|
|
799
|
-
import {
|
|
800
|
-
DateElement,
|
|
801
|
-
TranslatableString as TranslatableString4,
|
|
802
|
-
useAltDateWidgetProps
|
|
803
|
-
} from "@rjsf/utils";
|
|
773
|
+
import { DateElement, TranslatableString as TranslatableString4, useAltDateWidgetProps } from "@rjsf/utils";
|
|
804
774
|
import { Row as Row7, Col as Col7, Button as Button3 } from "antd";
|
|
805
775
|
import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
806
776
|
function AltDateWidget({ autofocus = false, disabled = false, options, readonly = false, time = false, ...props }) {
|
|
@@ -847,7 +817,7 @@ import {
|
|
|
847
817
|
optionId
|
|
848
818
|
} from "@rjsf/utils";
|
|
849
819
|
import { Checkbox } from "antd";
|
|
850
|
-
import {
|
|
820
|
+
import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
851
821
|
function CheckboxesWidget({
|
|
852
822
|
autofocus,
|
|
853
823
|
disabled,
|
|
@@ -874,7 +844,7 @@ function CheckboxesWidget({
|
|
|
874
844
|
onFocus: !readonly ? handleFocus : void 0
|
|
875
845
|
};
|
|
876
846
|
const selectValue = enumOptionSelectedValue(value, enumOptions, true, optionValueFormat, []);
|
|
877
|
-
return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */ jsx18(
|
|
847
|
+
return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */ jsx18(
|
|
878
848
|
Checkbox.Group,
|
|
879
849
|
{
|
|
880
850
|
disabled: disabled || readonlyAsDisabled && readonly,
|
|
@@ -883,29 +853,29 @@ function CheckboxesWidget({
|
|
|
883
853
|
value: selectValue,
|
|
884
854
|
...extraProps,
|
|
885
855
|
"aria-describedby": ariaDescribedByIds2(id),
|
|
886
|
-
children: Array.isArray(enumOptions) && enumOptions.map((option, i) =>
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
856
|
+
children: Array.isArray(enumOptions) && enumOptions.map((option, i) => (
|
|
857
|
+
// oxlint-disable-next-line react/no-array-index-key
|
|
858
|
+
/* @__PURE__ */ jsxs10("span", { children: [
|
|
859
|
+
/* @__PURE__ */ jsx18(
|
|
860
|
+
Checkbox,
|
|
861
|
+
{
|
|
862
|
+
id: optionId(id, i),
|
|
863
|
+
name: htmlName || id,
|
|
864
|
+
autoFocus: i === 0 ? autofocus : false,
|
|
865
|
+
disabled: Array.isArray(enumDisabled) && enumDisabled.includes(option.value),
|
|
866
|
+
value: enumOptionValueEncoder(option.value, i, optionValueFormat),
|
|
867
|
+
children: option.label
|
|
868
|
+
}
|
|
869
|
+
),
|
|
870
|
+
!inline && /* @__PURE__ */ jsx18("br", {})
|
|
871
|
+
] }, i)
|
|
872
|
+
))
|
|
900
873
|
}
|
|
901
|
-
)
|
|
874
|
+
) : null;
|
|
902
875
|
}
|
|
903
876
|
|
|
904
877
|
// src/widgets/CheckboxWidget/index.tsx
|
|
905
|
-
import {
|
|
906
|
-
ariaDescribedByIds as ariaDescribedByIds3,
|
|
907
|
-
labelValue
|
|
908
|
-
} from "@rjsf/utils";
|
|
878
|
+
import { ariaDescribedByIds as ariaDescribedByIds3, labelValue } from "@rjsf/utils";
|
|
909
879
|
import { Checkbox as Checkbox2 } from "antd";
|
|
910
880
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
911
881
|
function CheckboxWidget(props) {
|
|
@@ -935,24 +905,32 @@ function CheckboxWidget(props) {
|
|
|
935
905
|
);
|
|
936
906
|
}
|
|
937
907
|
|
|
938
|
-
// src/widgets/
|
|
939
|
-
import {
|
|
940
|
-
ariaDescribedByIds as ariaDescribedByIds4
|
|
941
|
-
} from "@rjsf/utils";
|
|
908
|
+
// src/widgets/DateWidget/index.tsx
|
|
909
|
+
import { ariaDescribedByIds as ariaDescribedByIds4 } from "@rjsf/utils";
|
|
942
910
|
import { DatePicker } from "antd";
|
|
943
911
|
import dayjs from "dayjs";
|
|
944
912
|
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
945
913
|
var DATE_PICKER_STYLE = {
|
|
946
914
|
width: "100%"
|
|
947
915
|
};
|
|
948
|
-
function
|
|
949
|
-
|
|
916
|
+
function DateWidget({
|
|
917
|
+
disabled,
|
|
918
|
+
registry,
|
|
919
|
+
id,
|
|
920
|
+
onBlur,
|
|
921
|
+
onChange,
|
|
922
|
+
onFocus,
|
|
923
|
+
placeholder,
|
|
924
|
+
readonly,
|
|
925
|
+
value,
|
|
926
|
+
showTime = false
|
|
927
|
+
}) {
|
|
950
928
|
const { formContext } = registry;
|
|
951
929
|
const { readonlyAsDisabled = true } = formContext;
|
|
952
|
-
const handleChange = (nextValue) => onChange(nextValue && nextValue.toISOString());
|
|
930
|
+
const handleChange = (nextValue) => onChange(nextValue && (showTime ? nextValue.toISOString() : nextValue.format("YYYY-MM-DD")));
|
|
953
931
|
const handleBlur = () => onBlur(id, value);
|
|
954
932
|
const handleFocus = () => onFocus(id, value);
|
|
955
|
-
const getPopupContainer = (
|
|
933
|
+
const getPopupContainer = DateWidget.getPopupContainerCallback();
|
|
956
934
|
return /* @__PURE__ */ jsx20(
|
|
957
935
|
DatePicker,
|
|
958
936
|
{
|
|
@@ -964,55 +942,23 @@ function DateTimeWidget(props) {
|
|
|
964
942
|
onChange: !readonly ? handleChange : void 0,
|
|
965
943
|
onFocus: !readonly ? handleFocus : void 0,
|
|
966
944
|
placeholder,
|
|
967
|
-
showTime
|
|
945
|
+
showTime,
|
|
968
946
|
style: DATE_PICKER_STYLE,
|
|
969
947
|
value: value && dayjs(value),
|
|
970
948
|
"aria-describedby": ariaDescribedByIds4(id)
|
|
971
949
|
}
|
|
972
950
|
);
|
|
973
951
|
}
|
|
952
|
+
DateWidget.getPopupContainerCallback = () => (node) => node.parentNode;
|
|
974
953
|
|
|
975
|
-
// src/widgets/
|
|
976
|
-
import {
|
|
977
|
-
ariaDescribedByIds as ariaDescribedByIds5
|
|
978
|
-
} from "@rjsf/utils";
|
|
979
|
-
import { DatePicker as DatePicker2 } from "antd";
|
|
980
|
-
import dayjs2 from "dayjs";
|
|
954
|
+
// src/widgets/DateTimeWidget/index.tsx
|
|
981
955
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
};
|
|
985
|
-
function DateWidget(props) {
|
|
986
|
-
const { disabled, registry, id, onBlur, onChange, onFocus, placeholder, readonly, value } = props;
|
|
987
|
-
const { formContext } = registry;
|
|
988
|
-
const { readonlyAsDisabled = true } = formContext;
|
|
989
|
-
const handleChange = (nextValue) => onChange(nextValue && nextValue.format("YYYY-MM-DD"));
|
|
990
|
-
const handleBlur = () => onBlur(id, value);
|
|
991
|
-
const handleFocus = () => onFocus(id, value);
|
|
992
|
-
const getPopupContainer = (node) => node.parentNode;
|
|
993
|
-
return /* @__PURE__ */ jsx21(
|
|
994
|
-
DatePicker2,
|
|
995
|
-
{
|
|
996
|
-
disabled: disabled || readonlyAsDisabled && readonly,
|
|
997
|
-
getPopupContainer,
|
|
998
|
-
id,
|
|
999
|
-
name: id,
|
|
1000
|
-
onBlur: !readonly ? handleBlur : void 0,
|
|
1001
|
-
onChange: !readonly ? handleChange : void 0,
|
|
1002
|
-
onFocus: !readonly ? handleFocus : void 0,
|
|
1003
|
-
placeholder,
|
|
1004
|
-
showTime: false,
|
|
1005
|
-
style: DATE_PICKER_STYLE2,
|
|
1006
|
-
value: value && dayjs2(value),
|
|
1007
|
-
"aria-describedby": ariaDescribedByIds5(id)
|
|
1008
|
-
}
|
|
1009
|
-
);
|
|
956
|
+
function DateTimeWidget(props) {
|
|
957
|
+
return /* @__PURE__ */ jsx21(DateWidget, { showTime: true, ...props });
|
|
1010
958
|
}
|
|
1011
959
|
|
|
1012
960
|
// src/widgets/PasswordWidget/index.tsx
|
|
1013
|
-
import {
|
|
1014
|
-
ariaDescribedByIds as ariaDescribedByIds6
|
|
1015
|
-
} from "@rjsf/utils";
|
|
961
|
+
import { ariaDescribedByIds as ariaDescribedByIds5 } from "@rjsf/utils";
|
|
1016
962
|
import { Input as Input3 } from "antd";
|
|
1017
963
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1018
964
|
function PasswordWidget(props) {
|
|
@@ -1034,14 +980,14 @@ function PasswordWidget(props) {
|
|
|
1034
980
|
onFocus: !readonly ? handleFocus : void 0,
|
|
1035
981
|
placeholder,
|
|
1036
982
|
value: value || "",
|
|
1037
|
-
"aria-describedby":
|
|
983
|
+
"aria-describedby": ariaDescribedByIds5(id)
|
|
1038
984
|
}
|
|
1039
985
|
);
|
|
1040
986
|
}
|
|
1041
987
|
|
|
1042
988
|
// src/widgets/RadioWidget/index.tsx
|
|
1043
989
|
import {
|
|
1044
|
-
ariaDescribedByIds as
|
|
990
|
+
ariaDescribedByIds as ariaDescribedByIds6,
|
|
1045
991
|
enumOptionSelectedValue as enumOptionSelectedValue2,
|
|
1046
992
|
enumOptionValueDecoder as enumOptionValueDecoder2,
|
|
1047
993
|
enumOptionValueEncoder as enumOptionValueEncoder2,
|
|
@@ -1081,28 +1027,25 @@ function RadioWidget({
|
|
|
1081
1027
|
onBlur: !readonly ? handleBlur : void 0,
|
|
1082
1028
|
onFocus: !readonly ? handleFocus : void 0,
|
|
1083
1029
|
value: selectValue,
|
|
1084
|
-
"aria-describedby":
|
|
1030
|
+
"aria-describedby": ariaDescribedByIds6(id),
|
|
1085
1031
|
children: Array.isArray(enumOptions) && enumOptions.map((option, i) => /* @__PURE__ */ jsx23(
|
|
1086
1032
|
Radio,
|
|
1087
1033
|
{
|
|
1088
1034
|
id: optionId2(id, i),
|
|
1089
1035
|
name: htmlName || id,
|
|
1090
1036
|
autoFocus: i === 0 ? autofocus : false,
|
|
1091
|
-
disabled: disabled || Array.isArray(enumDisabled) && enumDisabled.
|
|
1037
|
+
disabled: disabled || Array.isArray(enumDisabled) && enumDisabled.includes(option.value),
|
|
1092
1038
|
value: enumOptionValueEncoder2(option.value, i, optionValueFormat),
|
|
1093
1039
|
children: option.label
|
|
1094
1040
|
},
|
|
1095
|
-
|
|
1041
|
+
String(option.value)
|
|
1096
1042
|
))
|
|
1097
1043
|
}
|
|
1098
1044
|
);
|
|
1099
1045
|
}
|
|
1100
1046
|
|
|
1101
1047
|
// src/widgets/RangeWidget/index.tsx
|
|
1102
|
-
import {
|
|
1103
|
-
ariaDescribedByIds as ariaDescribedByIds8,
|
|
1104
|
-
rangeSpec
|
|
1105
|
-
} from "@rjsf/utils";
|
|
1048
|
+
import { ariaDescribedByIds as ariaDescribedByIds7, rangeSpec } from "@rjsf/utils";
|
|
1106
1049
|
import { Slider } from "antd";
|
|
1107
1050
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1108
1051
|
function RangeWidget(props) {
|
|
@@ -1145,7 +1088,7 @@ function RangeWidget(props) {
|
|
|
1145
1088
|
step,
|
|
1146
1089
|
value,
|
|
1147
1090
|
...extraProps,
|
|
1148
|
-
"aria-describedby":
|
|
1091
|
+
"aria-describedby": ariaDescribedByIds7(id)
|
|
1149
1092
|
}
|
|
1150
1093
|
);
|
|
1151
1094
|
}
|
|
@@ -1153,7 +1096,7 @@ function RangeWidget(props) {
|
|
|
1153
1096
|
// src/widgets/SelectWidget/index.tsx
|
|
1154
1097
|
import { useMemo, useState } from "react";
|
|
1155
1098
|
import {
|
|
1156
|
-
ariaDescribedByIds as
|
|
1099
|
+
ariaDescribedByIds as ariaDescribedByIds8,
|
|
1157
1100
|
enumOptionSelectedValue as enumOptionSelectedValue3,
|
|
1158
1101
|
enumOptionValueDecoder as enumOptionValueDecoder3,
|
|
1159
1102
|
enumOptionValueEncoder as enumOptionValueEncoder3,
|
|
@@ -1191,7 +1134,7 @@ function SelectWidget({
|
|
|
1191
1134
|
const handleFocus = () => onFocus(id, enumOptionValueDecoder3(value, enumOptions, optionValueFormat, emptyValue));
|
|
1192
1135
|
const filterOption = (input, option) => {
|
|
1193
1136
|
if (option && isString2(option.label)) {
|
|
1194
|
-
return option.label.toLowerCase().
|
|
1137
|
+
return option.label.toLowerCase().includes(input.toLowerCase());
|
|
1195
1138
|
}
|
|
1196
1139
|
return false;
|
|
1197
1140
|
};
|
|
@@ -1203,16 +1146,18 @@ function SelectWidget({
|
|
|
1203
1146
|
const showPlaceholderOption = !multiple && schema.default === void 0;
|
|
1204
1147
|
const selectOptions = useMemo(() => {
|
|
1205
1148
|
if (Array.isArray(enumOptions)) {
|
|
1206
|
-
const
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1149
|
+
const enumOptionsList = enumOptions.map(
|
|
1150
|
+
({ value: optionValue, label: optionLabel }, index) => ({
|
|
1151
|
+
disabled: Array.isArray(enumDisabled) && enumDisabled.includes(optionValue),
|
|
1152
|
+
key: String(index),
|
|
1153
|
+
value: enumOptionValueEncoder3(optionValue, index, optionValueFormat),
|
|
1154
|
+
label: optionLabel
|
|
1155
|
+
})
|
|
1156
|
+
);
|
|
1212
1157
|
if (showPlaceholderOption) {
|
|
1213
|
-
|
|
1158
|
+
enumOptionsList.unshift({ value: "", label: placeholder || "" });
|
|
1214
1159
|
}
|
|
1215
|
-
return
|
|
1160
|
+
return enumOptionsList;
|
|
1216
1161
|
}
|
|
1217
1162
|
return void 0;
|
|
1218
1163
|
}, [enumDisabled, enumOptions, placeholder, showPlaceholderOption, optionValueFormat]);
|
|
@@ -1233,8 +1178,8 @@ function SelectWidget({
|
|
|
1233
1178
|
value: selectValue,
|
|
1234
1179
|
...extraProps,
|
|
1235
1180
|
onOpenChange: setOpen,
|
|
1236
|
-
filterOption,
|
|
1237
|
-
"aria-describedby":
|
|
1181
|
+
showSearch: { filterOption },
|
|
1182
|
+
"aria-describedby": ariaDescribedByIds8(id),
|
|
1238
1183
|
options: selectOptions
|
|
1239
1184
|
}
|
|
1240
1185
|
);
|
|
@@ -1242,9 +1187,7 @@ function SelectWidget({
|
|
|
1242
1187
|
SelectWidget.getPopupContainerCallback = () => (node) => node.parentElement;
|
|
1243
1188
|
|
|
1244
1189
|
// src/widgets/TextareaWidget/index.tsx
|
|
1245
|
-
import {
|
|
1246
|
-
ariaDescribedByIds as ariaDescribedByIds10
|
|
1247
|
-
} from "@rjsf/utils";
|
|
1190
|
+
import { ariaDescribedByIds as ariaDescribedByIds9 } from "@rjsf/utils";
|
|
1248
1191
|
import { Input as Input4 } from "antd";
|
|
1249
1192
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1250
1193
|
var INPUT_STYLE3 = {
|
|
@@ -1285,7 +1228,7 @@ function TextareaWidget({
|
|
|
1285
1228
|
style: INPUT_STYLE3,
|
|
1286
1229
|
value,
|
|
1287
1230
|
...extraProps,
|
|
1288
|
-
"aria-describedby":
|
|
1231
|
+
"aria-describedby": ariaDescribedByIds9(id)
|
|
1289
1232
|
}
|
|
1290
1233
|
);
|
|
1291
1234
|
}
|