@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.
package/dist/antd.esm.js CHANGED
@@ -14,6 +14,7 @@ import Space from 'antd/es/space';
14
14
  import ExclamationCircleOutlined from '@ant-design/icons/ExclamationCircleOutlined';
15
15
  import ArrowDownOutlined from '@ant-design/icons/ArrowDownOutlined';
16
16
  import ArrowUpOutlined from '@ant-design/icons/ArrowUpOutlined';
17
+ import CopyOutlined from '@ant-design/icons/CopyOutlined';
17
18
  import DeleteOutlined from '@ant-design/icons/DeleteOutlined';
18
19
  import PlusCircleOutlined from '@ant-design/icons/PlusCircleOutlined';
19
20
  import Form$1 from 'antd/es/form';
@@ -33,7 +34,7 @@ var BTN_GRP_STYLE = {
33
34
  width: '100%'
34
35
  };
35
36
  var BTN_STYLE = {
36
- width: 'calc(100% / 3)'
37
+ width: 'calc(100% / 4)'
37
38
  };
38
39
  /** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
39
40
  *
@@ -42,17 +43,20 @@ var BTN_STYLE = {
42
43
  function ArrayFieldItemTemplate(props) {
43
44
  var children = props.children,
44
45
  disabled = props.disabled,
46
+ hasCopy = props.hasCopy,
45
47
  hasMoveDown = props.hasMoveDown,
46
48
  hasMoveUp = props.hasMoveUp,
47
49
  hasRemove = props.hasRemove,
48
50
  hasToolbar = props.hasToolbar,
49
51
  index = props.index,
52
+ onCopyIndexClick = props.onCopyIndexClick,
50
53
  onDropIndexClick = props.onDropIndexClick,
51
54
  onReorderClick = props.onReorderClick,
52
55
  readonly = props.readonly,
53
56
  registry = props.registry,
54
57
  uiSchema = props.uiSchema;
55
58
  var _registry$templates$B = registry.templates.ButtonTemplates,
59
+ CopyButton = _registry$templates$B.CopyButton,
56
60
  MoveDownButton = _registry$templates$B.MoveDownButton,
57
61
  MoveUpButton = _registry$templates$B.MoveUpButton,
58
62
  RemoveButton = _registry$templates$B.RemoveButton;
@@ -83,6 +87,12 @@ function ArrayFieldItemTemplate(props) {
83
87
  style: BTN_STYLE,
84
88
  uiSchema: uiSchema,
85
89
  registry: registry
90
+ }), hasCopy && jsx(CopyButton, {
91
+ disabled: disabled || readonly,
92
+ onClick: onCopyIndexClick(index),
93
+ style: BTN_STYLE,
94
+ uiSchema: uiSchema,
95
+ registry: registry
86
96
  }), hasRemove && jsx(RemoveButton, {
87
97
  disabled: disabled || readonly,
88
98
  onClick: onDropIndexClick(index),
@@ -366,6 +376,14 @@ function AddButton(props) {
366
376
  icon: jsx(PlusCircleOutlined, {})
367
377
  }));
368
378
  }
379
+ function CopyButton(props) {
380
+ var translateString = props.registry.translateString;
381
+ return jsx(IconButton, _extends({
382
+ title: translateString(TranslatableString.CopyButton)
383
+ }, props, {
384
+ icon: jsx(CopyOutlined, {})
385
+ }));
386
+ }
369
387
  function MoveDownButton(props) {
370
388
  var translateString = props.registry.translateString;
371
389
  return jsx(IconButton, _extends({
@@ -816,6 +834,7 @@ function generateTemplates() {
816
834
  BaseInputTemplate: BaseInputTemplate,
817
835
  ButtonTemplates: {
818
836
  AddButton: AddButton,
837
+ CopyButton: CopyButton,
819
838
  MoveDownButton: MoveDownButton,
820
839
  MoveUpButton: MoveUpButton,
821
840
  RemoveButton: RemoveButton,