@rjsf/antd 5.11.1 → 5.12.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.
Files changed (124) hide show
  1. package/dist/antd.esm.js +908 -1103
  2. package/dist/antd.esm.js.map +7 -1
  3. package/dist/antd.umd.js +1213 -0
  4. package/dist/index.js +1376 -5
  5. package/dist/index.js.map +7 -0
  6. package/lib/components/DatePicker/index.d.ts +48 -0
  7. package/lib/components/DatePicker/index.js +5 -0
  8. package/lib/components/DatePicker/index.js.map +1 -0
  9. package/lib/index.d.ts +11 -0
  10. package/lib/index.js +17 -0
  11. package/lib/index.js.map +1 -0
  12. package/lib/templates/ArrayFieldItemTemplate/index.d.ts +7 -0
  13. package/lib/templates/ArrayFieldItemTemplate/index.js +21 -0
  14. package/lib/templates/ArrayFieldItemTemplate/index.js.map +1 -0
  15. package/lib/templates/ArrayFieldTemplate/index.d.ts +7 -0
  16. package/lib/templates/ArrayFieldTemplate/index.js +38 -0
  17. package/lib/templates/ArrayFieldTemplate/index.js.map +1 -0
  18. package/lib/templates/BaseInputTemplate/index.d.ts +9 -0
  19. package/lib/templates/BaseInputTemplate/index.js +31 -0
  20. package/lib/templates/BaseInputTemplate/index.js.map +1 -0
  21. package/lib/templates/DescriptionField/index.d.ts +7 -0
  22. package/lib/templates/DescriptionField/index.js +13 -0
  23. package/lib/templates/DescriptionField/index.js.map +1 -0
  24. package/lib/templates/ErrorList/index.d.ts +7 -0
  25. package/lib/templates/ErrorList/index.js +16 -0
  26. package/lib/templates/ErrorList/index.js.map +1 -0
  27. package/lib/templates/FieldErrorTemplate/index.d.ts +7 -0
  28. package/lib/templates/FieldErrorTemplate/index.js +15 -0
  29. package/lib/templates/FieldErrorTemplate/index.js.map +1 -0
  30. package/lib/templates/FieldTemplate/index.d.ts +8 -0
  31. package/lib/templates/FieldTemplate/index.js +34 -0
  32. package/lib/templates/FieldTemplate/index.js.map +1 -0
  33. package/lib/templates/IconButton/index.d.ts +10 -0
  34. package/lib/templates/IconButton/index.js +36 -0
  35. package/lib/templates/IconButton/index.js.map +1 -0
  36. package/lib/templates/ObjectFieldTemplate/index.d.ts +9 -0
  37. package/lib/templates/ObjectFieldTemplate/index.js +71 -0
  38. package/lib/templates/ObjectFieldTemplate/index.js.map +1 -0
  39. package/lib/templates/SubmitButton/index.d.ts +5 -0
  40. package/lib/templates/SubmitButton/index.js +13 -0
  41. package/lib/templates/SubmitButton/index.js.map +1 -0
  42. package/lib/templates/TitleField/index.d.ts +7 -0
  43. package/lib/templates/TitleField/index.js +34 -0
  44. package/lib/templates/TitleField/index.js.map +1 -0
  45. package/lib/templates/WrapIfAdditionalTemplate/index.d.ts +8 -0
  46. package/lib/templates/WrapIfAdditionalTemplate/index.js +34 -0
  47. package/lib/templates/WrapIfAdditionalTemplate/index.js.map +1 -0
  48. package/lib/templates/index.d.ts +4 -0
  49. package/lib/templates/index.js +36 -0
  50. package/lib/templates/index.js.map +1 -0
  51. package/lib/widgets/AltDateTimeWidget/index.d.ts +15 -0
  52. package/lib/widgets/AltDateTimeWidget/index.js +8 -0
  53. package/lib/widgets/AltDateTimeWidget/index.js.map +1 -0
  54. package/lib/widgets/AltDateWidget/index.d.ts +15 -0
  55. package/lib/widgets/AltDateWidget/index.js +89 -0
  56. package/lib/widgets/AltDateWidget/index.js.map +1 -0
  57. package/lib/widgets/CheckboxWidget/index.d.ts +8 -0
  58. package/lib/widgets/CheckboxWidget/index.js +23 -0
  59. package/lib/widgets/CheckboxWidget/index.js.map +1 -0
  60. package/lib/widgets/CheckboxesWidget/index.d.ts +8 -0
  61. package/lib/widgets/CheckboxesWidget/index.js +27 -0
  62. package/lib/widgets/CheckboxesWidget/index.js.map +1 -0
  63. package/lib/widgets/DateTimeWidget/index.d.ts +8 -0
  64. package/lib/widgets/DateTimeWidget/index.js +22 -0
  65. package/lib/widgets/DateTimeWidget/index.js.map +1 -0
  66. package/lib/widgets/DateWidget/index.d.ts +8 -0
  67. package/lib/widgets/DateWidget/index.js +22 -0
  68. package/lib/widgets/DateWidget/index.js.map +1 -0
  69. package/lib/widgets/PasswordWidget/index.d.ts +7 -0
  70. package/lib/widgets/PasswordWidget/index.js +17 -0
  71. package/lib/widgets/PasswordWidget/index.js.map +1 -0
  72. package/lib/widgets/RadioWidget/index.d.ts +8 -0
  73. package/lib/widgets/RadioWidget/index.js +19 -0
  74. package/lib/widgets/RadioWidget/index.js.map +1 -0
  75. package/lib/widgets/RangeWidget/index.d.ts +8 -0
  76. package/lib/widgets/RangeWidget/index.js +26 -0
  77. package/lib/widgets/RangeWidget/index.js.map +1 -0
  78. package/lib/widgets/SelectWidget/index.d.ts +8 -0
  79. package/lib/widgets/SelectWidget/index.js +36 -0
  80. package/lib/widgets/SelectWidget/index.js.map +1 -0
  81. package/lib/widgets/TextareaWidget/index.d.ts +7 -0
  82. package/lib/widgets/TextareaWidget/index.js +23 -0
  83. package/lib/widgets/TextareaWidget/index.js.map +1 -0
  84. package/lib/widgets/index.d.ts +4 -0
  85. package/lib/widgets/index.js +28 -0
  86. package/lib/widgets/index.js.map +1 -0
  87. package/package.json +24 -16
  88. package/src/components/DatePicker/index.ts +6 -0
  89. package/src/index.less +38 -0
  90. package/src/index.ts +33 -0
  91. package/src/templates/ArrayFieldItemTemplate/index.tsx +90 -0
  92. package/src/templates/ArrayFieldTemplate/index.tsx +132 -0
  93. package/src/templates/BaseInputTemplate/index.tsx +105 -0
  94. package/src/templates/DescriptionField/index.tsx +17 -0
  95. package/src/templates/ErrorList/index.tsx +37 -0
  96. package/src/templates/FieldErrorTemplate/index.tsx +25 -0
  97. package/src/templates/FieldTemplate/index.tsx +114 -0
  98. package/src/templates/IconButton/index.tsx +94 -0
  99. package/src/templates/ObjectFieldTemplate/index.tsx +175 -0
  100. package/src/templates/SubmitButton/index.tsx +20 -0
  101. package/src/templates/TitleField/index.tsx +57 -0
  102. package/src/templates/WrapIfAdditionalTemplate/index.tsx +124 -0
  103. package/src/templates/index.ts +43 -0
  104. package/src/widgets/AltDateTimeWidget/index.tsx +17 -0
  105. package/src/widgets/AltDateWidget/index.tsx +197 -0
  106. package/src/widgets/CheckboxWidget/index.tsx +52 -0
  107. package/src/widgets/CheckboxesWidget/index.tsx +105 -0
  108. package/src/widgets/DateTimeWidget/index.tsx +54 -0
  109. package/src/widgets/DateWidget/index.tsx +52 -0
  110. package/src/widgets/PasswordWidget/index.tsx +46 -0
  111. package/src/widgets/RadioWidget/index.tsx +73 -0
  112. package/src/widgets/RangeWidget/index.tsx +69 -0
  113. package/src/widgets/SelectWidget/index.tsx +97 -0
  114. package/src/widgets/TextareaWidget/index.tsx +67 -0
  115. package/src/widgets/index.ts +35 -0
  116. package/dist/antd.cjs.development.js +0 -1643
  117. package/dist/antd.cjs.development.js.map +0 -1
  118. package/dist/antd.cjs.production.min.js +0 -2
  119. package/dist/antd.cjs.production.min.js.map +0 -1
  120. package/dist/antd.umd.development.js +0 -1617
  121. package/dist/antd.umd.development.js.map +0 -1
  122. package/dist/antd.umd.production.min.js +0 -2
  123. package/dist/antd.umd.production.min.js.map +0 -1
  124. package/dist/index.d.ts +0 -16
package/dist/antd.esm.js CHANGED
@@ -1,45 +1,17 @@
1
- import { withTheme } from '@rjsf/core';
2
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
- import Button from 'antd/es/button';
4
- import Col from 'antd/es/col';
5
- import Row from 'antd/es/row';
6
- import { getUiOptions, getTemplate, getInputProps, examplesId, ariaDescribedByIds, TranslatableString, errorId, titleId, descriptionId, canExpand, getSubmitButtonOptions, ADDITIONAL_PROPERTY_FLAG, UI_OPTIONS_KEY, parseDateString, toDateString, pad, enumOptionsIndexForValue, optionId, enumOptionsValueForIndex, labelValue, rangeSpec } from '@rjsf/utils';
7
- import classNames from 'classnames';
8
- import { ConfigConsumer } from 'antd/es/config-provider/context';
9
- import Input from 'antd/es/input';
10
- import InputNumber from 'antd/es/input-number';
11
- import Alert from 'antd/es/alert';
12
- import List from 'antd/es/list';
13
- import Space from 'antd/es/space';
14
- import ExclamationCircleOutlined from '@ant-design/icons/ExclamationCircleOutlined';
15
- import ArrowDownOutlined from '@ant-design/icons/ArrowDownOutlined';
16
- import ArrowUpOutlined from '@ant-design/icons/ArrowUpOutlined';
17
- import CopyOutlined from '@ant-design/icons/CopyOutlined';
18
- import DeleteOutlined from '@ant-design/icons/DeleteOutlined';
19
- import PlusCircleOutlined from '@ant-design/icons/PlusCircleOutlined';
20
- import Form$1 from 'antd/es/form';
21
- import isObject from 'lodash-es/isObject';
22
- import isNumber from 'lodash-es/isNumber';
23
- import isString from 'lodash-es/isString';
24
- import { useState, useEffect } from 'react';
25
- import Checkbox from 'antd/es/checkbox';
26
- import dayjs from 'dayjs';
27
- import dayjsGenerateConfig from 'rc-picker/es/generate/dayjs';
28
- import generatePicker from 'antd/es/date-picker/generatePicker';
29
- import Radio from 'antd/es/radio';
30
- import Slider from 'antd/es/slider';
31
- import Select from 'antd/es/select';
1
+ // src/index.ts
2
+ import { withTheme } from "@rjsf/core";
32
3
 
33
- const BTN_GRP_STYLE = {
34
- width: '100%'
4
+ // src/templates/ArrayFieldItemTemplate/index.tsx
5
+ import Button from "antd/lib/button";
6
+ import Col from "antd/lib/col";
7
+ import Row from "antd/lib/row";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ var BTN_GRP_STYLE = {
10
+ width: "100%"
35
11
  };
36
- const BTN_STYLE = {
37
- width: 'calc(100% / 4)'
12
+ var BTN_STYLE = {
13
+ width: "calc(100% / 4)"
38
14
  };
39
- /** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
40
- *
41
- * @param props - The `ArrayFieldTemplateItemType` props for the component
42
- */
43
15
  function ArrayFieldItemTemplate(props) {
44
16
  const {
45
17
  children,
@@ -57,63 +29,68 @@ function ArrayFieldItemTemplate(props) {
57
29
  registry,
58
30
  uiSchema
59
31
  } = props;
60
- const {
61
- CopyButton,
62
- MoveDownButton,
63
- MoveUpButton,
64
- RemoveButton
65
- } = registry.templates.ButtonTemplates;
66
- const {
67
- rowGutter = 24,
68
- toolbarAlign = 'top'
69
- } = registry.formContext;
70
- return jsxs(Row, {
71
- align: toolbarAlign,
72
- gutter: rowGutter,
73
- children: [jsx(Col, {
74
- flex: '1',
75
- children: children
76
- }), hasToolbar && jsx(Col, {
77
- flex: '192px',
78
- children: jsxs(Button.Group, {
79
- style: BTN_GRP_STYLE,
80
- children: [(hasMoveUp || hasMoveDown) && jsx(MoveUpButton, {
32
+ const { CopyButton: CopyButton2, MoveDownButton: MoveDownButton2, MoveUpButton: MoveUpButton2, RemoveButton: RemoveButton2 } = registry.templates.ButtonTemplates;
33
+ const { rowGutter = 24, toolbarAlign = "top" } = registry.formContext;
34
+ return /* @__PURE__ */ jsxs(Row, { align: toolbarAlign, gutter: rowGutter, children: [
35
+ /* @__PURE__ */ jsx(Col, { flex: "1", children }),
36
+ hasToolbar && /* @__PURE__ */ jsx(Col, { flex: "192px", children: /* @__PURE__ */ jsxs(Button.Group, { style: BTN_GRP_STYLE, children: [
37
+ (hasMoveUp || hasMoveDown) && /* @__PURE__ */ jsx(
38
+ MoveUpButton2,
39
+ {
81
40
  disabled: disabled || readonly || !hasMoveUp,
82
41
  onClick: onReorderClick(index, index - 1),
83
42
  style: BTN_STYLE,
84
- uiSchema: uiSchema,
85
- registry: registry
86
- }), (hasMoveUp || hasMoveDown) && jsx(MoveDownButton, {
43
+ uiSchema,
44
+ registry
45
+ }
46
+ ),
47
+ (hasMoveUp || hasMoveDown) && /* @__PURE__ */ jsx(
48
+ MoveDownButton2,
49
+ {
87
50
  disabled: disabled || readonly || !hasMoveDown,
88
51
  onClick: onReorderClick(index, index + 1),
89
52
  style: BTN_STYLE,
90
- uiSchema: uiSchema,
91
- registry: registry
92
- }), hasCopy && jsx(CopyButton, {
53
+ uiSchema,
54
+ registry
55
+ }
56
+ ),
57
+ hasCopy && /* @__PURE__ */ jsx(
58
+ CopyButton2,
59
+ {
93
60
  disabled: disabled || readonly,
94
61
  onClick: onCopyIndexClick(index),
95
62
  style: BTN_STYLE,
96
- uiSchema: uiSchema,
97
- registry: registry
98
- }), hasRemove && jsx(RemoveButton, {
63
+ uiSchema,
64
+ registry
65
+ }
66
+ ),
67
+ hasRemove && /* @__PURE__ */ jsx(
68
+ RemoveButton2,
69
+ {
99
70
  disabled: disabled || readonly,
100
71
  onClick: onDropIndexClick(index),
101
72
  style: BTN_STYLE,
102
- uiSchema: uiSchema,
103
- registry: registry
104
- })]
105
- })
106
- })]
107
- }, `array-item-${index}`);
73
+ uiSchema,
74
+ registry
75
+ }
76
+ )
77
+ ] }) })
78
+ ] }, `array-item-${index}`);
108
79
  }
109
80
 
110
- const DESCRIPTION_COL_STYLE$1 = {
111
- paddingBottom: '8px'
81
+ // src/templates/ArrayFieldTemplate/index.tsx
82
+ import {
83
+ getTemplate,
84
+ getUiOptions
85
+ } from "@rjsf/utils";
86
+ import classNames from "classnames";
87
+ import Col2 from "antd/lib/col";
88
+ import Row2 from "antd/lib/row";
89
+ import { ConfigConsumer } from "antd/lib/config-provider/context";
90
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
91
+ var DESCRIPTION_COL_STYLE = {
92
+ paddingBottom: "8px"
112
93
  };
113
- /** The `ArrayFieldTemplate` component is the template used to render all items in an array.
114
- *
115
- * @param props - The `ArrayFieldTemplateItemType` props for the component
116
- */
117
94
  function ArrayFieldTemplate(props) {
118
95
  const {
119
96
  canAdd,
@@ -131,97 +108,83 @@ function ArrayFieldTemplate(props) {
131
108
  uiSchema
132
109
  } = props;
133
110
  const uiOptions = getUiOptions(uiSchema);
134
- const ArrayFieldDescriptionTemplate = getTemplate('ArrayFieldDescriptionTemplate', registry, uiOptions);
135
- const ArrayFieldItemTemplate = getTemplate('ArrayFieldItemTemplate', registry, uiOptions);
136
- const ArrayFieldTitleTemplate = getTemplate('ArrayFieldTitleTemplate', registry, uiOptions);
137
- // Button templates are not overridden in the uiSchema
111
+ const ArrayFieldDescriptionTemplate = getTemplate(
112
+ "ArrayFieldDescriptionTemplate",
113
+ registry,
114
+ uiOptions
115
+ );
116
+ const ArrayFieldItemTemplate2 = getTemplate(
117
+ "ArrayFieldItemTemplate",
118
+ registry,
119
+ uiOptions
120
+ );
121
+ const ArrayFieldTitleTemplate = getTemplate(
122
+ "ArrayFieldTitleTemplate",
123
+ registry,
124
+ uiOptions
125
+ );
138
126
  const {
139
- ButtonTemplates: {
140
- AddButton
141
- }
127
+ ButtonTemplates: { AddButton: AddButton2 }
142
128
  } = registry.templates;
143
- const {
144
- labelAlign = 'right',
145
- rowGutter = 24
146
- } = formContext;
147
- return jsx(ConfigConsumer, {
148
- children: configProps => {
149
- const {
150
- getPrefixCls
151
- } = configProps;
152
- const prefixCls = getPrefixCls('form');
153
- const labelClsBasic = `${prefixCls}-item-label`;
154
- const labelColClassName = classNames(labelClsBasic, labelAlign === 'left' && `${labelClsBasic}-left`
129
+ const { labelAlign = "right", rowGutter = 24 } = formContext;
130
+ return /* @__PURE__ */ jsx2(ConfigConsumer, { children: (configProps) => {
131
+ const { getPrefixCls } = configProps;
132
+ const prefixCls = getPrefixCls("form");
133
+ const labelClsBasic = `${prefixCls}-item-label`;
134
+ const labelColClassName = classNames(
135
+ labelClsBasic,
136
+ labelAlign === "left" && `${labelClsBasic}-left`
155
137
  // labelCol.className,
156
- );
157
-
158
- return jsx("fieldset", {
159
- className: className,
160
- id: idSchema.$id,
161
- children: jsxs(Row, {
162
- gutter: rowGutter,
163
- children: [(uiOptions.title || title) && jsx(Col, {
164
- className: labelColClassName,
165
- span: 24,
166
- children: jsx(ArrayFieldTitleTemplate, {
167
- idSchema: idSchema,
168
- required: required,
169
- title: uiOptions.title || title,
170
- schema: schema,
171
- uiSchema: uiSchema,
172
- registry: registry
173
- })
174
- }), (uiOptions.description || schema.description) && jsx(Col, {
175
- span: 24,
176
- style: DESCRIPTION_COL_STYLE$1,
177
- children: jsx(ArrayFieldDescriptionTemplate, {
178
- description: uiOptions.description || schema.description,
179
- idSchema: idSchema,
180
- schema: schema,
181
- uiSchema: uiSchema,
182
- registry: registry
183
- })
184
- }), jsx(Col, {
185
- className: 'row array-item-list',
186
- span: 24,
187
- children: items && items.map(({
188
- key,
189
- ...itemProps
190
- }) => jsx(ArrayFieldItemTemplate, {
191
- ...itemProps
192
- }, key))
193
- }), canAdd && jsx(Col, {
194
- span: 24,
195
- children: jsx(Row, {
196
- gutter: rowGutter,
197
- justify: 'end',
198
- children: jsx(Col, {
199
- flex: '192px',
200
- children: jsx(AddButton, {
201
- className: 'array-item-add',
202
- disabled: disabled || readonly,
203
- onClick: onAddClick,
204
- uiSchema: uiSchema,
205
- registry: registry
206
- })
207
- })
208
- })
209
- })]
210
- })
211
- });
212
- }
213
- });
138
+ );
139
+ return /* @__PURE__ */ jsx2("fieldset", { className, id: idSchema.$id, children: /* @__PURE__ */ jsxs2(Row2, { gutter: rowGutter, children: [
140
+ (uiOptions.title || title) && /* @__PURE__ */ jsx2(Col2, { className: labelColClassName, span: 24, children: /* @__PURE__ */ jsx2(
141
+ ArrayFieldTitleTemplate,
142
+ {
143
+ idSchema,
144
+ required,
145
+ title: uiOptions.title || title,
146
+ schema,
147
+ uiSchema,
148
+ registry
149
+ }
150
+ ) }),
151
+ (uiOptions.description || schema.description) && /* @__PURE__ */ jsx2(Col2, { span: 24, style: DESCRIPTION_COL_STYLE, children: /* @__PURE__ */ jsx2(
152
+ ArrayFieldDescriptionTemplate,
153
+ {
154
+ description: uiOptions.description || schema.description,
155
+ idSchema,
156
+ schema,
157
+ uiSchema,
158
+ registry
159
+ }
160
+ ) }),
161
+ /* @__PURE__ */ jsx2(Col2, { className: "row array-item-list", span: 24, children: items && items.map(({ key, ...itemProps }) => /* @__PURE__ */ jsx2(ArrayFieldItemTemplate2, { ...itemProps }, key)) }),
162
+ canAdd && /* @__PURE__ */ jsx2(Col2, { span: 24, children: /* @__PURE__ */ jsx2(Row2, { gutter: rowGutter, justify: "end", children: /* @__PURE__ */ jsx2(Col2, { flex: "192px", children: /* @__PURE__ */ jsx2(
163
+ AddButton2,
164
+ {
165
+ className: "array-item-add",
166
+ disabled: disabled || readonly,
167
+ onClick: onAddClick,
168
+ uiSchema,
169
+ registry
170
+ }
171
+ ) }) }) })
172
+ ] }) });
173
+ } });
214
174
  }
215
175
 
216
- const INPUT_STYLE$2 = {
217
- width: '100%'
176
+ // src/templates/BaseInputTemplate/index.tsx
177
+ import Input from "antd/lib/input";
178
+ import InputNumber from "antd/lib/input-number";
179
+ import {
180
+ ariaDescribedByIds,
181
+ examplesId,
182
+ getInputProps
183
+ } from "@rjsf/utils";
184
+ import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
185
+ var INPUT_STYLE = {
186
+ width: "100%"
218
187
  };
219
- /** The `BaseInputTemplate` is the template to use to render the basic `<input>` component for the `core` theme.
220
- * It is used as the template for rendering many of the <input> based widgets that differ by `type` and callbacks only.
221
- * It can be customized/overridden for other themes or individual implementations as needed.
222
- *
223
- * @param props - The `WidgetProps` for this template
224
- */
225
188
  function BaseInputTemplate(props) {
226
189
  const {
227
190
  disabled,
@@ -239,222 +202,181 @@ function BaseInputTemplate(props) {
239
202
  type
240
203
  } = props;
241
204
  const inputProps = getInputProps(schema, type, options, false);
242
- const {
243
- readonlyAsDisabled = true
244
- } = formContext;
245
- const handleNumberChange = nextValue => onChange(nextValue);
246
- const handleTextChange = onChangeOverride ? onChangeOverride : ({
247
- target
248
- }) => onChange(target.value === '' ? options.emptyValue : target.value);
249
- const handleBlur = ({
250
- target
251
- }) => onBlur(id, target.value);
252
- const handleFocus = ({
253
- target
254
- }) => onFocus(id, target.value);
255
- const input = inputProps.type === 'number' || inputProps.type === 'integer' ? jsx(InputNumber, {
256
- disabled: disabled || readonlyAsDisabled && readonly,
257
- id: id,
258
- name: id,
259
- onBlur: !readonly ? handleBlur : undefined,
260
- onChange: !readonly ? handleNumberChange : undefined,
261
- onFocus: !readonly ? handleFocus : undefined,
262
- placeholder: placeholder,
263
- style: INPUT_STYLE$2,
264
- list: schema.examples ? examplesId(id) : undefined,
265
- ...inputProps,
266
- value: value,
267
- "aria-describedby": ariaDescribedByIds(id, !!schema.examples)
268
- }) : jsx(Input, {
269
- disabled: disabled || readonlyAsDisabled && readonly,
270
- id: id,
271
- name: id,
272
- onBlur: !readonly ? handleBlur : undefined,
273
- onChange: !readonly ? handleTextChange : undefined,
274
- onFocus: !readonly ? handleFocus : undefined,
275
- placeholder: placeholder,
276
- style: INPUT_STYLE$2,
277
- list: schema.examples ? examplesId(id) : undefined,
278
- ...inputProps,
279
- value: value,
280
- "aria-describedby": ariaDescribedByIds(id, !!schema.examples)
281
- });
282
- return jsxs(Fragment, {
283
- children: [input, Array.isArray(schema.examples) && jsx("datalist", {
284
- id: examplesId(id),
285
- children: schema.examples.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : []).map(example => {
286
- return jsx("option", {
287
- value: example
288
- }, example);
289
- })
290
- })]
291
- });
205
+ const { readonlyAsDisabled = true } = formContext;
206
+ const handleNumberChange = (nextValue) => onChange(nextValue);
207
+ const handleTextChange = onChangeOverride ? onChangeOverride : ({ target }) => onChange(target.value === "" ? options.emptyValue : target.value);
208
+ const handleBlur = ({ target }) => onBlur(id, target.value);
209
+ const handleFocus = ({ target }) => onFocus(id, target.value);
210
+ const input = inputProps.type === "number" || inputProps.type === "integer" ? /* @__PURE__ */ jsx3(
211
+ InputNumber,
212
+ {
213
+ disabled: disabled || readonlyAsDisabled && readonly,
214
+ id,
215
+ name: id,
216
+ onBlur: !readonly ? handleBlur : void 0,
217
+ onChange: !readonly ? handleNumberChange : void 0,
218
+ onFocus: !readonly ? handleFocus : void 0,
219
+ placeholder,
220
+ style: INPUT_STYLE,
221
+ list: schema.examples ? examplesId(id) : void 0,
222
+ ...inputProps,
223
+ value,
224
+ "aria-describedby": ariaDescribedByIds(id, !!schema.examples)
225
+ }
226
+ ) : /* @__PURE__ */ jsx3(
227
+ Input,
228
+ {
229
+ disabled: disabled || readonlyAsDisabled && readonly,
230
+ id,
231
+ name: id,
232
+ onBlur: !readonly ? handleBlur : void 0,
233
+ onChange: !readonly ? handleTextChange : void 0,
234
+ onFocus: !readonly ? handleFocus : void 0,
235
+ placeholder,
236
+ style: INPUT_STYLE,
237
+ list: schema.examples ? examplesId(id) : void 0,
238
+ ...inputProps,
239
+ value,
240
+ "aria-describedby": ariaDescribedByIds(id, !!schema.examples)
241
+ }
242
+ );
243
+ return /* @__PURE__ */ jsxs3(Fragment, { children: [
244
+ input,
245
+ Array.isArray(schema.examples) && /* @__PURE__ */ jsx3("datalist", { id: examplesId(id), children: schema.examples.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : []).map((example) => {
246
+ return /* @__PURE__ */ jsx3("option", { value: example }, example);
247
+ }) })
248
+ ] });
292
249
  }
293
250
 
294
- /** The `DescriptionField` is the template to use to render the description of a field
295
- *
296
- * @param props - The `DescriptionFieldProps` for this component
297
- */
251
+ // src/templates/DescriptionField/index.tsx
252
+ import { jsx as jsx4 } from "react/jsx-runtime";
298
253
  function DescriptionField(props) {
299
- const {
300
- id,
301
- description
302
- } = props;
254
+ const { id, description } = props;
303
255
  if (!description) {
304
256
  return null;
305
257
  }
306
- return jsx("span", {
307
- id: id,
308
- children: description
309
- });
258
+ return /* @__PURE__ */ jsx4("span", { id, children: description });
310
259
  }
311
260
 
312
- /** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form`
313
- *
314
- * @param props - The `ErrorListProps` for this component
315
- */
261
+ // src/templates/ErrorList/index.tsx
262
+ import Alert from "antd/lib/alert";
263
+ import List from "antd/lib/list";
264
+ import Space from "antd/lib/space";
265
+ import ExclamationCircleOutlined from "@ant-design/icons/ExclamationCircleOutlined";
266
+ import { TranslatableString } from "@rjsf/utils";
267
+ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
316
268
  function ErrorList({
317
269
  errors,
318
270
  registry
319
271
  }) {
320
- const {
321
- translateString
322
- } = registry;
323
- const renderErrors = () => jsx(List, {
324
- className: 'list-group',
325
- size: 'small',
326
- children: errors.map((error, index) => jsx(List.Item, {
327
- children: jsxs(Space, {
328
- children: [jsx(ExclamationCircleOutlined, {}), error.stack]
329
- })
330
- }, index))
331
- });
332
- return jsx(Alert, {
333
- className: 'panel panel-danger errors',
334
- description: renderErrors(),
335
- message: translateString(TranslatableString.ErrorsLabel),
336
- type: 'error'
337
- });
272
+ const { translateString } = registry;
273
+ const renderErrors = () => /* @__PURE__ */ jsx5(List, { className: "list-group", size: "small", children: errors.map((error, index) => /* @__PURE__ */ jsx5(List.Item, { children: /* @__PURE__ */ jsxs4(Space, { children: [
274
+ /* @__PURE__ */ jsx5(ExclamationCircleOutlined, {}),
275
+ error.stack
276
+ ] }) }, index)) });
277
+ return /* @__PURE__ */ jsx5(
278
+ Alert,
279
+ {
280
+ className: "panel panel-danger errors",
281
+ description: renderErrors(),
282
+ message: translateString(TranslatableString.ErrorsLabel),
283
+ type: "error"
284
+ }
285
+ );
338
286
  }
339
287
 
288
+ // src/templates/IconButton/index.tsx
289
+ import Button2 from "antd/lib/button";
290
+ import ArrowDownOutlined from "@ant-design/icons/ArrowDownOutlined";
291
+ import ArrowUpOutlined from "@ant-design/icons/ArrowUpOutlined";
292
+ import CopyOutlined from "@ant-design/icons/CopyOutlined";
293
+ import DeleteOutlined from "@ant-design/icons/DeleteOutlined";
294
+ import PlusCircleOutlined from "@ant-design/icons/PlusCircleOutlined";
295
+ import {
296
+ getUiOptions as getUiOptions2,
297
+ TranslatableString as TranslatableString2
298
+ } from "@rjsf/utils";
299
+ import { jsx as jsx6 } from "react/jsx-runtime";
340
300
  function IconButton(props) {
341
- const {
342
- iconType = 'default',
343
- icon,
344
- uiSchema,
345
- registry,
346
- ...otherProps
347
- } = props;
348
- return jsx(Button, {
349
- type: iconType,
350
- icon: icon,
351
- ...otherProps
352
- });
301
+ const { iconType = "default", icon, uiSchema, registry, ...otherProps } = props;
302
+ return /* @__PURE__ */ jsx6(Button2, { type: iconType, icon, ...otherProps });
353
303
  }
354
304
  function AddButton(props) {
355
305
  const {
356
- registry: {
357
- translateString
358
- }
306
+ registry: { translateString }
359
307
  } = props;
360
- return jsx(IconButton, {
361
- title: translateString(TranslatableString.AddItemButton),
362
- ...props,
363
- block: true,
364
- iconType: 'primary',
365
- icon: jsx(PlusCircleOutlined, {})
366
- });
308
+ return /* @__PURE__ */ jsx6(
309
+ IconButton,
310
+ {
311
+ title: translateString(TranslatableString2.AddItemButton),
312
+ ...props,
313
+ block: true,
314
+ iconType: "primary",
315
+ icon: /* @__PURE__ */ jsx6(PlusCircleOutlined, {})
316
+ }
317
+ );
367
318
  }
368
319
  function CopyButton(props) {
369
320
  const {
370
- registry: {
371
- translateString
372
- }
321
+ registry: { translateString }
373
322
  } = props;
374
- return jsx(IconButton, {
375
- title: translateString(TranslatableString.CopyButton),
376
- ...props,
377
- icon: jsx(CopyOutlined, {})
378
- });
323
+ return /* @__PURE__ */ jsx6(IconButton, { title: translateString(TranslatableString2.CopyButton), ...props, icon: /* @__PURE__ */ jsx6(CopyOutlined, {}) });
379
324
  }
380
325
  function MoveDownButton(props) {
381
326
  const {
382
- registry: {
383
- translateString
384
- }
327
+ registry: { translateString }
385
328
  } = props;
386
- return jsx(IconButton, {
387
- title: translateString(TranslatableString.MoveDownButton),
388
- ...props,
389
- icon: jsx(ArrowDownOutlined, {})
390
- });
329
+ return /* @__PURE__ */ jsx6(IconButton, { title: translateString(TranslatableString2.MoveDownButton), ...props, icon: /* @__PURE__ */ jsx6(ArrowDownOutlined, {}) });
391
330
  }
392
331
  function MoveUpButton(props) {
393
332
  const {
394
- registry: {
395
- translateString
396
- }
333
+ registry: { translateString }
397
334
  } = props;
398
- return jsx(IconButton, {
399
- title: translateString(TranslatableString.MoveUpButton),
400
- ...props,
401
- icon: jsx(ArrowUpOutlined, {})
402
- });
335
+ return /* @__PURE__ */ jsx6(IconButton, { title: translateString(TranslatableString2.MoveUpButton), ...props, icon: /* @__PURE__ */ jsx6(ArrowUpOutlined, {}) });
403
336
  }
404
337
  function RemoveButton(props) {
405
- // The `block` prop is not part of the `IconButtonProps` defined in the template, so get it from the uiSchema instead
406
- const options = getUiOptions(props.uiSchema);
338
+ const options = getUiOptions2(props.uiSchema);
407
339
  const {
408
- registry: {
409
- translateString
410
- }
340
+ registry: { translateString }
411
341
  } = props;
412
- return jsx(IconButton, {
413
- title: translateString(TranslatableString.RemoveButton),
414
- ...props,
415
- danger: true,
416
- block: !!options.block,
417
- iconType: 'primary',
418
- icon: jsx(DeleteOutlined, {})
419
- });
342
+ return /* @__PURE__ */ jsx6(
343
+ IconButton,
344
+ {
345
+ title: translateString(TranslatableString2.RemoveButton),
346
+ ...props,
347
+ danger: true,
348
+ block: !!options.block,
349
+ iconType: "primary",
350
+ icon: /* @__PURE__ */ jsx6(DeleteOutlined, {})
351
+ }
352
+ );
420
353
  }
421
354
 
422
- /** The `FieldErrorTemplate` component renders the errors local to the particular field
423
- *
424
- * @param props - The `FieldErrorProps` for the errors being rendered
425
- */
355
+ // src/templates/FieldErrorTemplate/index.tsx
356
+ import { errorId } from "@rjsf/utils";
357
+ import { jsx as jsx7 } from "react/jsx-runtime";
426
358
  function FieldErrorTemplate(props) {
427
- const {
428
- errors = [],
429
- idSchema
430
- } = props;
359
+ const { errors = [], idSchema } = props;
431
360
  if (errors.length === 0) {
432
361
  return null;
433
362
  }
434
363
  const id = errorId(idSchema);
435
- return jsx("div", {
436
- id: id,
437
- children: errors.map(error => jsx("div", {
438
- children: error
439
- }, `field-${id}-error-${error}`))
440
- });
364
+ return /* @__PURE__ */ jsx7("div", { id, children: errors.map((error) => /* @__PURE__ */ jsx7("div", { children: error }, `field-${id}-error-${error}`)) });
441
365
  }
442
366
 
443
- const VERTICAL_LABEL_COL$1 = {
444
- span: 24
445
- };
446
- const VERTICAL_WRAPPER_COL$1 = {
447
- span: 24
448
- };
449
- /** The `FieldTemplate` component is the template used by `SchemaField` to render any field. It renders the field
450
- * content, (label, description, children, errors and help) inside of a `WrapIfAdditional` component.
451
- *
452
- * @param props - The `FieldTemplateProps` for this component
453
- */
367
+ // src/templates/FieldTemplate/index.tsx
368
+ import Form from "antd/lib/form";
369
+ import {
370
+ getTemplate as getTemplate2,
371
+ getUiOptions as getUiOptions3
372
+ } from "@rjsf/utils";
373
+ import { jsx as jsx8 } from "react/jsx-runtime";
374
+ var VERTICAL_LABEL_COL = { span: 24 };
375
+ var VERTICAL_WRAPPER_COL = { span: 24 };
454
376
  function FieldTemplate(props) {
455
377
  const {
456
378
  children,
457
- classNames,
379
+ classNames: classNames4,
458
380
  style,
459
381
  description,
460
382
  disabled,
@@ -478,71 +400,86 @@ function FieldTemplate(props) {
478
400
  } = props;
479
401
  const {
480
402
  colon,
481
- labelCol = VERTICAL_LABEL_COL$1,
482
- wrapperCol = VERTICAL_WRAPPER_COL$1,
403
+ labelCol = VERTICAL_LABEL_COL,
404
+ wrapperCol = VERTICAL_WRAPPER_COL,
483
405
  wrapperStyle,
484
- descriptionLocation = 'below'
406
+ descriptionLocation = "below"
485
407
  } = formContext;
486
- const uiOptions = getUiOptions(uiSchema);
487
- const WrapIfAdditionalTemplate = getTemplate('WrapIfAdditionalTemplate', registry, uiOptions);
408
+ const uiOptions = getUiOptions3(uiSchema);
409
+ const WrapIfAdditionalTemplate2 = getTemplate2(
410
+ "WrapIfAdditionalTemplate",
411
+ registry,
412
+ uiOptions
413
+ );
488
414
  if (hidden) {
489
- return jsx("div", {
490
- className: 'field-hidden',
491
- children: children
492
- });
415
+ return /* @__PURE__ */ jsx8("div", { className: "field-hidden", children });
493
416
  }
494
- // check to see if there is rawDescription(string) before using description(ReactNode)
495
- // to prevent showing a blank description area
496
- const descriptionNode = rawDescription ? description : undefined;
417
+ const descriptionNode = rawDescription ? description : void 0;
497
418
  const descriptionProps = {};
498
419
  switch (descriptionLocation) {
499
- case 'tooltip':
420
+ case "tooltip":
500
421
  descriptionProps.tooltip = descriptionNode;
501
422
  break;
502
- case 'below':
423
+ case "below":
503
424
  default:
504
425
  descriptionProps.extra = descriptionNode;
505
426
  break;
506
427
  }
507
- return jsx(WrapIfAdditionalTemplate, {
508
- classNames: classNames,
509
- style: style,
510
- disabled: disabled,
511
- id: id,
512
- label: label,
513
- onDropPropertyClick: onDropPropertyClick,
514
- onKeyChange: onKeyChange,
515
- readonly: readonly,
516
- required: required,
517
- schema: schema,
518
- uiSchema: uiSchema,
519
- registry: registry,
520
- children: jsx(Form$1.Item, {
521
- colon: colon,
522
- hasFeedback: schema.type !== 'array' && schema.type !== 'object',
523
- help: !!rawHelp && help || (rawErrors !== null && rawErrors !== void 0 && rawErrors.length ? errors : undefined),
524
- htmlFor: id,
525
- label: displayLabel && label,
526
- labelCol: labelCol,
527
- required: required,
528
- style: wrapperStyle,
529
- validateStatus: rawErrors !== null && rawErrors !== void 0 && rawErrors.length ? 'error' : undefined,
530
- wrapperCol: wrapperCol,
531
- ...descriptionProps,
532
- children: children
533
- })
534
- });
428
+ return /* @__PURE__ */ jsx8(
429
+ WrapIfAdditionalTemplate2,
430
+ {
431
+ classNames: classNames4,
432
+ style,
433
+ disabled,
434
+ id,
435
+ label,
436
+ onDropPropertyClick,
437
+ onKeyChange,
438
+ readonly,
439
+ required,
440
+ schema,
441
+ uiSchema,
442
+ registry,
443
+ children: /* @__PURE__ */ jsx8(
444
+ Form.Item,
445
+ {
446
+ colon,
447
+ hasFeedback: schema.type !== "array" && schema.type !== "object",
448
+ help: !!rawHelp && help || (rawErrors?.length ? errors : void 0),
449
+ htmlFor: id,
450
+ label: displayLabel && label,
451
+ labelCol,
452
+ required,
453
+ style: wrapperStyle,
454
+ validateStatus: rawErrors?.length ? "error" : void 0,
455
+ wrapperCol,
456
+ ...descriptionProps,
457
+ children
458
+ }
459
+ )
460
+ }
461
+ );
535
462
  }
536
463
 
537
- const DESCRIPTION_COL_STYLE = {
538
- paddingBottom: '8px'
464
+ // src/templates/ObjectFieldTemplate/index.tsx
465
+ import classNames2 from "classnames";
466
+ import isObject from "lodash/isObject";
467
+ import isNumber from "lodash/isNumber";
468
+ import isString from "lodash/isString";
469
+ import {
470
+ canExpand,
471
+ descriptionId,
472
+ getTemplate as getTemplate3,
473
+ getUiOptions as getUiOptions4,
474
+ titleId
475
+ } from "@rjsf/utils";
476
+ import Col3 from "antd/lib/col";
477
+ import Row3 from "antd/lib/row";
478
+ import { ConfigConsumer as ConfigConsumer2 } from "antd/lib/config-provider/context";
479
+ import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
480
+ var DESCRIPTION_COL_STYLE2 = {
481
+ paddingBottom: "8px"
539
482
  };
540
- /** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
541
- * title and description if available. If the object is expandable, then an `AddButton` is also rendered after all
542
- * the properties.
543
- *
544
- * @param props - The `ObjectFieldTemplateProps` for this component
545
- */
546
483
  function ObjectFieldTemplate(props) {
547
484
  const {
548
485
  description,
@@ -559,32 +496,28 @@ function ObjectFieldTemplate(props) {
559
496
  title,
560
497
  uiSchema
561
498
  } = props;
562
- const uiOptions = getUiOptions(uiSchema);
563
- const TitleFieldTemplate = getTemplate('TitleFieldTemplate', registry, uiOptions);
564
- const DescriptionFieldTemplate = getTemplate('DescriptionFieldTemplate', registry, uiOptions);
565
- // Button templates are not overridden in the uiSchema
499
+ const uiOptions = getUiOptions4(uiSchema);
500
+ const TitleFieldTemplate = getTemplate3("TitleFieldTemplate", registry, uiOptions);
501
+ const DescriptionFieldTemplate = getTemplate3(
502
+ "DescriptionFieldTemplate",
503
+ registry,
504
+ uiOptions
505
+ );
566
506
  const {
567
- ButtonTemplates: {
568
- AddButton
569
- }
507
+ ButtonTemplates: { AddButton: AddButton2 }
570
508
  } = registry.templates;
571
- const {
572
- colSpan = 24,
573
- labelAlign = 'right',
574
- rowGutter = 24
575
- } = formContext;
576
- const findSchema = element => element.content.props.schema;
577
- const findSchemaType = element => findSchema(element).type;
578
- const findUiSchema = element => element.content.props.uiSchema;
579
- const findUiSchemaField = element => getUiOptions(findUiSchema(element)).field;
580
- const findUiSchemaWidget = element => getUiOptions(findUiSchema(element)).widget;
581
- const calculateColSpan = element => {
509
+ const { colSpan = 24, labelAlign = "right", rowGutter = 24 } = formContext;
510
+ const findSchema = (element) => element.content.props.schema;
511
+ const findSchemaType = (element) => findSchema(element).type;
512
+ const findUiSchema = (element) => element.content.props.uiSchema;
513
+ const findUiSchemaField = (element) => getUiOptions4(findUiSchema(element)).field;
514
+ const findUiSchemaWidget = (element) => getUiOptions4(findUiSchema(element)).widget;
515
+ const calculateColSpan = (element) => {
582
516
  const type = findSchemaType(element);
583
517
  const field = findUiSchemaField(element);
584
518
  const widget = findUiSchemaWidget(element);
585
- const defaultColSpan = properties.length < 2 ||
586
- // Single or no field in object.
587
- type === 'object' || type === 'array' || widget === 'textarea' ? 24 : 12;
519
+ const defaultColSpan = properties.length < 2 || // Single or no field in object.
520
+ type === "object" || type === "array" || widget === "textarea" ? 24 : 12;
588
521
  if (isObject(colSpan)) {
589
522
  const colSpanObj = colSpan;
590
523
  if (isString(widget)) {
@@ -602,108 +535,81 @@ function ObjectFieldTemplate(props) {
602
535
  }
603
536
  return defaultColSpan;
604
537
  };
605
- return jsx(ConfigConsumer, {
606
- children: configProps => {
607
- const {
608
- getPrefixCls
609
- } = configProps;
610
- const prefixCls = getPrefixCls('form');
611
- const labelClsBasic = `${prefixCls}-item-label`;
612
- const labelColClassName = classNames(labelClsBasic, labelAlign === 'left' && `${labelClsBasic}-left`
538
+ return /* @__PURE__ */ jsx9(ConfigConsumer2, { children: (configProps) => {
539
+ const { getPrefixCls } = configProps;
540
+ const prefixCls = getPrefixCls("form");
541
+ const labelClsBasic = `${prefixCls}-item-label`;
542
+ const labelColClassName = classNames2(
543
+ labelClsBasic,
544
+ labelAlign === "left" && `${labelClsBasic}-left`
613
545
  // labelCol.className,
614
- );
615
-
616
- return jsxs("fieldset", {
617
- id: idSchema.$id,
618
- children: [jsxs(Row, {
619
- gutter: rowGutter,
620
- children: [title && jsx(Col, {
621
- className: labelColClassName,
622
- span: 24,
623
- children: jsx(TitleFieldTemplate, {
624
- id: titleId(idSchema),
625
- title: title,
626
- required: required,
627
- schema: schema,
628
- uiSchema: uiSchema,
629
- registry: registry
630
- })
631
- }), description && jsx(Col, {
632
- span: 24,
633
- style: DESCRIPTION_COL_STYLE,
634
- children: jsx(DescriptionFieldTemplate, {
635
- id: descriptionId(idSchema),
636
- description: description,
637
- schema: schema,
638
- uiSchema: uiSchema,
639
- registry: registry
640
- })
641
- }), properties.filter(e => !e.hidden).map(element => jsx(Col, {
642
- span: calculateColSpan(element),
643
- children: element.content
644
- }, element.name))]
645
- }), canExpand(schema, uiSchema, formData) && jsx(Col, {
646
- span: 24,
647
- children: jsx(Row, {
648
- gutter: rowGutter,
649
- justify: 'end',
650
- children: jsx(Col, {
651
- flex: '192px',
652
- children: jsx(AddButton, {
653
- className: 'object-property-expand',
654
- disabled: disabled || readonly,
655
- onClick: onAddClick(schema),
656
- uiSchema: uiSchema,
657
- registry: registry
658
- })
659
- })
660
- })
661
- })]
662
- });
663
- }
664
- });
546
+ );
547
+ return /* @__PURE__ */ jsxs5("fieldset", { id: idSchema.$id, children: [
548
+ /* @__PURE__ */ jsxs5(Row3, { gutter: rowGutter, children: [
549
+ title && /* @__PURE__ */ jsx9(Col3, { className: labelColClassName, span: 24, children: /* @__PURE__ */ jsx9(
550
+ TitleFieldTemplate,
551
+ {
552
+ id: titleId(idSchema),
553
+ title,
554
+ required,
555
+ schema,
556
+ uiSchema,
557
+ registry
558
+ }
559
+ ) }),
560
+ description && /* @__PURE__ */ jsx9(Col3, { span: 24, style: DESCRIPTION_COL_STYLE2, children: /* @__PURE__ */ jsx9(
561
+ DescriptionFieldTemplate,
562
+ {
563
+ id: descriptionId(idSchema),
564
+ description,
565
+ schema,
566
+ uiSchema,
567
+ registry
568
+ }
569
+ ) }),
570
+ properties.filter((e) => !e.hidden).map((element) => /* @__PURE__ */ jsx9(Col3, { span: calculateColSpan(element), children: element.content }, element.name))
571
+ ] }),
572
+ canExpand(schema, uiSchema, formData) && /* @__PURE__ */ jsx9(Col3, { span: 24, children: /* @__PURE__ */ jsx9(Row3, { gutter: rowGutter, justify: "end", children: /* @__PURE__ */ jsx9(Col3, { flex: "192px", children: /* @__PURE__ */ jsx9(
573
+ AddButton2,
574
+ {
575
+ className: "object-property-expand",
576
+ disabled: disabled || readonly,
577
+ onClick: onAddClick(schema),
578
+ uiSchema,
579
+ registry
580
+ }
581
+ ) }) }) })
582
+ ] });
583
+ } });
665
584
  }
666
585
 
667
- /** The `SubmitButton` renders a button that represent the `Submit` action on a form
668
- */
669
- function SubmitButton({
670
- uiSchema
671
- }) {
672
- const {
673
- submitText,
674
- norender,
675
- props: submitButtonProps
676
- } = getSubmitButtonOptions(uiSchema);
586
+ // src/templates/SubmitButton/index.tsx
587
+ import Button3 from "antd/lib/button";
588
+ import { getSubmitButtonOptions } from "@rjsf/utils";
589
+ import { jsx as jsx10 } from "react/jsx-runtime";
590
+ function SubmitButton({ uiSchema }) {
591
+ const { submitText, norender, props: submitButtonProps } = getSubmitButtonOptions(uiSchema);
677
592
  if (norender) {
678
593
  return null;
679
594
  }
680
- return jsx(Button, {
681
- type: 'submit',
682
- ...submitButtonProps,
683
- htmlType: 'submit',
684
- children: submitText
685
- });
595
+ return /* @__PURE__ */ jsx10(Button3, { type: "submit", ...submitButtonProps, htmlType: "submit", children: submitText });
686
596
  }
687
597
 
688
- /** The `TitleField` is the template to use to render the title of a field
689
- *
690
- * @param props - The `TitleFieldProps` for this component
691
- */
598
+ // src/templates/TitleField/index.tsx
599
+ import classNames3 from "classnames";
600
+ import { ConfigConsumer as ConfigConsumer3 } from "antd/lib/config-provider/context";
601
+ import { jsx as jsx11 } from "react/jsx-runtime";
692
602
  function TitleField({
693
603
  id,
694
604
  required,
695
605
  registry,
696
606
  title
697
607
  }) {
698
- const {
699
- formContext
700
- } = registry;
701
- const {
702
- colon = true
703
- } = formContext;
608
+ const { formContext } = registry;
609
+ const { colon = true } = formContext;
704
610
  let labelChildren = title;
705
- if (colon && typeof title === 'string' && title.trim() !== '') {
706
- labelChildren = title.replace(/[::]\s*$/, '');
611
+ if (colon && typeof title === "string" && title.trim() !== "") {
612
+ labelChildren = title.replace(/[::]\s*$/, "");
707
613
  }
708
614
  const handleLabelClick = () => {
709
615
  if (!id) {
@@ -714,45 +620,46 @@ function TitleField({
714
620
  control.focus();
715
621
  }
716
622
  };
717
- return title ? jsx(ConfigConsumer, {
718
- children: configProps => {
719
- const {
720
- getPrefixCls
721
- } = configProps;
722
- const prefixCls = getPrefixCls('form');
723
- const labelClassName = classNames({
724
- [`${prefixCls}-item-required`]: required,
725
- [`${prefixCls}-item-no-colon`]: !colon
726
- });
727
- return jsx("label", {
623
+ return title ? /* @__PURE__ */ jsx11(ConfigConsumer3, { children: (configProps) => {
624
+ const { getPrefixCls } = configProps;
625
+ const prefixCls = getPrefixCls("form");
626
+ const labelClassName = classNames3({
627
+ [`${prefixCls}-item-required`]: required,
628
+ [`${prefixCls}-item-no-colon`]: !colon
629
+ });
630
+ return /* @__PURE__ */ jsx11(
631
+ "label",
632
+ {
728
633
  className: labelClassName,
729
634
  htmlFor: id,
730
635
  onClick: handleLabelClick,
731
- title: typeof title === 'string' ? title : '',
636
+ title: typeof title === "string" ? title : "",
732
637
  children: labelChildren
733
- });
734
- }
735
- }) : null;
638
+ }
639
+ );
640
+ } }) : null;
736
641
  }
737
642
 
738
- const VERTICAL_LABEL_COL = {
739
- span: 24
643
+ // src/templates/WrapIfAdditionalTemplate/index.tsx
644
+ import Col4 from "antd/lib/col";
645
+ import Form2 from "antd/lib/form";
646
+ import Input2 from "antd/lib/input";
647
+ import Row4 from "antd/lib/row";
648
+ import {
649
+ ADDITIONAL_PROPERTY_FLAG,
650
+ UI_OPTIONS_KEY,
651
+ TranslatableString as TranslatableString3
652
+ } from "@rjsf/utils";
653
+ import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
654
+ var VERTICAL_LABEL_COL2 = { span: 24 };
655
+ var VERTICAL_WRAPPER_COL2 = { span: 24 };
656
+ var INPUT_STYLE2 = {
657
+ width: "100%"
740
658
  };
741
- const VERTICAL_WRAPPER_COL = {
742
- span: 24
743
- };
744
- const INPUT_STYLE$1 = {
745
- width: '100%'
746
- };
747
- /** The `WrapIfAdditional` component is used by the `FieldTemplate` to rename, or remove properties that are
748
- * part of an `additionalProperties` part of a schema.
749
- *
750
- * @param props - The `WrapIfAdditionalProps` for this component
751
- */
752
659
  function WrapIfAdditionalTemplate(props) {
753
660
  const {
754
661
  children,
755
- classNames,
662
+ classNames: classNames4,
756
663
  style,
757
664
  disabled,
758
665
  id,
@@ -767,93 +674,69 @@ function WrapIfAdditionalTemplate(props) {
767
674
  } = props;
768
675
  const {
769
676
  colon,
770
- labelCol = VERTICAL_LABEL_COL,
677
+ labelCol = VERTICAL_LABEL_COL2,
771
678
  readonlyAsDisabled = true,
772
679
  rowGutter = 24,
773
- toolbarAlign = 'top',
774
- wrapperCol = VERTICAL_WRAPPER_COL,
680
+ toolbarAlign = "top",
681
+ wrapperCol = VERTICAL_WRAPPER_COL2,
775
682
  wrapperStyle
776
683
  } = registry.formContext;
777
- const {
778
- templates,
779
- translateString
780
- } = registry;
781
- // Button templates are not overridden in the uiSchema
782
- const {
783
- RemoveButton
784
- } = templates.ButtonTemplates;
785
- const keyLabel = translateString(TranslatableString.KeyLabel, [label]);
786
- const additional = (ADDITIONAL_PROPERTY_FLAG in schema);
684
+ const { templates, translateString } = registry;
685
+ const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
686
+ const keyLabel = translateString(TranslatableString3.KeyLabel, [label]);
687
+ const additional = ADDITIONAL_PROPERTY_FLAG in schema;
787
688
  if (!additional) {
788
- return jsx("div", {
789
- className: classNames,
790
- style: style,
791
- children: children
792
- });
689
+ return /* @__PURE__ */ jsx12("div", { className: classNames4, style, children });
793
690
  }
794
- const handleBlur = ({
795
- target
796
- }) => onKeyChange(target.value);
797
- // The `block` prop is not part of the `IconButtonProps` defined in the template, so put it into the uiSchema instead
691
+ const handleBlur = ({ target }) => onKeyChange(target.value);
798
692
  const uiOptions = uiSchema ? uiSchema[UI_OPTIONS_KEY] : {};
799
693
  const buttonUiOptions = {
800
694
  ...uiSchema,
801
- [UI_OPTIONS_KEY]: {
802
- ...uiOptions,
803
- block: true
804
- }
695
+ [UI_OPTIONS_KEY]: { ...uiOptions, block: true }
805
696
  };
806
- return jsx("div", {
807
- className: classNames,
808
- style: style,
809
- children: jsxs(Row, {
810
- align: toolbarAlign,
811
- gutter: rowGutter,
812
- children: [jsx(Col, {
813
- className: 'form-additional',
814
- flex: '1',
815
- children: jsx("div", {
816
- className: 'form-group',
817
- children: jsx(Form$1.Item, {
818
- colon: colon,
819
- className: 'form-group',
820
- hasFeedback: true,
821
- htmlFor: `${id}-key`,
822
- label: keyLabel,
823
- labelCol: labelCol,
824
- required: required,
825
- style: wrapperStyle,
826
- wrapperCol: wrapperCol,
827
- children: jsx(Input, {
828
- className: 'form-control',
829
- defaultValue: label,
830
- disabled: disabled || readonlyAsDisabled && readonly,
831
- id: `${id}-key`,
832
- name: `${id}-key`,
833
- onBlur: !readonly ? handleBlur : undefined,
834
- style: INPUT_STYLE$1,
835
- type: 'text'
836
- })
837
- })
838
- })
839
- }), jsx(Col, {
840
- className: 'form-additional',
841
- flex: '1',
842
- children: children
843
- }), jsx(Col, {
844
- flex: '192px',
845
- children: jsx(RemoveButton, {
846
- className: 'array-item-remove',
847
- disabled: disabled || readonly,
848
- onClick: onDropPropertyClick(label),
849
- uiSchema: buttonUiOptions,
850
- registry: registry
851
- })
852
- })]
853
- })
854
- });
697
+ return /* @__PURE__ */ jsx12("div", { className: classNames4, style, children: /* @__PURE__ */ jsxs6(Row4, { align: toolbarAlign, gutter: rowGutter, children: [
698
+ /* @__PURE__ */ jsx12(Col4, { className: "form-additional", flex: "1", children: /* @__PURE__ */ jsx12("div", { className: "form-group", children: /* @__PURE__ */ jsx12(
699
+ Form2.Item,
700
+ {
701
+ colon,
702
+ className: "form-group",
703
+ hasFeedback: true,
704
+ htmlFor: `${id}-key`,
705
+ label: keyLabel,
706
+ labelCol,
707
+ required,
708
+ style: wrapperStyle,
709
+ wrapperCol,
710
+ children: /* @__PURE__ */ jsx12(
711
+ Input2,
712
+ {
713
+ className: "form-control",
714
+ defaultValue: label,
715
+ disabled: disabled || readonlyAsDisabled && readonly,
716
+ id: `${id}-key`,
717
+ name: `${id}-key`,
718
+ onBlur: !readonly ? handleBlur : void 0,
719
+ style: INPUT_STYLE2,
720
+ type: "text"
721
+ }
722
+ )
723
+ }
724
+ ) }) }),
725
+ /* @__PURE__ */ jsx12(Col4, { className: "form-additional", flex: "1", children }),
726
+ /* @__PURE__ */ jsx12(Col4, { flex: "192px", children: /* @__PURE__ */ jsx12(
727
+ RemoveButton2,
728
+ {
729
+ className: "array-item-remove",
730
+ disabled: disabled || readonly,
731
+ onClick: onDropPropertyClick(label),
732
+ uiSchema: buttonUiOptions,
733
+ registry
734
+ }
735
+ ) })
736
+ ] }) });
855
737
  }
856
738
 
739
+ // src/templates/index.ts
857
740
  function generateTemplates() {
858
741
  return {
859
742
  ArrayFieldItemTemplate,
@@ -876,57 +759,48 @@ function generateTemplates() {
876
759
  WrapIfAdditionalTemplate
877
760
  };
878
761
  }
879
- var index$1 = /*#__PURE__*/generateTemplates();
762
+ var templates_default = generateTemplates();
880
763
 
881
- const rangeOptions = (start, stop) => {
764
+ // src/widgets/AltDateWidget/index.tsx
765
+ import { useEffect, useState } from "react";
766
+ import Button4 from "antd/lib/button";
767
+ import Col5 from "antd/lib/col";
768
+ import Row5 from "antd/lib/row";
769
+ import {
770
+ ariaDescribedByIds as ariaDescribedByIds2,
771
+ pad,
772
+ parseDateString,
773
+ toDateString,
774
+ TranslatableString as TranslatableString4
775
+ } from "@rjsf/utils";
776
+ import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
777
+ var rangeOptions = (start, stop) => {
882
778
  const options = [];
883
779
  for (let i = start; i <= stop; i++) {
884
- options.push({
885
- value: i,
886
- label: pad(i, 2)
887
- });
780
+ options.push({ value: i, label: pad(i, 2) });
888
781
  }
889
782
  return options;
890
783
  };
891
- const readyForChange = state => {
892
- return Object.values(state).every(value => value !== -1);
784
+ var readyForChange = (state) => {
785
+ return Object.values(state).every((value) => value !== -1);
893
786
  };
894
- function dateElementProps(state, time, yearsRange = [1900, new Date().getFullYear() + 2]) {
895
- const {
896
- year,
897
- month,
898
- day,
899
- hour,
900
- minute,
901
- second
902
- } = state;
903
- const data = [{
904
- type: 'year',
905
- range: yearsRange,
906
- value: year
907
- }, {
908
- type: 'month',
909
- range: [1, 12],
910
- value: month
911
- }, {
912
- type: 'day',
913
- range: [1, 31],
914
- value: day
915
- }];
787
+ function dateElementProps(state, time, yearsRange = [1900, (/* @__PURE__ */ new Date()).getFullYear() + 2]) {
788
+ const { year, month, day, hour, minute, second } = state;
789
+ const data = [
790
+ {
791
+ type: "year",
792
+ range: yearsRange,
793
+ value: year
794
+ },
795
+ { type: "month", range: [1, 12], value: month },
796
+ { type: "day", range: [1, 31], value: day }
797
+ ];
916
798
  if (time) {
917
- data.push({
918
- type: 'hour',
919
- range: [0, 23],
920
- value: hour || -1
921
- }, {
922
- type: 'minute',
923
- range: [0, 59],
924
- value: minute || -1
925
- }, {
926
- type: 'second',
927
- range: [0, 59],
928
- value: second || -1
929
- });
799
+ data.push(
800
+ { type: "hour", range: [0, 23], value: hour || -1 },
801
+ { type: "minute", range: [0, 59], value: minute || -1 },
802
+ { type: "second", range: [0, 59], value: second || -1 }
803
+ );
930
804
  }
931
805
  return data;
932
806
  }
@@ -945,16 +819,9 @@ function AltDateWidget(props) {
945
819
  showTime,
946
820
  value
947
821
  } = props;
948
- const {
949
- translateString,
950
- widgets
951
- } = registry;
952
- const {
953
- SelectWidget
954
- } = widgets;
955
- const {
956
- rowGutter = 24
957
- } = formContext;
822
+ const { translateString, widgets } = registry;
823
+ const { SelectWidget: SelectWidget2 } = widgets;
824
+ const { rowGutter = 24 } = formContext;
958
825
  const [state, setState] = useState(parseDateString(value, showTime));
959
826
  useEffect(() => {
960
827
  setState(parseDateString(value, showTime));
@@ -962,7 +829,7 @@ function AltDateWidget(props) {
962
829
  const handleChange = (property, nextValue) => {
963
830
  const nextState = {
964
831
  ...state,
965
- [property]: typeof nextValue === 'undefined' ? -1 : nextValue
832
+ [property]: typeof nextValue === "undefined" ? -1 : nextValue
966
833
  };
967
834
  if (readyForChange(nextState)) {
968
835
  onChange(toDateString(nextState, showTime));
@@ -970,116 +837,99 @@ function AltDateWidget(props) {
970
837
  setState(nextState);
971
838
  }
972
839
  };
973
- const handleNow = event => {
840
+ const handleNow = (event) => {
974
841
  event.preventDefault();
975
842
  if (disabled || readonly) {
976
843
  return;
977
844
  }
978
- const nextState = parseDateString(new Date().toJSON(), showTime);
845
+ const nextState = parseDateString((/* @__PURE__ */ new Date()).toJSON(), showTime);
979
846
  onChange(toDateString(nextState, showTime));
980
847
  };
981
- const handleClear = event => {
848
+ const handleClear = (event) => {
982
849
  event.preventDefault();
983
850
  if (disabled || readonly) {
984
851
  return;
985
852
  }
986
- onChange(undefined);
853
+ onChange(void 0);
987
854
  };
988
- const renderDateElement = elemProps => jsx(SelectWidget, {
989
- autofocus: elemProps.autofocus,
990
- className: 'form-control',
991
- disabled: elemProps.disabled,
992
- id: elemProps.id,
993
- name: elemProps.name,
994
- onBlur: elemProps.onBlur,
995
- onChange: elemValue => elemProps.select(elemProps.type, elemValue),
996
- onFocus: elemProps.onFocus,
997
- options: {
998
- enumOptions: rangeOptions(elemProps.range[0], elemProps.range[1])
999
- },
1000
- placeholder: elemProps.type,
1001
- readonly: elemProps.readonly,
1002
- schema: {
1003
- type: 'integer'
1004
- },
1005
- value: elemProps.value,
1006
- registry: registry,
1007
- label: '',
1008
- "aria-describedby": ariaDescribedByIds(id)
1009
- });
1010
- return jsxs(Row, {
1011
- gutter: [Math.floor(rowGutter / 2), Math.floor(rowGutter / 2)],
1012
- children: [dateElementProps(state, showTime, options.yearsRange).map((elemProps, i) => {
1013
- const elemId = id + '_' + elemProps.type;
1014
- return jsx(Col, {
1015
- flex: '88px',
1016
- children: renderDateElement({
1017
- ...elemProps,
1018
- autofocus: autofocus && i === 0,
1019
- disabled,
1020
- id: elemId,
1021
- name: id,
1022
- onBlur,
1023
- onFocus,
1024
- readonly,
1025
- registry,
1026
- select: handleChange,
1027
- // NOTE: antd components accept -1 rather than issue a warning
1028
- // like material-ui, so we need to convert -1 to undefined here.
1029
- value: elemProps.value < 0 ? undefined : elemProps.value
1030
- })
1031
- }, elemId);
1032
- }), !options.hideNowButton && jsx(Col, {
1033
- flex: '88px',
1034
- children: jsx(Button, {
1035
- block: true,
1036
- className: 'btn-now',
1037
- onClick: handleNow,
1038
- type: 'primary',
1039
- children: translateString(TranslatableString.NowLabel)
1040
- })
1041
- }), !options.hideClearButton && jsx(Col, {
1042
- flex: '88px',
1043
- children: jsx(Button, {
1044
- block: true,
1045
- className: 'btn-clear',
1046
- danger: true,
1047
- onClick: handleClear,
1048
- type: 'primary',
1049
- children: translateString(TranslatableString.ClearLabel)
1050
- })
1051
- })]
1052
- });
855
+ const renderDateElement = (elemProps) => /* @__PURE__ */ jsx13(
856
+ SelectWidget2,
857
+ {
858
+ autofocus: elemProps.autofocus,
859
+ className: "form-control",
860
+ disabled: elemProps.disabled,
861
+ id: elemProps.id,
862
+ name: elemProps.name,
863
+ onBlur: elemProps.onBlur,
864
+ onChange: (elemValue) => elemProps.select(elemProps.type, elemValue),
865
+ onFocus: elemProps.onFocus,
866
+ options: {
867
+ enumOptions: rangeOptions(elemProps.range[0], elemProps.range[1])
868
+ },
869
+ placeholder: elemProps.type,
870
+ readonly: elemProps.readonly,
871
+ schema: { type: "integer" },
872
+ value: elemProps.value,
873
+ registry,
874
+ label: "",
875
+ "aria-describedby": ariaDescribedByIds2(id)
876
+ }
877
+ );
878
+ return /* @__PURE__ */ jsxs7(Row5, { gutter: [Math.floor(rowGutter / 2), Math.floor(rowGutter / 2)], children: [
879
+ dateElementProps(state, showTime, options.yearsRange).map((elemProps, i) => {
880
+ const elemId = id + "_" + elemProps.type;
881
+ return /* @__PURE__ */ jsx13(Col5, { flex: "88px", children: renderDateElement({
882
+ ...elemProps,
883
+ autofocus: autofocus && i === 0,
884
+ disabled,
885
+ id: elemId,
886
+ name: id,
887
+ onBlur,
888
+ onFocus,
889
+ readonly,
890
+ registry,
891
+ select: handleChange,
892
+ // NOTE: antd components accept -1 rather than issue a warning
893
+ // like material-ui, so we need to convert -1 to undefined here.
894
+ value: elemProps.value < 0 ? void 0 : elemProps.value
895
+ }) }, elemId);
896
+ }),
897
+ !options.hideNowButton && /* @__PURE__ */ jsx13(Col5, { flex: "88px", children: /* @__PURE__ */ jsx13(Button4, { block: true, className: "btn-now", onClick: handleNow, type: "primary", children: translateString(TranslatableString4.NowLabel) }) }),
898
+ !options.hideClearButton && /* @__PURE__ */ jsx13(Col5, { flex: "88px", children: /* @__PURE__ */ jsx13(Button4, { block: true, className: "btn-clear", danger: true, onClick: handleClear, type: "primary", children: translateString(TranslatableString4.ClearLabel) }) })
899
+ ] });
1053
900
  }
1054
901
  AltDateWidget.defaultProps = {
1055
902
  autofocus: false,
1056
903
  disabled: false,
1057
904
  options: {
1058
- yearsRange: [1900, /*#__PURE__*/new Date().getFullYear() + 2]
905
+ yearsRange: [1900, (/* @__PURE__ */ new Date()).getFullYear() + 2]
1059
906
  },
1060
907
  readonly: false,
1061
908
  showTime: false
1062
909
  };
1063
910
 
911
+ // src/widgets/AltDateTimeWidget/index.tsx
912
+ import { jsx as jsx14 } from "react/jsx-runtime";
1064
913
  function AltDateTimeWidget(props) {
1065
- const {
1066
- AltDateWidget
1067
- } = props.registry.widgets;
1068
- return jsx(AltDateWidget, {
1069
- showTime: true,
1070
- ...props
1071
- });
914
+ const { AltDateWidget: AltDateWidget2 } = props.registry.widgets;
915
+ return /* @__PURE__ */ jsx14(AltDateWidget2, { showTime: true, ...props });
1072
916
  }
1073
917
  AltDateTimeWidget.defaultProps = {
1074
918
  ...AltDateWidget.defaultProps,
1075
919
  showTime: true
1076
920
  };
1077
921
 
1078
- /** The `CheckboxesWidget` is a widget for rendering checkbox groups.
1079
- * It is typically used to represent an array of enums.
1080
- *
1081
- * @param props - The `WidgetProps` for this component
1082
- */
922
+ // src/widgets/CheckboxesWidget/index.tsx
923
+ import Checkbox from "antd/lib/checkbox";
924
+ import {
925
+ ariaDescribedByIds as ariaDescribedByIds3,
926
+ enumOptionsIndexForValue,
927
+ enumOptionsValueForIndex,
928
+ getTemplate as getTemplate4,
929
+ optionId,
930
+ titleId as titleId2
931
+ } from "@rjsf/utils";
932
+ import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
1083
933
  function CheckboxesWidget({
1084
934
  autofocus,
1085
935
  disabled,
@@ -1097,247 +947,206 @@ function CheckboxesWidget({
1097
947
  uiSchema,
1098
948
  value
1099
949
  }) {
1100
- const {
1101
- readonlyAsDisabled = true
1102
- } = formContext;
1103
- const TitleFieldTemplate = getTemplate('TitleFieldTemplate', registry, options);
1104
- const {
1105
- enumOptions,
1106
- enumDisabled,
1107
- inline,
1108
- emptyValue
1109
- } = options;
1110
- const handleChange = nextValue => onChange(enumOptionsValueForIndex(nextValue, enumOptions, emptyValue));
1111
- const handleBlur = ({
1112
- target
1113
- }) => onBlur(id, enumOptionsValueForIndex(target.value, enumOptions, emptyValue));
1114
- const handleFocus = ({
1115
- target
1116
- }) => onFocus(id, enumOptionsValueForIndex(target.value, enumOptions, emptyValue));
1117
- // Antd's typescript definitions do not contain the following props that are actually necessary and, if provided,
1118
- // they are used, so hacking them in via by spreading `extraProps` on the component to avoid typescript errors
950
+ const { readonlyAsDisabled = true } = formContext;
951
+ const TitleFieldTemplate = getTemplate4("TitleFieldTemplate", registry, options);
952
+ const { enumOptions, enumDisabled, inline, emptyValue } = options;
953
+ const handleChange = (nextValue) => onChange(enumOptionsValueForIndex(nextValue, enumOptions, emptyValue));
954
+ const handleBlur = ({ target }) => onBlur(id, enumOptionsValueForIndex(target.value, enumOptions, emptyValue));
955
+ const handleFocus = ({ target }) => onFocus(id, enumOptionsValueForIndex(target.value, enumOptions, emptyValue));
1119
956
  const extraProps = {
1120
957
  id,
1121
- onBlur: !readonly ? handleBlur : undefined,
1122
- onFocus: !readonly ? handleFocus : undefined
958
+ onBlur: !readonly ? handleBlur : void 0,
959
+ onFocus: !readonly ? handleFocus : void 0
1123
960
  };
1124
961
  const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, true);
1125
- return Array.isArray(enumOptions) && enumOptions.length > 0 ? jsxs(Fragment, {
1126
- children: [!hideLabel && !!label && jsx("div", {
1127
- children: jsx(TitleFieldTemplate, {
1128
- id: titleId(id),
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),
1129
967
  title: label,
1130
- schema: schema,
1131
- uiSchema: uiSchema,
1132
- registry: registry
1133
- })
1134
- }), jsx(Checkbox.Group, {
1135
- disabled: disabled || readonlyAsDisabled && readonly,
1136
- name: id,
1137
- onChange: !readonly ? handleChange : undefined,
1138
- value: selectedIndexes,
1139
- ...extraProps,
1140
- "aria-describedby": ariaDescribedByIds(id),
1141
- children: Array.isArray(enumOptions) && enumOptions.map((option, i) => jsxs("span", {
1142
- children: [jsx(Checkbox, {
1143
- id: optionId(id, i),
1144
- name: id,
1145
- autoFocus: i === 0 ? autofocus : false,
1146
- disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1,
1147
- value: String(i),
1148
- children: option.label
1149
- }), !inline && jsx("br", {})]
1150
- }, i))
1151
- })]
1152
- }) : null;
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;
1153
999
  }
1154
1000
 
1155
- /** The `CheckBoxWidget` is a widget for rendering boolean properties.
1156
- * It is typically used to represent a boolean.
1157
- *
1158
- * @param props - The `WidgetProps` for this component
1159
- */
1001
+ // src/widgets/CheckboxWidget/index.tsx
1002
+ import Checkbox2 from "antd/lib/checkbox";
1003
+ import {
1004
+ ariaDescribedByIds as ariaDescribedByIds4,
1005
+ labelValue
1006
+ } from "@rjsf/utils";
1007
+ import { jsx as jsx16 } from "react/jsx-runtime";
1160
1008
  function CheckboxWidget(props) {
1161
- const {
1162
- autofocus,
1163
- disabled,
1164
- formContext,
1165
- id,
1166
- label,
1167
- hideLabel,
1168
- onBlur,
1169
- onChange,
1170
- onFocus,
1171
- readonly,
1172
- value
1173
- } = props;
1174
- const {
1175
- readonlyAsDisabled = true
1176
- } = formContext;
1177
- const handleChange = ({
1178
- target
1179
- }) => onChange(target.checked);
1180
- const handleBlur = ({
1181
- target
1182
- }) => onBlur(id, target.checked);
1183
- const handleFocus = ({
1184
- target
1185
- }) => onFocus(id, target.checked);
1186
- // Antd's typescript definitions do not contain the following props that are actually necessary and, if provided,
1187
- // they are used, so hacking them in via by spreading `extraProps` on the component to avoid typescript errors
1009
+ const { autofocus, disabled, formContext, id, label, hideLabel, onBlur, onChange, onFocus, readonly, value } = props;
1010
+ const { readonlyAsDisabled = true } = formContext;
1011
+ const handleChange = ({ target }) => onChange(target.checked);
1012
+ const handleBlur = ({ target }) => onBlur(id, target.checked);
1013
+ const handleFocus = ({ target }) => onFocus(id, target.checked);
1188
1014
  const extraProps = {
1189
- onBlur: !readonly ? handleBlur : undefined,
1190
- onFocus: !readonly ? handleFocus : undefined
1015
+ onBlur: !readonly ? handleBlur : void 0,
1016
+ onFocus: !readonly ? handleFocus : void 0
1191
1017
  };
1192
- return jsx(Checkbox, {
1193
- autoFocus: autofocus,
1194
- checked: typeof value === 'undefined' ? false : value,
1195
- disabled: disabled || readonlyAsDisabled && readonly,
1196
- id: id,
1197
- name: id,
1198
- onChange: !readonly ? handleChange : undefined,
1199
- ...extraProps,
1200
- "aria-describedby": ariaDescribedByIds(id),
1201
- children: labelValue(label, hideLabel, '')
1202
- });
1018
+ return /* @__PURE__ */ jsx16(
1019
+ Checkbox2,
1020
+ {
1021
+ autoFocus: autofocus,
1022
+ checked: typeof value === "undefined" ? false : value,
1023
+ disabled: disabled || readonlyAsDisabled && readonly,
1024
+ id,
1025
+ name: id,
1026
+ onChange: !readonly ? handleChange : void 0,
1027
+ ...extraProps,
1028
+ "aria-describedby": ariaDescribedByIds4(id),
1029
+ children: labelValue(label, hideLabel, "")
1030
+ }
1031
+ );
1203
1032
  }
1204
1033
 
1205
- const DatePicker = /*#__PURE__*/generatePicker(dayjsGenerateConfig);
1034
+ // src/widgets/DateTimeWidget/index.tsx
1035
+ import dayjs from "dayjs";
1036
+ import {
1037
+ ariaDescribedByIds as ariaDescribedByIds5
1038
+ } 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;
1206
1045
 
1207
- const DATE_PICKER_STYLE$1 = {
1208
- width: '100%'
1046
+ // src/widgets/DateTimeWidget/index.tsx
1047
+ import { jsx as jsx17 } from "react/jsx-runtime";
1048
+ var DATE_PICKER_STYLE = {
1049
+ width: "100%"
1209
1050
  };
1210
- /** The `DateTimeWidget` component uses the `BaseInputTemplate` changing the type to `datetime-local` and transforms
1211
- * the value to/from utc using the appropriate utility functions.
1212
- *
1213
- * @param props - The `WidgetProps` for this component
1214
- */
1215
1051
  function DateTimeWidget(props) {
1216
- const {
1217
- disabled,
1218
- formContext,
1219
- id,
1220
- onBlur,
1221
- onChange,
1222
- onFocus,
1223
- placeholder,
1224
- readonly,
1225
- value
1226
- } = props;
1227
- const {
1228
- readonlyAsDisabled = true
1229
- } = formContext;
1230
- const handleChange = nextValue => onChange(nextValue && nextValue.toISOString());
1052
+ const { disabled, formContext, id, onBlur, onChange, onFocus, placeholder, readonly, value } = props;
1053
+ const { readonlyAsDisabled = true } = formContext;
1054
+ const handleChange = (nextValue) => onChange(nextValue && nextValue.toISOString());
1231
1055
  const handleBlur = () => onBlur(id, value);
1232
1056
  const handleFocus = () => onFocus(id, value);
1233
- const getPopupContainer = node => node.parentNode;
1234
- return jsx(DatePicker, {
1235
- disabled: disabled || readonlyAsDisabled && readonly,
1236
- getPopupContainer: getPopupContainer,
1237
- id: id,
1238
- name: id,
1239
- onBlur: !readonly ? handleBlur : undefined,
1240
- onChange: !readonly ? handleChange : undefined,
1241
- onFocus: !readonly ? handleFocus : undefined,
1242
- placeholder: placeholder,
1243
- showTime: true,
1244
- style: DATE_PICKER_STYLE$1,
1245
- value: value && dayjs(value),
1246
- "aria-describedby": ariaDescribedByIds(id)
1247
- });
1057
+ const getPopupContainer = (node) => node.parentNode;
1058
+ return /* @__PURE__ */ jsx17(
1059
+ DatePicker_default,
1060
+ {
1061
+ disabled: disabled || readonlyAsDisabled && readonly,
1062
+ getPopupContainer,
1063
+ id,
1064
+ name: id,
1065
+ onBlur: !readonly ? handleBlur : void 0,
1066
+ onChange: !readonly ? handleChange : void 0,
1067
+ onFocus: !readonly ? handleFocus : void 0,
1068
+ placeholder,
1069
+ showTime: true,
1070
+ style: DATE_PICKER_STYLE,
1071
+ value: value && dayjs(value),
1072
+ "aria-describedby": ariaDescribedByIds5(id)
1073
+ }
1074
+ );
1248
1075
  }
1249
1076
 
1250
- const DATE_PICKER_STYLE = {
1251
- width: '100%'
1077
+ // src/widgets/DateWidget/index.tsx
1078
+ import dayjs2 from "dayjs";
1079
+ import {
1080
+ ariaDescribedByIds as ariaDescribedByIds6
1081
+ } from "@rjsf/utils";
1082
+ import { jsx as jsx18 } from "react/jsx-runtime";
1083
+ var DATE_PICKER_STYLE2 = {
1084
+ width: "100%"
1252
1085
  };
1253
- /** The `DateWidget` component uses the `BaseInputTemplate` changing the type to `date` and transforms
1254
- * the value to undefined when it is falsy during the `onChange` handling.
1255
- *
1256
- * @param props - The `WidgetProps` for this component
1257
- */
1258
1086
  function DateWidget(props) {
1259
- const {
1260
- disabled,
1261
- formContext,
1262
- id,
1263
- onBlur,
1264
- onChange,
1265
- onFocus,
1266
- placeholder,
1267
- readonly,
1268
- value
1269
- } = props;
1270
- const {
1271
- readonlyAsDisabled = true
1272
- } = formContext;
1273
- const handleChange = nextValue => onChange(nextValue && nextValue.format('YYYY-MM-DD'));
1087
+ const { disabled, formContext, id, onBlur, onChange, onFocus, placeholder, readonly, value } = props;
1088
+ const { readonlyAsDisabled = true } = formContext;
1089
+ const handleChange = (nextValue) => onChange(nextValue && nextValue.format("YYYY-MM-DD"));
1274
1090
  const handleBlur = () => onBlur(id, value);
1275
1091
  const handleFocus = () => onFocus(id, value);
1276
- const getPopupContainer = node => node.parentNode;
1277
- return jsx(DatePicker, {
1278
- disabled: disabled || readonlyAsDisabled && readonly,
1279
- getPopupContainer: getPopupContainer,
1280
- id: id,
1281
- name: id,
1282
- onBlur: !readonly ? handleBlur : undefined,
1283
- onChange: !readonly ? handleChange : undefined,
1284
- onFocus: !readonly ? handleFocus : undefined,
1285
- placeholder: placeholder,
1286
- showTime: false,
1287
- style: DATE_PICKER_STYLE,
1288
- value: value && dayjs(value),
1289
- "aria-describedby": ariaDescribedByIds(id)
1290
- });
1092
+ const getPopupContainer = (node) => node.parentNode;
1093
+ return /* @__PURE__ */ jsx18(
1094
+ DatePicker_default,
1095
+ {
1096
+ disabled: disabled || readonlyAsDisabled && readonly,
1097
+ getPopupContainer,
1098
+ id,
1099
+ name: id,
1100
+ onBlur: !readonly ? handleBlur : void 0,
1101
+ onChange: !readonly ? handleChange : void 0,
1102
+ onFocus: !readonly ? handleFocus : void 0,
1103
+ placeholder,
1104
+ showTime: false,
1105
+ style: DATE_PICKER_STYLE2,
1106
+ value: value && dayjs2(value),
1107
+ "aria-describedby": ariaDescribedByIds6(id)
1108
+ }
1109
+ );
1291
1110
  }
1292
1111
 
1293
- /** The `PasswordWidget` component uses the `BaseInputTemplate` changing the type to `password`.
1294
- *
1295
- * @param props - The `WidgetProps` for this component
1296
- */
1112
+ // src/widgets/PasswordWidget/index.tsx
1113
+ import Input3 from "antd/lib/input";
1114
+ import {
1115
+ ariaDescribedByIds as ariaDescribedByIds7
1116
+ } from "@rjsf/utils";
1117
+ import { jsx as jsx19 } from "react/jsx-runtime";
1297
1118
  function PasswordWidget(props) {
1298
- const {
1299
- disabled,
1300
- formContext,
1301
- id,
1302
- onBlur,
1303
- onChange,
1304
- onFocus,
1305
- options,
1306
- placeholder,
1307
- readonly,
1308
- value
1309
- } = props;
1310
- const {
1311
- readonlyAsDisabled = true
1312
- } = formContext;
1313
- const emptyValue = options.emptyValue || '';
1314
- const handleChange = ({
1315
- target
1316
- }) => onChange(target.value === '' ? emptyValue : target.value);
1317
- const handleBlur = ({
1318
- target
1319
- }) => onBlur(id, target.value);
1320
- const handleFocus = ({
1321
- target
1322
- }) => onFocus(id, target.value);
1323
- return jsx(Input.Password, {
1324
- disabled: disabled || readonlyAsDisabled && readonly,
1325
- id: id,
1326
- name: id,
1327
- onBlur: !readonly ? handleBlur : undefined,
1328
- onChange: !readonly ? handleChange : undefined,
1329
- onFocus: !readonly ? handleFocus : undefined,
1330
- placeholder: placeholder,
1331
- value: value || '',
1332
- "aria-describedby": ariaDescribedByIds(id)
1333
- });
1119
+ const { disabled, formContext, id, onBlur, onChange, onFocus, options, placeholder, readonly, value } = props;
1120
+ const { readonlyAsDisabled = true } = formContext;
1121
+ const emptyValue = options.emptyValue || "";
1122
+ const handleChange = ({ target }) => onChange(target.value === "" ? emptyValue : target.value);
1123
+ const handleBlur = ({ target }) => onBlur(id, target.value);
1124
+ const handleFocus = ({ target }) => onFocus(id, target.value);
1125
+ return /* @__PURE__ */ jsx19(
1126
+ Input3.Password,
1127
+ {
1128
+ disabled: disabled || readonlyAsDisabled && readonly,
1129
+ id,
1130
+ name: id,
1131
+ onBlur: !readonly ? handleBlur : void 0,
1132
+ onChange: !readonly ? handleChange : void 0,
1133
+ onFocus: !readonly ? handleFocus : void 0,
1134
+ placeholder,
1135
+ value: value || "",
1136
+ "aria-describedby": ariaDescribedByIds7(id)
1137
+ }
1138
+ );
1334
1139
  }
1335
1140
 
1336
- /** The `RadioWidget` is a widget for rendering a radio group.
1337
- * It is typically used with a string property constrained with enum options.
1338
- *
1339
- * @param props - The `WidgetProps` for this component
1340
- */
1141
+ // src/widgets/RadioWidget/index.tsx
1142
+ import Radio from "antd/lib/radio";
1143
+ import {
1144
+ ariaDescribedByIds as ariaDescribedByIds8,
1145
+ enumOptionsIndexForValue as enumOptionsIndexForValue2,
1146
+ enumOptionsValueForIndex as enumOptionsValueForIndex2,
1147
+ optionId as optionId2
1148
+ } from "@rjsf/utils";
1149
+ import { jsx as jsx20 } from "react/jsx-runtime";
1341
1150
  function RadioWidget({
1342
1151
  autofocus,
1343
1152
  disabled,
@@ -1350,51 +1159,46 @@ function RadioWidget({
1350
1159
  readonly,
1351
1160
  value
1352
1161
  }) {
1353
- const {
1354
- readonlyAsDisabled = true
1355
- } = formContext;
1356
- const {
1357
- enumOptions,
1358
- enumDisabled,
1359
- emptyValue
1360
- } = options;
1361
- const handleChange = ({
1362
- target: {
1363
- value: nextValue
1364
- }
1365
- }) => onChange(enumOptionsValueForIndex(nextValue, enumOptions, emptyValue));
1366
- const handleBlur = ({
1367
- target
1368
- }) => onBlur(id, enumOptionsValueForIndex(target.value, enumOptions, emptyValue));
1369
- const handleFocus = ({
1370
- target
1371
- }) => onFocus(id, enumOptionsValueForIndex(target.value, enumOptions, emptyValue));
1372
- const selectedIndexes = enumOptionsIndexForValue(value, enumOptions);
1373
- return jsx(Radio.Group, {
1374
- disabled: disabled || readonlyAsDisabled && readonly,
1375
- id: id,
1376
- name: id,
1377
- onChange: !readonly ? handleChange : undefined,
1378
- onBlur: !readonly ? handleBlur : undefined,
1379
- onFocus: !readonly ? handleFocus : undefined,
1380
- value: selectedIndexes,
1381
- "aria-describedby": ariaDescribedByIds(id),
1382
- children: Array.isArray(enumOptions) && enumOptions.map((option, i) => jsx(Radio, {
1383
- id: optionId(id, i),
1162
+ const { readonlyAsDisabled = true } = formContext;
1163
+ const { enumOptions, enumDisabled, emptyValue } = options;
1164
+ const handleChange = ({ target: { value: nextValue } }) => onChange(enumOptionsValueForIndex2(nextValue, enumOptions, emptyValue));
1165
+ const handleBlur = ({ target }) => onBlur(id, enumOptionsValueForIndex2(target.value, enumOptions, emptyValue));
1166
+ const handleFocus = ({ target }) => onFocus(id, enumOptionsValueForIndex2(target.value, enumOptions, emptyValue));
1167
+ const selectedIndexes = enumOptionsIndexForValue2(value, enumOptions);
1168
+ return /* @__PURE__ */ jsx20(
1169
+ Radio.Group,
1170
+ {
1171
+ disabled: disabled || readonlyAsDisabled && readonly,
1172
+ id,
1384
1173
  name: id,
1385
- autoFocus: i === 0 ? autofocus : false,
1386
- disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1,
1387
- value: String(i),
1388
- children: option.label
1389
- }, i))
1390
- });
1174
+ onChange: !readonly ? handleChange : void 0,
1175
+ onBlur: !readonly ? handleBlur : void 0,
1176
+ onFocus: !readonly ? handleFocus : void 0,
1177
+ value: selectedIndexes,
1178
+ "aria-describedby": ariaDescribedByIds8(id),
1179
+ children: Array.isArray(enumOptions) && enumOptions.map((option, i) => /* @__PURE__ */ jsx20(
1180
+ Radio,
1181
+ {
1182
+ id: optionId2(id, i),
1183
+ name: id,
1184
+ autoFocus: i === 0 ? autofocus : false,
1185
+ disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1,
1186
+ value: String(i),
1187
+ children: option.label
1188
+ },
1189
+ i
1190
+ ))
1191
+ }
1192
+ );
1391
1193
  }
1392
1194
 
1393
- /** The `RangeWidget` component uses the `BaseInputTemplate` changing the type to `range` and wrapping the result
1394
- * in a div, with the value along side it.
1395
- *
1396
- * @param props - The `WidgetProps` for this component
1397
- */
1195
+ // src/widgets/RangeWidget/index.tsx
1196
+ import Slider from "antd/lib/slider";
1197
+ import {
1198
+ ariaDescribedByIds as ariaDescribedByIds9,
1199
+ rangeSpec
1200
+ } from "@rjsf/utils";
1201
+ import { jsx as jsx21 } from "react/jsx-runtime";
1398
1202
  function RangeWidget(props) {
1399
1203
  const {
1400
1204
  autofocus,
@@ -1410,48 +1214,47 @@ function RangeWidget(props) {
1410
1214
  schema,
1411
1215
  value
1412
1216
  } = props;
1413
- const {
1414
- readonlyAsDisabled = true
1415
- } = formContext;
1416
- const {
1417
- min,
1418
- max,
1419
- step
1420
- } = rangeSpec(schema);
1421
- const emptyValue = options.emptyValue || '';
1422
- const handleChange = nextValue => onChange(nextValue === '' ? emptyValue : nextValue);
1217
+ const { readonlyAsDisabled = true } = formContext;
1218
+ const { min, max, step } = rangeSpec(schema);
1219
+ const emptyValue = options.emptyValue || "";
1220
+ const handleChange = (nextValue) => onChange(nextValue === "" ? emptyValue : nextValue);
1423
1221
  const handleBlur = () => onBlur(id, value);
1424
1222
  const handleFocus = () => onFocus(id, value);
1425
- // Antd's typescript definitions do not contain the following props that are actually necessary and, if provided,
1426
- // they are used, so hacking them in via by spreading `extraProps` on the component to avoid typescript errors
1427
1223
  const extraProps = {
1428
1224
  placeholder,
1429
- onBlur: !readonly ? handleBlur : undefined,
1430
- onFocus: !readonly ? handleFocus : undefined
1225
+ onBlur: !readonly ? handleBlur : void 0,
1226
+ onFocus: !readonly ? handleFocus : void 0
1431
1227
  };
1432
- return jsx(Slider, {
1433
- autoFocus: autofocus,
1434
- disabled: disabled || readonlyAsDisabled && readonly,
1435
- id: id,
1436
- max: max,
1437
- min: min,
1438
- onChange: !readonly ? handleChange : undefined,
1439
- range: false,
1440
- step: step,
1441
- value: value,
1442
- ...extraProps,
1443
- "aria-describedby": ariaDescribedByIds(id)
1444
- });
1228
+ return /* @__PURE__ */ jsx21(
1229
+ Slider,
1230
+ {
1231
+ autoFocus: autofocus,
1232
+ disabled: disabled || readonlyAsDisabled && readonly,
1233
+ id,
1234
+ max,
1235
+ min,
1236
+ onChange: !readonly ? handleChange : void 0,
1237
+ range: false,
1238
+ step,
1239
+ value,
1240
+ ...extraProps,
1241
+ "aria-describedby": ariaDescribedByIds9(id)
1242
+ }
1243
+ );
1445
1244
  }
1446
1245
 
1447
- const SELECT_STYLE = {
1448
- width: '100%'
1246
+ // src/widgets/SelectWidget/index.tsx
1247
+ import Select from "antd/lib/select";
1248
+ import {
1249
+ ariaDescribedByIds as ariaDescribedByIds10,
1250
+ enumOptionsIndexForValue as enumOptionsIndexForValue3,
1251
+ enumOptionsValueForIndex as enumOptionsValueForIndex3
1252
+ } from "@rjsf/utils";
1253
+ import isString2 from "lodash/isString";
1254
+ import { jsx as jsx22 } from "react/jsx-runtime";
1255
+ var SELECT_STYLE = {
1256
+ width: "100%"
1449
1257
  };
1450
- /** The `SelectWidget` is a widget for rendering dropdowns.
1451
- * It is typically used with string properties constrained with enum options.
1452
- *
1453
- * @param props - The `WidgetProps` for this component
1454
- */
1455
1258
  function SelectWidget({
1456
1259
  autofocus,
1457
1260
  disabled,
@@ -1466,64 +1269,61 @@ function SelectWidget({
1466
1269
  readonly,
1467
1270
  value
1468
1271
  }) {
1469
- const {
1470
- readonlyAsDisabled = true
1471
- } = formContext;
1472
- const {
1473
- enumOptions,
1474
- enumDisabled,
1475
- emptyValue
1476
- } = options;
1477
- const handleChange = nextValue => onChange(enumOptionsValueForIndex(nextValue, enumOptions, emptyValue));
1478
- const handleBlur = () => onBlur(id, enumOptionsValueForIndex(value, enumOptions, emptyValue));
1479
- const handleFocus = () => onFocus(id, enumOptionsValueForIndex(value, enumOptions, emptyValue));
1272
+ const { readonlyAsDisabled = true } = formContext;
1273
+ const { enumOptions, enumDisabled, emptyValue } = options;
1274
+ const handleChange = (nextValue) => onChange(enumOptionsValueForIndex3(nextValue, enumOptions, emptyValue));
1275
+ const handleBlur = () => onBlur(id, enumOptionsValueForIndex3(value, enumOptions, emptyValue));
1276
+ const handleFocus = () => onFocus(id, enumOptionsValueForIndex3(value, enumOptions, emptyValue));
1480
1277
  const filterOption = (input, option) => {
1481
- if (option && isString(option.label)) {
1482
- // labels are strings in this context
1278
+ if (option && isString2(option.label)) {
1483
1279
  return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
1484
1280
  }
1485
1281
  return false;
1486
1282
  };
1487
- const getPopupContainer = node => node.parentNode;
1488
- const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, multiple);
1489
- // Antd's typescript definitions do not contain the following props that are actually necessary and, if provided,
1490
- // they are used, so hacking them in via by spreading `extraProps` on the component to avoid typescript errors
1283
+ const getPopupContainer = (node) => node.parentNode;
1284
+ const selectedIndexes = enumOptionsIndexForValue3(value, enumOptions, multiple);
1491
1285
  const extraProps = {
1492
1286
  name: id
1493
1287
  };
1494
- return jsx(Select, {
1495
- autoFocus: autofocus,
1496
- disabled: disabled || readonlyAsDisabled && readonly,
1497
- getPopupContainer: getPopupContainer,
1498
- id: id,
1499
- mode: multiple ? 'multiple' : undefined,
1500
- onBlur: !readonly ? handleBlur : undefined,
1501
- onChange: !readonly ? handleChange : undefined,
1502
- onFocus: !readonly ? handleFocus : undefined,
1503
- placeholder: placeholder,
1504
- style: SELECT_STYLE,
1505
- value: selectedIndexes,
1506
- ...extraProps,
1507
- filterOption: filterOption,
1508
- "aria-describedby": ariaDescribedByIds(id),
1509
- children: Array.isArray(enumOptions) && enumOptions.map(({
1510
- value: optionValue,
1511
- label: optionLabel
1512
- }, index) => jsx(Select.Option, {
1513
- disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(optionValue) !== -1,
1514
- value: String(index),
1515
- children: optionLabel
1516
- }, String(index)))
1517
- });
1288
+ return /* @__PURE__ */ jsx22(
1289
+ Select,
1290
+ {
1291
+ autoFocus: autofocus,
1292
+ disabled: disabled || readonlyAsDisabled && readonly,
1293
+ getPopupContainer,
1294
+ id,
1295
+ mode: multiple ? "multiple" : void 0,
1296
+ onBlur: !readonly ? handleBlur : void 0,
1297
+ onChange: !readonly ? handleChange : void 0,
1298
+ onFocus: !readonly ? handleFocus : void 0,
1299
+ placeholder,
1300
+ style: SELECT_STYLE,
1301
+ value: selectedIndexes,
1302
+ ...extraProps,
1303
+ filterOption,
1304
+ "aria-describedby": ariaDescribedByIds10(id),
1305
+ children: Array.isArray(enumOptions) && enumOptions.map(({ value: optionValue, label: optionLabel }, index) => /* @__PURE__ */ jsx22(
1306
+ Select.Option,
1307
+ {
1308
+ disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(optionValue) !== -1,
1309
+ value: String(index),
1310
+ children: optionLabel
1311
+ },
1312
+ String(index)
1313
+ ))
1314
+ }
1315
+ );
1518
1316
  }
1519
1317
 
1520
- const INPUT_STYLE = {
1521
- width: '100%'
1318
+ // src/widgets/TextareaWidget/index.tsx
1319
+ import Input4 from "antd/lib/input";
1320
+ import {
1321
+ ariaDescribedByIds as ariaDescribedByIds11
1322
+ } from "@rjsf/utils";
1323
+ import { jsx as jsx23 } from "react/jsx-runtime";
1324
+ var INPUT_STYLE3 = {
1325
+ width: "100%"
1522
1326
  };
1523
- /** The `TextareaWidget` is a widget for rendering input fields as textarea.
1524
- *
1525
- * @param props - The `WidgetProps` for this component
1526
- */
1527
1327
  function TextareaWidget({
1528
1328
  disabled,
1529
1329
  formContext,
@@ -1536,39 +1336,33 @@ function TextareaWidget({
1536
1336
  readonly,
1537
1337
  value
1538
1338
  }) {
1539
- const {
1540
- readonlyAsDisabled = true
1541
- } = formContext;
1542
- const handleChange = ({
1543
- target
1544
- }) => onChange(target.value === '' ? options.emptyValue : target.value);
1545
- const handleBlur = ({
1546
- target
1547
- }) => onBlur(id, target.value);
1548
- const handleFocus = ({
1549
- target
1550
- }) => onFocus(id, target.value);
1551
- // Antd's typescript definitions do not contain the following props that are actually necessary and, if provided,
1552
- // they are used, so hacking them in via by spreading `extraProps` on the component to avoid typescript errors
1339
+ const { readonlyAsDisabled = true } = formContext;
1340
+ const handleChange = ({ target }) => onChange(target.value === "" ? options.emptyValue : target.value);
1341
+ const handleBlur = ({ target }) => onBlur(id, target.value);
1342
+ const handleFocus = ({ target }) => onFocus(id, target.value);
1553
1343
  const extraProps = {
1554
- type: 'textarea'
1344
+ type: "textarea"
1555
1345
  };
1556
- return jsx(Input.TextArea, {
1557
- disabled: disabled || readonlyAsDisabled && readonly,
1558
- id: id,
1559
- name: id,
1560
- onBlur: !readonly ? handleBlur : undefined,
1561
- onChange: !readonly ? handleChange : undefined,
1562
- onFocus: !readonly ? handleFocus : undefined,
1563
- placeholder: placeholder,
1564
- rows: options.rows || 4,
1565
- style: INPUT_STYLE,
1566
- value: value,
1567
- ...extraProps,
1568
- "aria-describedby": ariaDescribedByIds(id)
1569
- });
1346
+ return /* @__PURE__ */ jsx23(
1347
+ Input4.TextArea,
1348
+ {
1349
+ disabled: disabled || readonlyAsDisabled && readonly,
1350
+ id,
1351
+ name: id,
1352
+ onBlur: !readonly ? handleBlur : void 0,
1353
+ onChange: !readonly ? handleChange : void 0,
1354
+ onFocus: !readonly ? handleFocus : void 0,
1355
+ placeholder,
1356
+ rows: options.rows || 4,
1357
+ style: INPUT_STYLE3,
1358
+ value,
1359
+ ...extraProps,
1360
+ "aria-describedby": ariaDescribedByIds11(id)
1361
+ }
1362
+ );
1570
1363
  }
1571
1364
 
1365
+ // src/widgets/index.ts
1572
1366
  function generateWidgets() {
1573
1367
  return {
1574
1368
  AltDateTimeWidget,
@@ -1584,19 +1378,30 @@ function generateWidgets() {
1584
1378
  TextareaWidget
1585
1379
  };
1586
1380
  }
1587
- var index = /*#__PURE__*/generateWidgets();
1381
+ var widgets_default = generateWidgets();
1588
1382
 
1383
+ // src/index.ts
1589
1384
  function generateTheme() {
1590
1385
  return {
1591
1386
  templates: generateTemplates(),
1592
1387
  widgets: generateWidgets()
1593
1388
  };
1594
1389
  }
1595
- const Theme = /*#__PURE__*/generateTheme();
1390
+ var Theme = generateTheme();
1596
1391
  function generateForm() {
1597
1392
  return withTheme(generateTheme());
1598
1393
  }
1599
- const Form = /*#__PURE__*/generateForm();
1600
-
1601
- export { Form, index$1 as Templates, Theme, index as Widgets, Form as default, generateForm, generateTemplates, generateTheme, generateWidgets };
1394
+ var Form3 = generateForm();
1395
+ var src_default = Form3;
1396
+ export {
1397
+ Form3 as Form,
1398
+ templates_default as Templates,
1399
+ Theme,
1400
+ widgets_default as Widgets,
1401
+ src_default as default,
1402
+ generateForm,
1403
+ generateTemplates,
1404
+ generateTheme,
1405
+ generateWidgets
1406
+ };
1602
1407
  //# sourceMappingURL=antd.esm.js.map