@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 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(Button2, { type: iconType, icon, ...otherProps });
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
- getTemplate as getTemplate4,
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__ */ jsxs8(Fragment2, { children: [
963
- !hideLabel && !!label && /* @__PURE__ */ jsx15("div", { children: /* @__PURE__ */ jsx15(
964
- TitleFieldTemplate,
965
- {
966
- id: titleId2(id),
967
- title: label,
968
- schema,
969
- uiSchema,
970
- registry
971
- }
972
- ) }),
973
- /* @__PURE__ */ jsx15(
974
- Checkbox.Group,
975
- {
976
- disabled: disabled || readonlyAsDisabled && readonly,
977
- name: id,
978
- onChange: !readonly ? handleChange : void 0,
979
- value: selectedIndexes,
980
- ...extraProps,
981
- "aria-describedby": ariaDescribedByIds3(id),
982
- children: Array.isArray(enumOptions) && enumOptions.map((option, i) => /* @__PURE__ */ jsxs8("span", { children: [
983
- /* @__PURE__ */ jsx15(
984
- Checkbox,
985
- {
986
- id: optionId(id, i),
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
- DatePicker_default,
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
- DatePicker_default,
1065
+ DatePicker2,
1095
1066
  {
1096
1067
  disabled: disabled || readonlyAsDisabled && readonly,
1097
1068
  getPopupContainer,