@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.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@rjsf/core'), require('antd/lib/button'), require('antd/lib/col'), require('antd/lib/row'), require('react/jsx-runtime'), require('@rjsf/utils'), require('classnames'), require('antd/lib/config-provider/context'), require('antd/lib/input'), require('antd/lib/input-number'), require('antd/lib/alert'), require('antd/lib/list'), require('antd/lib/space'), require('@ant-design/icons/ExclamationCircleOutlined'), require('@ant-design/icons/ArrowDownOutlined'), require('@ant-design/icons/ArrowUpOutlined'), require('@ant-design/icons/CopyOutlined'), require('@ant-design/icons/DeleteOutlined'), require('@ant-design/icons/PlusCircleOutlined'), require('antd/lib/form'), require('lodash/isObject'), require('lodash/isNumber'), require('lodash/isString'), require('react'), require('antd/lib/checkbox'), require('dayjs'), require('rc-picker/lib/generate/dayjs'), require('antd/lib/date-picker/generatePicker'), require('antd/lib/radio'), require('antd/lib/slider'), require('antd/lib/select')) :
3
- typeof define === 'function' && define.amd ? define(['exports', '@rjsf/core', 'antd/lib/button', 'antd/lib/col', 'antd/lib/row', 'react/jsx-runtime', '@rjsf/utils', 'classnames', 'antd/lib/config-provider/context', 'antd/lib/input', 'antd/lib/input-number', 'antd/lib/alert', 'antd/lib/list', 'antd/lib/space', '@ant-design/icons/ExclamationCircleOutlined', '@ant-design/icons/ArrowDownOutlined', '@ant-design/icons/ArrowUpOutlined', '@ant-design/icons/CopyOutlined', '@ant-design/icons/DeleteOutlined', '@ant-design/icons/PlusCircleOutlined', 'antd/lib/form', 'lodash/isObject', 'lodash/isNumber', 'lodash/isString', 'react', 'antd/lib/checkbox', 'dayjs', 'rc-picker/lib/generate/dayjs', 'antd/lib/date-picker/generatePicker', 'antd/lib/radio', 'antd/lib/slider', 'antd/lib/select'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@rjsf/antd"] = {}, global.core, global.Button4, global.Col2, global.Row2, global.jsxRuntime, global.utils, global.classNames, global.context, global.Input, global.InputNumber, global.Alert, global.List, global.Space, global.ExclamationCircleOutlined, global.ArrowDownOutlined, global.ArrowUpOutlined, global.CopyOutlined, global.DeleteOutlined, global.PlusCircleOutlined, global.Form, global.isObject, global.isNumber, global.isString, global.react, global.Checkbox, global.dayjs, global.dayjsGenerateConfig, global.generatePicker, global.Radio, global.Slider, global.Select));
5
- })(this, (function (exports, core, Button4, Col2, Row2, jsxRuntime, utils, classNames, context, Input, InputNumber, Alert, List, Space, ExclamationCircleOutlined, ArrowDownOutlined, ArrowUpOutlined, CopyOutlined, DeleteOutlined, PlusCircleOutlined, Form, isObject, isNumber, isString, react, Checkbox, dayjs, dayjsGenerateConfig, generatePicker, Radio, Slider, Select) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@rjsf/core'), require('antd/lib/button'), require('antd/lib/col'), require('antd/lib/row'), require('react/jsx-runtime'), require('@rjsf/utils'), require('classnames'), require('antd/lib/config-provider/context'), require('antd/lib/input'), require('antd/lib/input-number'), require('antd/lib/alert'), require('antd/lib/list'), require('antd/lib/space'), require('@ant-design/icons/ExclamationCircleOutlined'), require('@ant-design/icons/ArrowDownOutlined'), require('@ant-design/icons/ArrowUpOutlined'), require('@ant-design/icons/CopyOutlined'), require('@ant-design/icons/DeleteOutlined'), require('@ant-design/icons/PlusCircleOutlined'), require('antd/lib/form'), require('lodash/isObject'), require('lodash/isNumber'), require('lodash/isString'), require('react'), require('antd/lib/checkbox'), require('dayjs'), require('antd/lib/date-picker'), require('antd/lib/radio'), require('antd/lib/slider'), require('antd/lib/select')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', '@rjsf/core', 'antd/lib/button', 'antd/lib/col', 'antd/lib/row', 'react/jsx-runtime', '@rjsf/utils', 'classnames', 'antd/lib/config-provider/context', 'antd/lib/input', 'antd/lib/input-number', 'antd/lib/alert', 'antd/lib/list', 'antd/lib/space', '@ant-design/icons/ExclamationCircleOutlined', '@ant-design/icons/ArrowDownOutlined', '@ant-design/icons/ArrowUpOutlined', '@ant-design/icons/CopyOutlined', '@ant-design/icons/DeleteOutlined', '@ant-design/icons/PlusCircleOutlined', 'antd/lib/form', 'lodash/isObject', 'lodash/isNumber', 'lodash/isString', 'react', 'antd/lib/checkbox', 'dayjs', 'antd/lib/date-picker', 'antd/lib/radio', 'antd/lib/slider', 'antd/lib/select'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@rjsf/antd"] = {}, global.core, global.Button4, global.Col2, global.Row2, global.jsxRuntime, global.utils, global.classNames, global.context, global.Input, global.InputNumber, global.Alert, global.List, global.Space, global.ExclamationCircleOutlined, global.ArrowDownOutlined, global.ArrowUpOutlined, global.CopyOutlined, global.DeleteOutlined, global.PlusCircleOutlined, global.Form, global.isObject, global.isNumber, global.isString, global.react, global.Checkbox, global.dayjs, global.DatePicker, global.Radio, global.Slider, global.Select));
5
+ })(this, (function (exports, core, Button4, Col2, Row2, jsxRuntime, utils, classNames, context, Input, InputNumber, Alert, List, Space, ExclamationCircleOutlined, ArrowDownOutlined, ArrowUpOutlined, CopyOutlined, DeleteOutlined, PlusCircleOutlined, Form, isObject, isNumber, isString, react, Checkbox, dayjs, DatePicker, Radio, Slider, Select) { 'use strict';
6
6
 
7
7
  // src/index.ts
8
8
  var BTN_GRP_STYLE = {
@@ -252,8 +252,16 @@
252
252
  );
253
253
  }
254
254
  function IconButton(props) {
255
- const { iconType = "default", icon, uiSchema, registry, ...otherProps } = props;
256
- return /* @__PURE__ */ jsxRuntime.jsx(Button4, { type: iconType, icon, ...otherProps });
255
+ const { iconType = "default", icon, onClick, uiSchema, registry, ...otherProps } = props;
256
+ return /* @__PURE__ */ jsxRuntime.jsx(
257
+ Button4,
258
+ {
259
+ onClick,
260
+ type: iconType,
261
+ icon,
262
+ ...otherProps
263
+ }
264
+ );
257
265
  }
258
266
  function AddButton(props) {
259
267
  const {
@@ -804,25 +812,8 @@
804
812
  ...AltDateWidget.defaultProps,
805
813
  showTime: true
806
814
  };
807
- function CheckboxesWidget({
808
- autofocus,
809
- disabled,
810
- formContext,
811
- id,
812
- label,
813
- hideLabel,
814
- onBlur,
815
- onChange,
816
- onFocus,
817
- options,
818
- readonly,
819
- registry,
820
- schema,
821
- uiSchema,
822
- value
823
- }) {
815
+ function CheckboxesWidget({ autofocus, disabled, formContext, id, onBlur, onChange, onFocus, options, readonly, value }) {
824
816
  const { readonlyAsDisabled = true } = formContext;
825
- const TitleFieldTemplate = utils.getTemplate("TitleFieldTemplate", registry, options);
826
817
  const { enumOptions, enumDisabled, inline, emptyValue } = options;
827
818
  const handleChange = (nextValue) => onChange(utils.enumOptionsValueForIndex(nextValue, enumOptions, emptyValue));
828
819
  const handleBlur = ({ target }) => onBlur(id, utils.enumOptionsValueForIndex(target.value, enumOptions, emptyValue));
@@ -833,43 +824,31 @@
833
824
  onFocus: !readonly ? handleFocus : void 0
834
825
  };
835
826
  const selectedIndexes = utils.enumOptionsIndexForValue(value, enumOptions, true);
836
- return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
837
- !hideLabel && !!label && /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
838
- TitleFieldTemplate,
839
- {
840
- id: utils.titleId(id),
841
- title: label,
842
- schema,
843
- uiSchema,
844
- registry
845
- }
846
- ) }),
847
- /* @__PURE__ */ jsxRuntime.jsx(
848
- Checkbox.Group,
849
- {
850
- disabled: disabled || readonlyAsDisabled && readonly,
851
- name: id,
852
- onChange: !readonly ? handleChange : void 0,
853
- value: selectedIndexes,
854
- ...extraProps,
855
- "aria-describedby": utils.ariaDescribedByIds(id),
856
- children: Array.isArray(enumOptions) && enumOptions.map((option, i) => /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
857
- /* @__PURE__ */ jsxRuntime.jsx(
858
- Checkbox,
859
- {
860
- id: utils.optionId(id, i),
861
- name: id,
862
- autoFocus: i === 0 ? autofocus : false,
863
- disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1,
864
- value: String(i),
865
- children: option.label
866
- }
867
- ),
868
- !inline && /* @__PURE__ */ jsxRuntime.jsx("br", {})
869
- ] }, i))
870
- }
871
- )
872
- ] }) : null;
827
+ return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
828
+ Checkbox.Group,
829
+ {
830
+ disabled: disabled || readonlyAsDisabled && readonly,
831
+ name: id,
832
+ onChange: !readonly ? handleChange : void 0,
833
+ value: selectedIndexes,
834
+ ...extraProps,
835
+ "aria-describedby": utils.ariaDescribedByIds(id),
836
+ children: Array.isArray(enumOptions) && enumOptions.map((option, i) => /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
837
+ /* @__PURE__ */ jsxRuntime.jsx(
838
+ Checkbox,
839
+ {
840
+ id: utils.optionId(id, i),
841
+ name: id,
842
+ autoFocus: i === 0 ? autofocus : false,
843
+ disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1,
844
+ value: String(i),
845
+ children: option.label
846
+ }
847
+ ),
848
+ !inline && /* @__PURE__ */ jsxRuntime.jsx("br", {})
849
+ ] }, i))
850
+ }
851
+ ) }) : null;
873
852
  }
874
853
  function CheckboxWidget(props) {
875
854
  const { autofocus, disabled, formContext, id, label, hideLabel, onBlur, onChange, onFocus, readonly, value } = props;
@@ -896,8 +875,6 @@
896
875
  }
897
876
  );
898
877
  }
899
- var DatePicker = generatePicker(dayjsGenerateConfig);
900
- var DatePicker_default = DatePicker;
901
878
  var DATE_PICKER_STYLE = {
902
879
  width: "100%"
903
880
  };
@@ -909,7 +886,7 @@
909
886
  const handleFocus = () => onFocus(id, value);
910
887
  const getPopupContainer = (node) => node.parentNode;
911
888
  return /* @__PURE__ */ jsxRuntime.jsx(
912
- DatePicker_default,
889
+ DatePicker,
913
890
  {
914
891
  disabled: disabled || readonlyAsDisabled && readonly,
915
892
  getPopupContainer,
@@ -937,7 +914,7 @@
937
914
  const handleFocus = () => onFocus(id, value);
938
915
  const getPopupContainer = (node) => node.parentNode;
939
916
  return /* @__PURE__ */ jsxRuntime.jsx(
940
- DatePicker_default,
917
+ DatePicker,
941
918
  {
942
919
  disabled: disabled || readonlyAsDisabled && readonly,
943
920
  getPopupContainer,
package/dist/index.js CHANGED
@@ -330,8 +330,16 @@ var import_PlusCircleOutlined = __toESM(require("@ant-design/icons/PlusCircleOut
330
330
  var import_utils4 = require("@rjsf/utils");
331
331
  var import_jsx_runtime6 = require("react/jsx-runtime");
332
332
  function IconButton(props) {
333
- const { iconType = "default", icon, uiSchema, registry, ...otherProps } = props;
334
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_button2.default, { type: iconType, icon, ...otherProps });
333
+ const { iconType = "default", icon, onClick, uiSchema, registry, ...otherProps } = props;
334
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
335
+ import_button2.default,
336
+ {
337
+ onClick,
338
+ type: iconType,
339
+ icon,
340
+ ...otherProps
341
+ }
342
+ );
335
343
  }
336
344
  function AddButton(props) {
337
345
  const {
@@ -936,25 +944,8 @@ AltDateTimeWidget.defaultProps = {
936
944
  var import_checkbox = __toESM(require("antd/lib/checkbox"));
937
945
  var import_utils11 = require("@rjsf/utils");
938
946
  var import_jsx_runtime15 = require("react/jsx-runtime");
939
- function CheckboxesWidget({
940
- autofocus,
941
- disabled,
942
- formContext,
943
- id,
944
- label,
945
- hideLabel,
946
- onBlur,
947
- onChange,
948
- onFocus,
949
- options,
950
- readonly,
951
- registry,
952
- schema,
953
- uiSchema,
954
- value
955
- }) {
947
+ function CheckboxesWidget({ autofocus, disabled, formContext, id, onBlur, onChange, onFocus, options, readonly, value }) {
956
948
  const { readonlyAsDisabled = true } = formContext;
957
- const TitleFieldTemplate = (0, import_utils11.getTemplate)("TitleFieldTemplate", registry, options);
958
949
  const { enumOptions, enumDisabled, inline, emptyValue } = options;
959
950
  const handleChange = (nextValue) => onChange((0, import_utils11.enumOptionsValueForIndex)(nextValue, enumOptions, emptyValue));
960
951
  const handleBlur = ({ target }) => onBlur(id, (0, import_utils11.enumOptionsValueForIndex)(target.value, enumOptions, emptyValue));
@@ -965,43 +956,31 @@ function CheckboxesWidget({
965
956
  onFocus: !readonly ? handleFocus : void 0
966
957
  };
967
958
  const selectedIndexes = (0, import_utils11.enumOptionsIndexForValue)(value, enumOptions, true);
968
- return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
969
- !hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
970
- TitleFieldTemplate,
971
- {
972
- id: (0, import_utils11.titleId)(id),
973
- title: label,
974
- schema,
975
- uiSchema,
976
- registry
977
- }
978
- ) }),
979
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
980
- import_checkbox.default.Group,
981
- {
982
- disabled: disabled || readonlyAsDisabled && readonly,
983
- name: id,
984
- onChange: !readonly ? handleChange : void 0,
985
- value: selectedIndexes,
986
- ...extraProps,
987
- "aria-describedby": (0, import_utils11.ariaDescribedByIds)(id),
988
- children: Array.isArray(enumOptions) && enumOptions.map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
989
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
990
- import_checkbox.default,
991
- {
992
- id: (0, import_utils11.optionId)(id, i),
993
- name: id,
994
- autoFocus: i === 0 ? autofocus : false,
995
- disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1,
996
- value: String(i),
997
- children: option.label
998
- }
999
- ),
1000
- !inline && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("br", {})
1001
- ] }, i))
1002
- }
1003
- )
1004
- ] }) : null;
959
+ return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
960
+ import_checkbox.default.Group,
961
+ {
962
+ disabled: disabled || readonlyAsDisabled && readonly,
963
+ name: id,
964
+ onChange: !readonly ? handleChange : void 0,
965
+ value: selectedIndexes,
966
+ ...extraProps,
967
+ "aria-describedby": (0, import_utils11.ariaDescribedByIds)(id),
968
+ children: Array.isArray(enumOptions) && enumOptions.map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
969
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
970
+ import_checkbox.default,
971
+ {
972
+ id: (0, import_utils11.optionId)(id, i),
973
+ name: id,
974
+ autoFocus: i === 0 ? autofocus : false,
975
+ disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1,
976
+ value: String(i),
977
+ children: option.label
978
+ }
979
+ ),
980
+ !inline && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("br", {})
981
+ ] }, i))
982
+ }
983
+ ) }) : null;
1005
984
  }
1006
985
 
1007
986
  // src/widgets/CheckboxWidget/index.tsx
@@ -1035,16 +1014,9 @@ function CheckboxWidget(props) {
1035
1014
  }
1036
1015
 
1037
1016
  // src/widgets/DateTimeWidget/index.tsx
1038
- var import_dayjs2 = __toESM(require("dayjs"));
1017
+ var import_dayjs = __toESM(require("dayjs"));
1039
1018
  var import_utils13 = require("@rjsf/utils");
1040
-
1041
- // src/components/DatePicker/index.ts
1042
- var import_dayjs = __toESM(require("rc-picker/lib/generate/dayjs"));
1043
- var import_generatePicker = __toESM(require("antd/lib/date-picker/generatePicker"));
1044
- var DatePicker = (0, import_generatePicker.default)(import_dayjs.default);
1045
- var DatePicker_default = DatePicker;
1046
-
1047
- // src/widgets/DateTimeWidget/index.tsx
1019
+ var import_date_picker = __toESM(require("antd/lib/date-picker"));
1048
1020
  var import_jsx_runtime17 = require("react/jsx-runtime");
1049
1021
  var DATE_PICKER_STYLE = {
1050
1022
  width: "100%"
@@ -1057,7 +1029,7 @@ function DateTimeWidget(props) {
1057
1029
  const handleFocus = () => onFocus(id, value);
1058
1030
  const getPopupContainer = (node) => node.parentNode;
1059
1031
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1060
- DatePicker_default,
1032
+ import_date_picker.default,
1061
1033
  {
1062
1034
  disabled: disabled || readonlyAsDisabled && readonly,
1063
1035
  getPopupContainer,
@@ -1069,15 +1041,16 @@ function DateTimeWidget(props) {
1069
1041
  placeholder,
1070
1042
  showTime: true,
1071
1043
  style: DATE_PICKER_STYLE,
1072
- value: value && (0, import_dayjs2.default)(value),
1044
+ value: value && (0, import_dayjs.default)(value),
1073
1045
  "aria-describedby": (0, import_utils13.ariaDescribedByIds)(id)
1074
1046
  }
1075
1047
  );
1076
1048
  }
1077
1049
 
1078
1050
  // src/widgets/DateWidget/index.tsx
1079
- var import_dayjs3 = __toESM(require("dayjs"));
1051
+ var import_dayjs2 = __toESM(require("dayjs"));
1080
1052
  var import_utils14 = require("@rjsf/utils");
1053
+ var import_date_picker2 = __toESM(require("antd/lib/date-picker"));
1081
1054
  var import_jsx_runtime18 = require("react/jsx-runtime");
1082
1055
  var DATE_PICKER_STYLE2 = {
1083
1056
  width: "100%"
@@ -1090,7 +1063,7 @@ function DateWidget(props) {
1090
1063
  const handleFocus = () => onFocus(id, value);
1091
1064
  const getPopupContainer = (node) => node.parentNode;
1092
1065
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1093
- DatePicker_default,
1066
+ import_date_picker2.default,
1094
1067
  {
1095
1068
  disabled: disabled || readonlyAsDisabled && readonly,
1096
1069
  getPopupContainer,
@@ -1102,7 +1075,7 @@ function DateWidget(props) {
1102
1075
  placeholder,
1103
1076
  showTime: false,
1104
1077
  style: DATE_PICKER_STYLE2,
1105
- value: value && (0, import_dayjs3.default)(value),
1078
+ value: value && (0, import_dayjs2.default)(value),
1106
1079
  "aria-describedby": (0, import_utils14.ariaDescribedByIds)(id)
1107
1080
  }
1108
1081
  );