@rjsf/antd 5.2.1 → 5.3.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.
@@ -18,6 +18,7 @@ var Space = require('antd/lib/space');
18
18
  var ExclamationCircleOutlined = require('@ant-design/icons/ExclamationCircleOutlined');
19
19
  var ArrowDownOutlined = require('@ant-design/icons/ArrowDownOutlined');
20
20
  var ArrowUpOutlined = require('@ant-design/icons/ArrowUpOutlined');
21
+ var CopyOutlined = require('@ant-design/icons/CopyOutlined');
21
22
  var DeleteOutlined = require('@ant-design/icons/DeleteOutlined');
22
23
  var PlusCircleOutlined = require('@ant-design/icons/PlusCircleOutlined');
23
24
  var Form$1 = require('antd/lib/form');
@@ -47,6 +48,7 @@ var Space__default = /*#__PURE__*/_interopDefaultLegacy(Space);
47
48
  var ExclamationCircleOutlined__default = /*#__PURE__*/_interopDefaultLegacy(ExclamationCircleOutlined);
48
49
  var ArrowDownOutlined__default = /*#__PURE__*/_interopDefaultLegacy(ArrowDownOutlined);
49
50
  var ArrowUpOutlined__default = /*#__PURE__*/_interopDefaultLegacy(ArrowUpOutlined);
51
+ var CopyOutlined__default = /*#__PURE__*/_interopDefaultLegacy(CopyOutlined);
50
52
  var DeleteOutlined__default = /*#__PURE__*/_interopDefaultLegacy(DeleteOutlined);
51
53
  var PlusCircleOutlined__default = /*#__PURE__*/_interopDefaultLegacy(PlusCircleOutlined);
52
54
  var Form__default = /*#__PURE__*/_interopDefaultLegacy(Form$1);
@@ -65,7 +67,7 @@ var BTN_GRP_STYLE = {
65
67
  width: '100%'
66
68
  };
67
69
  var BTN_STYLE = {
68
- width: 'calc(100% / 3)'
70
+ width: 'calc(100% / 4)'
69
71
  };
70
72
  /** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
71
73
  *
@@ -74,17 +76,20 @@ var BTN_STYLE = {
74
76
  function ArrayFieldItemTemplate(props) {
75
77
  var children = props.children,
76
78
  disabled = props.disabled,
79
+ hasCopy = props.hasCopy,
77
80
  hasMoveDown = props.hasMoveDown,
78
81
  hasMoveUp = props.hasMoveUp,
79
82
  hasRemove = props.hasRemove,
80
83
  hasToolbar = props.hasToolbar,
81
84
  index = props.index,
85
+ onCopyIndexClick = props.onCopyIndexClick,
82
86
  onDropIndexClick = props.onDropIndexClick,
83
87
  onReorderClick = props.onReorderClick,
84
88
  readonly = props.readonly,
85
89
  registry = props.registry,
86
90
  uiSchema = props.uiSchema;
87
91
  var _registry$templates$B = registry.templates.ButtonTemplates,
92
+ CopyButton = _registry$templates$B.CopyButton,
88
93
  MoveDownButton = _registry$templates$B.MoveDownButton,
89
94
  MoveUpButton = _registry$templates$B.MoveUpButton,
90
95
  RemoveButton = _registry$templates$B.RemoveButton;
@@ -115,6 +120,12 @@ function ArrayFieldItemTemplate(props) {
115
120
  style: BTN_STYLE,
116
121
  uiSchema: uiSchema,
117
122
  registry: registry
123
+ }), hasCopy && jsxRuntime.jsx(CopyButton, {
124
+ disabled: disabled || readonly,
125
+ onClick: onCopyIndexClick(index),
126
+ style: BTN_STYLE,
127
+ uiSchema: uiSchema,
128
+ registry: registry
118
129
  }), hasRemove && jsxRuntime.jsx(RemoveButton, {
119
130
  disabled: disabled || readonly,
120
131
  onClick: onDropIndexClick(index),
@@ -398,6 +409,14 @@ function AddButton(props) {
398
409
  icon: jsxRuntime.jsx(PlusCircleOutlined__default["default"], {})
399
410
  }));
400
411
  }
412
+ function CopyButton(props) {
413
+ var translateString = props.registry.translateString;
414
+ return jsxRuntime.jsx(IconButton, _extends({
415
+ title: translateString(utils.TranslatableString.CopyButton)
416
+ }, props, {
417
+ icon: jsxRuntime.jsx(CopyOutlined__default["default"], {})
418
+ }));
419
+ }
401
420
  function MoveDownButton(props) {
402
421
  var translateString = props.registry.translateString;
403
422
  return jsxRuntime.jsx(IconButton, _extends({
@@ -848,6 +867,7 @@ function generateTemplates() {
848
867
  BaseInputTemplate: BaseInputTemplate,
849
868
  ButtonTemplates: {
850
869
  AddButton: AddButton,
870
+ CopyButton: CopyButton,
851
871
  MoveDownButton: MoveDownButton,
852
872
  MoveUpButton: MoveUpButton,
853
873
  RemoveButton: RemoveButton,