@rjsf/antd 5.12.0 → 5.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/antd.esm.js +41 -70
- package/dist/antd.esm.js.map +4 -4
- package/dist/antd.umd.js +42 -65
- package/dist/index.js +44 -71
- package/dist/index.js.map +4 -4
- package/lib/templates/IconButton/index.d.ts +1 -1
- package/lib/templates/IconButton/index.js +2 -2
- package/lib/templates/IconButton/index.js.map +1 -1
- package/lib/widgets/AltDateWidget/index.js.map +1 -1
- package/lib/widgets/CheckboxesWidget/index.d.ts +1 -1
- package/lib/widgets/CheckboxesWidget/index.js +4 -5
- package/lib/widgets/CheckboxesWidget/index.js.map +1 -1
- package/lib/widgets/DateTimeWidget/index.js +1 -1
- package/lib/widgets/DateTimeWidget/index.js.map +1 -1
- package/lib/widgets/DateWidget/index.js +1 -1
- package/lib/widgets/DateWidget/index.js.map +1 -1
- package/package.json +9 -9
- package/src/templates/IconButton/index.tsx +11 -3
- package/src/widgets/AltDateWidget/index.tsx +2 -2
- package/src/widgets/CheckboxesWidget/index.tsx +1 -31
- package/src/widgets/DateTimeWidget/index.tsx +1 -1
- package/src/widgets/DateWidget/index.tsx +1 -1
- package/lib/components/DatePicker/index.d.ts +0 -48
- package/lib/components/DatePicker/index.js +0 -5
- package/lib/components/DatePicker/index.js.map +0 -1
- package/src/components/DatePicker/index.ts +0 -6
package/dist/antd.esm.js
CHANGED
|
@@ -298,8 +298,16 @@ import {
|
|
|
298
298
|
} from "@rjsf/utils";
|
|
299
299
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
300
300
|
function IconButton(props) {
|
|
301
|
-
const { iconType = "default", icon, uiSchema, registry, ...otherProps } = props;
|
|
302
|
-
return /* @__PURE__ */ jsx6(
|
|
301
|
+
const { iconType = "default", icon, onClick, uiSchema, registry, ...otherProps } = props;
|
|
302
|
+
return /* @__PURE__ */ jsx6(
|
|
303
|
+
Button2,
|
|
304
|
+
{
|
|
305
|
+
onClick,
|
|
306
|
+
type: iconType,
|
|
307
|
+
icon,
|
|
308
|
+
...otherProps
|
|
309
|
+
}
|
|
310
|
+
);
|
|
303
311
|
}
|
|
304
312
|
function AddButton(props) {
|
|
305
313
|
const {
|
|
@@ -925,30 +933,11 @@ import {
|
|
|
925
933
|
ariaDescribedByIds as ariaDescribedByIds3,
|
|
926
934
|
enumOptionsIndexForValue,
|
|
927
935
|
enumOptionsValueForIndex,
|
|
928
|
-
|
|
929
|
-
optionId,
|
|
930
|
-
titleId as titleId2
|
|
936
|
+
optionId
|
|
931
937
|
} from "@rjsf/utils";
|
|
932
938
|
import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
933
|
-
function CheckboxesWidget({
|
|
934
|
-
autofocus,
|
|
935
|
-
disabled,
|
|
936
|
-
formContext,
|
|
937
|
-
id,
|
|
938
|
-
label,
|
|
939
|
-
hideLabel,
|
|
940
|
-
onBlur,
|
|
941
|
-
onChange,
|
|
942
|
-
onFocus,
|
|
943
|
-
options,
|
|
944
|
-
readonly,
|
|
945
|
-
registry,
|
|
946
|
-
schema,
|
|
947
|
-
uiSchema,
|
|
948
|
-
value
|
|
949
|
-
}) {
|
|
939
|
+
function CheckboxesWidget({ autofocus, disabled, formContext, id, onBlur, onChange, onFocus, options, readonly, value }) {
|
|
950
940
|
const { readonlyAsDisabled = true } = formContext;
|
|
951
|
-
const TitleFieldTemplate = getTemplate4("TitleFieldTemplate", registry, options);
|
|
952
941
|
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
953
942
|
const handleChange = (nextValue) => onChange(enumOptionsValueForIndex(nextValue, enumOptions, emptyValue));
|
|
954
943
|
const handleBlur = ({ target }) => onBlur(id, enumOptionsValueForIndex(target.value, enumOptions, emptyValue));
|
|
@@ -959,43 +948,31 @@ function CheckboxesWidget({
|
|
|
959
948
|
onFocus: !readonly ? handleFocus : void 0
|
|
960
949
|
};
|
|
961
950
|
const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, true);
|
|
962
|
-
return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
name: id,
|
|
988
|
-
autoFocus: i === 0 ? autofocus : false,
|
|
989
|
-
disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1,
|
|
990
|
-
value: String(i),
|
|
991
|
-
children: option.label
|
|
992
|
-
}
|
|
993
|
-
),
|
|
994
|
-
!inline && /* @__PURE__ */ jsx15("br", {})
|
|
995
|
-
] }, i))
|
|
996
|
-
}
|
|
997
|
-
)
|
|
998
|
-
] }) : null;
|
|
951
|
+
return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */ jsx15(Fragment2, { children: /* @__PURE__ */ jsx15(
|
|
952
|
+
Checkbox.Group,
|
|
953
|
+
{
|
|
954
|
+
disabled: disabled || readonlyAsDisabled && readonly,
|
|
955
|
+
name: id,
|
|
956
|
+
onChange: !readonly ? handleChange : void 0,
|
|
957
|
+
value: selectedIndexes,
|
|
958
|
+
...extraProps,
|
|
959
|
+
"aria-describedby": ariaDescribedByIds3(id),
|
|
960
|
+
children: Array.isArray(enumOptions) && enumOptions.map((option, i) => /* @__PURE__ */ jsxs8("span", { children: [
|
|
961
|
+
/* @__PURE__ */ jsx15(
|
|
962
|
+
Checkbox,
|
|
963
|
+
{
|
|
964
|
+
id: optionId(id, i),
|
|
965
|
+
name: id,
|
|
966
|
+
autoFocus: i === 0 ? autofocus : false,
|
|
967
|
+
disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1,
|
|
968
|
+
value: String(i),
|
|
969
|
+
children: option.label
|
|
970
|
+
}
|
|
971
|
+
),
|
|
972
|
+
!inline && /* @__PURE__ */ jsx15("br", {})
|
|
973
|
+
] }, i))
|
|
974
|
+
}
|
|
975
|
+
) }) : null;
|
|
999
976
|
}
|
|
1000
977
|
|
|
1001
978
|
// src/widgets/CheckboxWidget/index.tsx
|
|
@@ -1036,14 +1013,7 @@ import dayjs from "dayjs";
|
|
|
1036
1013
|
import {
|
|
1037
1014
|
ariaDescribedByIds as ariaDescribedByIds5
|
|
1038
1015
|
} from "@rjsf/utils";
|
|
1039
|
-
|
|
1040
|
-
// src/components/DatePicker/index.ts
|
|
1041
|
-
import dayjsGenerateConfig from "rc-picker/lib/generate/dayjs";
|
|
1042
|
-
import generatePicker from "antd/lib/date-picker/generatePicker";
|
|
1043
|
-
var DatePicker = generatePicker(dayjsGenerateConfig);
|
|
1044
|
-
var DatePicker_default = DatePicker;
|
|
1045
|
-
|
|
1046
|
-
// src/widgets/DateTimeWidget/index.tsx
|
|
1016
|
+
import DatePicker from "antd/lib/date-picker";
|
|
1047
1017
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1048
1018
|
var DATE_PICKER_STYLE = {
|
|
1049
1019
|
width: "100%"
|
|
@@ -1056,7 +1026,7 @@ function DateTimeWidget(props) {
|
|
|
1056
1026
|
const handleFocus = () => onFocus(id, value);
|
|
1057
1027
|
const getPopupContainer = (node) => node.parentNode;
|
|
1058
1028
|
return /* @__PURE__ */ jsx17(
|
|
1059
|
-
|
|
1029
|
+
DatePicker,
|
|
1060
1030
|
{
|
|
1061
1031
|
disabled: disabled || readonlyAsDisabled && readonly,
|
|
1062
1032
|
getPopupContainer,
|
|
@@ -1079,6 +1049,7 @@ import dayjs2 from "dayjs";
|
|
|
1079
1049
|
import {
|
|
1080
1050
|
ariaDescribedByIds as ariaDescribedByIds6
|
|
1081
1051
|
} from "@rjsf/utils";
|
|
1052
|
+
import DatePicker2 from "antd/lib/date-picker";
|
|
1082
1053
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1083
1054
|
var DATE_PICKER_STYLE2 = {
|
|
1084
1055
|
width: "100%"
|
|
@@ -1091,7 +1062,7 @@ function DateWidget(props) {
|
|
|
1091
1062
|
const handleFocus = () => onFocus(id, value);
|
|
1092
1063
|
const getPopupContainer = (node) => node.parentNode;
|
|
1093
1064
|
return /* @__PURE__ */ jsx18(
|
|
1094
|
-
|
|
1065
|
+
DatePicker2,
|
|
1095
1066
|
{
|
|
1096
1067
|
disabled: disabled || readonlyAsDisabled && readonly,
|
|
1097
1068
|
getPopupContainer,
|