@rjsf/core 5.11.2 → 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 (232) hide show
  1. package/dist/core.umd.js +3464 -0
  2. package/dist/index.esm.js +3814 -0
  3. package/dist/index.esm.js.map +7 -0
  4. package/dist/index.js +3714 -5
  5. package/dist/index.js.map +7 -0
  6. package/{dist/index.d.ts → lib/components/Form.d.ts} +321 -337
  7. package/lib/components/Form.js +474 -0
  8. package/lib/components/Form.js.map +1 -0
  9. package/lib/components/fields/ArrayField.d.ts +179 -0
  10. package/lib/components/fields/ArrayField.js +568 -0
  11. package/lib/components/fields/ArrayField.js.map +1 -0
  12. package/lib/components/fields/BooleanField.d.ts +9 -0
  13. package/lib/components/fields/BooleanField.js +62 -0
  14. package/lib/components/fields/BooleanField.js.map +1 -0
  15. package/lib/components/fields/MultiSchemaField.d.ts +47 -0
  16. package/lib/components/fields/MultiSchemaField.js +129 -0
  17. package/lib/components/fields/MultiSchemaField.js.map +1 -0
  18. package/lib/components/fields/NullField.d.ts +8 -0
  19. package/lib/components/fields/NullField.js +17 -0
  20. package/lib/components/fields/NullField.js.map +1 -0
  21. package/lib/components/fields/NumberField.d.ts +21 -0
  22. package/lib/components/fields/NumberField.js +70 -0
  23. package/lib/components/fields/NumberField.js.map +1 -0
  24. package/lib/components/fields/ObjectField.d.ts +73 -0
  25. package/lib/components/fields/ObjectField.js +222 -0
  26. package/lib/components/fields/ObjectField.js.map +1 -0
  27. package/lib/components/fields/SchemaField.d.ts +10 -0
  28. package/lib/components/fields/SchemaField.js +172 -0
  29. package/lib/components/fields/SchemaField.js.map +1 -0
  30. package/lib/components/fields/StringField.d.ts +8 -0
  31. package/lib/components/fields/StringField.js +25 -0
  32. package/lib/components/fields/StringField.js.map +1 -0
  33. package/lib/components/fields/index.d.ts +3 -0
  34. package/lib/components/fields/index.js +24 -0
  35. package/lib/components/fields/index.js.map +1 -0
  36. package/lib/components/templates/ArrayFieldDescriptionTemplate.d.ts +8 -0
  37. package/lib/components/templates/ArrayFieldDescriptionTemplate.js +18 -0
  38. package/lib/components/templates/ArrayFieldDescriptionTemplate.js.map +1 -0
  39. package/lib/components/templates/ArrayFieldItemTemplate.d.ts +7 -0
  40. package/lib/components/templates/ArrayFieldItemTemplate.js +20 -0
  41. package/lib/components/templates/ArrayFieldItemTemplate.js.map +1 -0
  42. package/lib/components/templates/ArrayFieldTemplate.d.ts +7 -0
  43. package/lib/components/templates/ArrayFieldTemplate.js +22 -0
  44. package/lib/components/templates/ArrayFieldTemplate.js.map +1 -0
  45. package/lib/components/templates/ArrayFieldTitleTemplate.d.ts +8 -0
  46. package/lib/components/templates/ArrayFieldTitleTemplate.js +18 -0
  47. package/lib/components/templates/ArrayFieldTitleTemplate.js.map +1 -0
  48. package/lib/components/templates/BaseInputTemplate.d.ts +9 -0
  49. package/lib/components/templates/BaseInputTemplate.js +39 -0
  50. package/lib/components/templates/BaseInputTemplate.js.map +1 -0
  51. package/lib/components/templates/ButtonTemplates/AddButton.d.ts +5 -0
  52. package/lib/components/templates/ButtonTemplates/AddButton.js +10 -0
  53. package/lib/components/templates/ButtonTemplates/AddButton.js.map +1 -0
  54. package/lib/components/templates/ButtonTemplates/IconButton.d.ts +7 -0
  55. package/lib/components/templates/ButtonTemplates/IconButton.js +24 -0
  56. package/lib/components/templates/ButtonTemplates/IconButton.js.map +1 -0
  57. package/lib/components/templates/ButtonTemplates/SubmitButton.d.ts +5 -0
  58. package/lib/components/templates/ButtonTemplates/SubmitButton.js +12 -0
  59. package/lib/components/templates/ButtonTemplates/SubmitButton.js.map +1 -0
  60. package/lib/components/templates/ButtonTemplates/index.d.ts +3 -0
  61. package/lib/components/templates/ButtonTemplates/index.js +15 -0
  62. package/lib/components/templates/ButtonTemplates/index.js.map +1 -0
  63. package/lib/components/templates/DescriptionField.d.ts +7 -0
  64. package/lib/components/templates/DescriptionField.js +18 -0
  65. package/lib/components/templates/DescriptionField.js.map +1 -0
  66. package/lib/components/templates/ErrorList.d.ts +7 -0
  67. package/lib/components/templates/ErrorList.js +13 -0
  68. package/lib/components/templates/ErrorList.js.map +1 -0
  69. package/lib/components/templates/FieldErrorTemplate.d.ts +7 -0
  70. package/lib/components/templates/FieldErrorTemplate.js +19 -0
  71. package/lib/components/templates/FieldErrorTemplate.js.map +1 -0
  72. package/lib/components/templates/FieldHelpTemplate.d.ts +7 -0
  73. package/lib/components/templates/FieldHelpTemplate.js +18 -0
  74. package/lib/components/templates/FieldHelpTemplate.js.map +1 -0
  75. package/lib/components/templates/FieldTemplate/FieldTemplate.d.ts +8 -0
  76. package/lib/components/templates/FieldTemplate/FieldTemplate.js +18 -0
  77. package/lib/components/templates/FieldTemplate/FieldTemplate.js.map +1 -0
  78. package/lib/components/templates/FieldTemplate/Label.d.ts +14 -0
  79. package/lib/components/templates/FieldTemplate/Label.js +14 -0
  80. package/lib/components/templates/FieldTemplate/Label.js.map +1 -0
  81. package/lib/components/templates/FieldTemplate/index.d.ts +2 -0
  82. package/lib/components/templates/FieldTemplate/index.js +3 -0
  83. package/lib/components/templates/FieldTemplate/index.js.map +1 -0
  84. package/lib/components/templates/ObjectFieldTemplate.d.ts +9 -0
  85. package/lib/components/templates/ObjectFieldTemplate.js +18 -0
  86. package/lib/components/templates/ObjectFieldTemplate.js.map +1 -0
  87. package/lib/components/templates/TitleField.d.ts +7 -0
  88. package/lib/components/templates/TitleField.js +11 -0
  89. package/lib/components/templates/TitleField.js.map +1 -0
  90. package/lib/components/templates/UnsupportedField.d.ts +9 -0
  91. package/lib/components/templates/UnsupportedField.js +28 -0
  92. package/lib/components/templates/UnsupportedField.js.map +1 -0
  93. package/lib/components/templates/WrapIfAdditionalTemplate.d.ts +8 -0
  94. package/lib/components/templates/WrapIfAdditionalTemplate.js +21 -0
  95. package/lib/components/templates/WrapIfAdditionalTemplate.js.map +1 -0
  96. package/lib/components/templates/index.d.ts +3 -0
  97. package/lib/components/templates/index.js +36 -0
  98. package/lib/components/templates/index.js.map +1 -0
  99. package/lib/components/widgets/AltDateTimeWidget.d.ts +9 -0
  100. package/lib/components/widgets/AltDateTimeWidget.js +14 -0
  101. package/lib/components/widgets/AltDateTimeWidget.js.map +1 -0
  102. package/lib/components/widgets/AltDateWidget.d.ts +7 -0
  103. package/lib/components/widgets/AltDateWidget.js +77 -0
  104. package/lib/components/widgets/AltDateWidget.js.map +1 -0
  105. package/lib/components/widgets/CheckboxWidget.d.ts +9 -0
  106. package/lib/components/widgets/CheckboxWidget.js +23 -0
  107. package/lib/components/widgets/CheckboxWidget.js.map +1 -0
  108. package/lib/components/widgets/CheckboxesWidget.d.ts +9 -0
  109. package/lib/components/widgets/CheckboxesWidget.js +31 -0
  110. package/lib/components/widgets/CheckboxesWidget.js.map +1 -0
  111. package/lib/components/widgets/ColorWidget.d.ts +8 -0
  112. package/lib/components/widgets/ColorWidget.js +13 -0
  113. package/lib/components/widgets/ColorWidget.js.map +1 -0
  114. package/lib/components/widgets/DateTimeWidget.d.ts +8 -0
  115. package/lib/components/widgets/DateTimeWidget.js +13 -0
  116. package/lib/components/widgets/DateTimeWidget.js.map +1 -0
  117. package/lib/components/widgets/DateWidget.d.ts +8 -0
  118. package/lib/components/widgets/DateWidget.js +15 -0
  119. package/lib/components/widgets/DateWidget.js.map +1 -0
  120. package/lib/components/widgets/EmailWidget.d.ts +7 -0
  121. package/lib/components/widgets/EmailWidget.js +12 -0
  122. package/lib/components/widgets/EmailWidget.js.map +1 -0
  123. package/lib/components/widgets/FileWidget.d.ts +8 -0
  124. package/lib/components/widgets/FileWidget.js +105 -0
  125. package/lib/components/widgets/FileWidget.js.map +1 -0
  126. package/lib/components/widgets/HiddenWidget.d.ts +9 -0
  127. package/lib/components/widgets/HiddenWidget.js +11 -0
  128. package/lib/components/widgets/HiddenWidget.js.map +1 -0
  129. package/lib/components/widgets/PasswordWidget.d.ts +7 -0
  130. package/lib/components/widgets/PasswordWidget.js +12 -0
  131. package/lib/components/widgets/PasswordWidget.js.map +1 -0
  132. package/lib/components/widgets/RadioWidget.d.ts +9 -0
  133. package/lib/components/widgets/RadioWidget.js +24 -0
  134. package/lib/components/widgets/RadioWidget.js.map +1 -0
  135. package/lib/components/widgets/RangeWidget.d.ts +8 -0
  136. package/lib/components/widgets/RangeWidget.js +11 -0
  137. package/lib/components/widgets/RangeWidget.js.map +1 -0
  138. package/lib/components/widgets/SelectWidget.d.ts +9 -0
  139. package/lib/components/widgets/SelectWidget.js +41 -0
  140. package/lib/components/widgets/SelectWidget.js.map +1 -0
  141. package/lib/components/widgets/TextWidget.d.ts +7 -0
  142. package/lib/components/widgets/TextWidget.js +12 -0
  143. package/lib/components/widgets/TextWidget.js.map +1 -0
  144. package/lib/components/widgets/TextareaWidget.d.ts +14 -0
  145. package/lib/components/widgets/TextareaWidget.js +19 -0
  146. package/lib/components/widgets/TextareaWidget.js.map +1 -0
  147. package/lib/components/widgets/TimeWidget.d.ts +8 -0
  148. package/lib/components/widgets/TimeWidget.js +15 -0
  149. package/lib/components/widgets/TimeWidget.js.map +1 -0
  150. package/lib/components/widgets/URLWidget.d.ts +7 -0
  151. package/lib/components/widgets/URLWidget.js +12 -0
  152. package/lib/components/widgets/URLWidget.js.map +1 -0
  153. package/lib/components/widgets/UpDownWidget.d.ts +7 -0
  154. package/lib/components/widgets/UpDownWidget.js +12 -0
  155. package/lib/components/widgets/UpDownWidget.js.map +1 -0
  156. package/lib/components/widgets/index.d.ts +3 -0
  157. package/lib/components/widgets/index.js +44 -0
  158. package/lib/components/widgets/index.js.map +1 -0
  159. package/lib/getDefaultRegistry.d.ts +6 -0
  160. package/lib/getDefaultRegistry.js +19 -0
  161. package/lib/getDefaultRegistry.js.map +1 -0
  162. package/lib/index.d.ts +6 -0
  163. package/lib/index.js +6 -0
  164. package/lib/index.js.map +1 -0
  165. package/lib/withTheme.d.ts +9 -0
  166. package/lib/withTheme.js +16 -0
  167. package/lib/withTheme.js.map +1 -0
  168. package/package.json +23 -16
  169. package/src/components/Form.tsx +853 -0
  170. package/src/components/fields/ArrayField.tsx +875 -0
  171. package/src/components/fields/BooleanField.tsx +114 -0
  172. package/src/components/fields/MultiSchemaField.tsx +221 -0
  173. package/src/components/fields/NullField.tsx +22 -0
  174. package/src/components/fields/NumberField.tsx +86 -0
  175. package/src/components/fields/ObjectField.tsx +331 -0
  176. package/src/components/fields/SchemaField.tsx +360 -0
  177. package/src/components/fields/StringField.tsx +71 -0
  178. package/src/components/fields/index.ts +31 -0
  179. package/src/components/templates/ArrayFieldDescriptionTemplate.tsx +41 -0
  180. package/src/components/templates/ArrayFieldItemTemplate.tsx +90 -0
  181. package/src/components/templates/ArrayFieldTemplate.tsx +88 -0
  182. package/src/components/templates/ArrayFieldTitleTemplate.tsx +43 -0
  183. package/src/components/templates/BaseInputTemplate.tsx +102 -0
  184. package/src/components/templates/ButtonTemplates/AddButton.tsx +29 -0
  185. package/src/components/templates/ButtonTemplates/IconButton.tsx +77 -0
  186. package/src/components/templates/ButtonTemplates/SubmitButton.tsx +21 -0
  187. package/src/components/templates/ButtonTemplates/index.ts +22 -0
  188. package/src/components/templates/DescriptionField.tsx +29 -0
  189. package/src/components/templates/ErrorList.tsx +35 -0
  190. package/src/components/templates/FieldErrorTemplate.tsx +33 -0
  191. package/src/components/templates/FieldHelpTemplate.tsx +29 -0
  192. package/src/components/templates/FieldTemplate/FieldTemplate.tsx +41 -0
  193. package/src/components/templates/FieldTemplate/Label.tsx +27 -0
  194. package/src/components/templates/FieldTemplate/index.ts +3 -0
  195. package/src/components/templates/ObjectFieldTemplate.tsx +83 -0
  196. package/src/components/templates/TitleField.tsx +19 -0
  197. package/src/components/templates/UnsupportedField.tsx +37 -0
  198. package/src/components/templates/WrapIfAdditionalTemplate.tsx +80 -0
  199. package/src/components/templates/index.ts +43 -0
  200. package/src/components/widgets/AltDateTimeWidget.tsx +16 -0
  201. package/src/components/widgets/AltDateWidget.tsx +198 -0
  202. package/src/components/widgets/CheckboxWidget.tsx +92 -0
  203. package/src/components/widgets/CheckboxesWidget.tsx +92 -0
  204. package/src/components/widgets/ColorWidget.tsx +14 -0
  205. package/src/components/widgets/DateTimeWidget.tsx +31 -0
  206. package/src/components/widgets/DateWidget.tsx +17 -0
  207. package/src/components/widgets/EmailWidget.tsx +13 -0
  208. package/src/components/widgets/FileWidget.tsx +178 -0
  209. package/src/components/widgets/HiddenWidget.tsx +15 -0
  210. package/src/components/widgets/PasswordWidget.tsx +15 -0
  211. package/src/components/widgets/RadioWidget.tsx +88 -0
  212. package/src/components/widgets/RangeWidget.tsx +23 -0
  213. package/src/components/widgets/SelectWidget.tsx +100 -0
  214. package/src/components/widgets/TextWidget.tsx +13 -0
  215. package/src/components/widgets/TextareaWidget.tsx +61 -0
  216. package/src/components/widgets/TimeWidget.tsx +17 -0
  217. package/src/components/widgets/URLWidget.tsx +13 -0
  218. package/src/components/widgets/UpDownWidget.tsx +13 -0
  219. package/src/components/widgets/index.ts +51 -0
  220. package/src/getDefaultRegistry.ts +24 -0
  221. package/src/index.ts +8 -0
  222. package/src/withTheme.tsx +42 -0
  223. package/dist/core.cjs.development.js +0 -4403
  224. package/dist/core.cjs.development.js.map +0 -1
  225. package/dist/core.cjs.production.min.js +0 -2
  226. package/dist/core.cjs.production.min.js.map +0 -1
  227. package/dist/core.esm.js +0 -4383
  228. package/dist/core.esm.js.map +0 -1
  229. package/dist/core.umd.development.js +0 -4393
  230. package/dist/core.umd.development.js.map +0 -1
  231. package/dist/core.umd.production.min.js +0 -2
  232. package/dist/core.umd.production.min.js.map +0 -1
@@ -0,0 +1,568 @@
1
+ import { __rest } from "tslib";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Component } from 'react';
4
+ import { getTemplate, getWidget, getUiOptions, isFixedItems, allowAdditionalItems, isCustomWidget, optionsList, TranslatableString, ITEMS_KEY, } from '@rjsf/utils';
5
+ import cloneDeep from 'lodash/cloneDeep';
6
+ import get from 'lodash/get';
7
+ import isObject from 'lodash/isObject';
8
+ import set from 'lodash/set';
9
+ import { nanoid } from 'nanoid';
10
+ /** Used to generate a unique ID for an element in a row */
11
+ function generateRowId() {
12
+ return nanoid();
13
+ }
14
+ /** Converts the `formData` into `KeyedFormDataType` data, using the `generateRowId()` function to create the key
15
+ *
16
+ * @param formData - The data for the form
17
+ * @returns - The `formData` converted into a `KeyedFormDataType` element
18
+ */
19
+ function generateKeyedFormData(formData) {
20
+ return !Array.isArray(formData)
21
+ ? []
22
+ : formData.map((item) => {
23
+ return {
24
+ key: generateRowId(),
25
+ item,
26
+ };
27
+ });
28
+ }
29
+ /** Converts `KeyedFormDataType` data into the inner `formData`
30
+ *
31
+ * @param keyedFormData - The `KeyedFormDataType` to be converted
32
+ * @returns - The inner `formData` item(s) in the `keyedFormData`
33
+ */
34
+ function keyedToPlainFormData(keyedFormData) {
35
+ if (Array.isArray(keyedFormData)) {
36
+ return keyedFormData.map((keyedItem) => keyedItem.item);
37
+ }
38
+ return [];
39
+ }
40
+ /** The `ArrayField` component is used to render a field in the schema that is of type `array`. It supports both normal
41
+ * and fixed array, allowing user to add and remove elements from the array data.
42
+ */
43
+ class ArrayField extends Component {
44
+ /** Constructs an `ArrayField` from the `props`, generating the initial keyed data from the `formData`
45
+ *
46
+ * @param props - The `FieldProps` for this template
47
+ */
48
+ constructor(props) {
49
+ super(props);
50
+ /** Returns the default form information for an item based on the schema for that item. Deals with the possibility
51
+ * that the schema is fixed and allows additional items.
52
+ */
53
+ this._getNewFormDataRow = () => {
54
+ const { schema, registry } = this.props;
55
+ const { schemaUtils } = registry;
56
+ let itemSchema = schema.items;
57
+ if (isFixedItems(schema) && allowAdditionalItems(schema)) {
58
+ itemSchema = schema.additionalItems;
59
+ }
60
+ // Cast this as a T to work around schema utils being for T[] caused by the FieldProps<T[], S, F> call on the class
61
+ return schemaUtils.getDefaultFormState(itemSchema);
62
+ };
63
+ /** Callback handler for when the user clicks on the add button. Creates a new row of keyed form data at the end of
64
+ * the list, adding it into the state, and then returning `onChange()` with the plain form data converted from the
65
+ * keyed data
66
+ *
67
+ * @param event - The event for the click
68
+ */
69
+ this.onAddClick = (event) => {
70
+ this._handleAddClick(event);
71
+ };
72
+ /** Callback handler for when the user clicks on the add button on an existing array element. Creates a new row of
73
+ * keyed form data inserted at the `index`, adding it into the state, and then returning `onChange()` with the plain
74
+ * form data converted from the keyed data
75
+ *
76
+ * @param index - The index at which the add button is clicked
77
+ */
78
+ this.onAddIndexClick = (index) => {
79
+ return (event) => {
80
+ this._handleAddClick(event, index);
81
+ };
82
+ };
83
+ /** Callback handler for when the user clicks on the copy button on an existing array element. Clones the row of
84
+ * keyed form data at the `index` into the next position in the state, and then returning `onChange()` with the plain
85
+ * form data converted from the keyed data
86
+ *
87
+ * @param index - The index at which the copy button is clicked
88
+ */
89
+ this.onCopyIndexClick = (index) => {
90
+ return (event) => {
91
+ if (event) {
92
+ event.preventDefault();
93
+ }
94
+ const { onChange } = this.props;
95
+ const { keyedFormData } = this.state;
96
+ const newKeyedFormDataRow = {
97
+ key: generateRowId(),
98
+ item: cloneDeep(keyedFormData[index].item),
99
+ };
100
+ const newKeyedFormData = [...keyedFormData];
101
+ if (index !== undefined) {
102
+ newKeyedFormData.splice(index + 1, 0, newKeyedFormDataRow);
103
+ }
104
+ else {
105
+ newKeyedFormData.push(newKeyedFormDataRow);
106
+ }
107
+ this.setState({
108
+ keyedFormData: newKeyedFormData,
109
+ updatedKeyedFormData: true,
110
+ }, () => onChange(keyedToPlainFormData(newKeyedFormData)));
111
+ };
112
+ };
113
+ /** Callback handler for when the user clicks on the remove button on an existing array element. Removes the row of
114
+ * keyed form data at the `index` in the state, and then returning `onChange()` with the plain form data converted
115
+ * from the keyed data
116
+ *
117
+ * @param index - The index at which the remove button is clicked
118
+ */
119
+ this.onDropIndexClick = (index) => {
120
+ return (event) => {
121
+ if (event) {
122
+ event.preventDefault();
123
+ }
124
+ const { onChange, errorSchema } = this.props;
125
+ const { keyedFormData } = this.state;
126
+ // refs #195: revalidate to ensure properly reindexing errors
127
+ let newErrorSchema;
128
+ if (errorSchema) {
129
+ newErrorSchema = {};
130
+ for (const idx in errorSchema) {
131
+ const i = parseInt(idx);
132
+ if (i < index) {
133
+ set(newErrorSchema, [i], errorSchema[idx]);
134
+ }
135
+ else if (i > index) {
136
+ set(newErrorSchema, [i - 1], errorSchema[idx]);
137
+ }
138
+ }
139
+ }
140
+ const newKeyedFormData = keyedFormData.filter((_, i) => i !== index);
141
+ this.setState({
142
+ keyedFormData: newKeyedFormData,
143
+ updatedKeyedFormData: true,
144
+ }, () => onChange(keyedToPlainFormData(newKeyedFormData), newErrorSchema));
145
+ };
146
+ };
147
+ /** Callback handler for when the user clicks on one of the move item buttons on an existing array element. Moves the
148
+ * row of keyed form data at the `index` to the `newIndex` in the state, and then returning `onChange()` with the
149
+ * plain form data converted from the keyed data
150
+ *
151
+ * @param index - The index of the item to move
152
+ * @param newIndex - The index to where the item is to be moved
153
+ */
154
+ this.onReorderClick = (index, newIndex) => {
155
+ return (event) => {
156
+ if (event) {
157
+ event.preventDefault();
158
+ event.currentTarget.blur();
159
+ }
160
+ const { onChange, errorSchema } = this.props;
161
+ let newErrorSchema;
162
+ if (errorSchema) {
163
+ newErrorSchema = {};
164
+ for (const idx in errorSchema) {
165
+ const i = parseInt(idx);
166
+ if (i == index) {
167
+ set(newErrorSchema, [newIndex], errorSchema[index]);
168
+ }
169
+ else if (i == newIndex) {
170
+ set(newErrorSchema, [index], errorSchema[newIndex]);
171
+ }
172
+ else {
173
+ set(newErrorSchema, [idx], errorSchema[i]);
174
+ }
175
+ }
176
+ }
177
+ const { keyedFormData } = this.state;
178
+ function reOrderArray() {
179
+ // Copy item
180
+ const _newKeyedFormData = keyedFormData.slice();
181
+ // Moves item from index to newIndex
182
+ _newKeyedFormData.splice(index, 1);
183
+ _newKeyedFormData.splice(newIndex, 0, keyedFormData[index]);
184
+ return _newKeyedFormData;
185
+ }
186
+ const newKeyedFormData = reOrderArray();
187
+ this.setState({
188
+ keyedFormData: newKeyedFormData,
189
+ }, () => onChange(keyedToPlainFormData(newKeyedFormData), newErrorSchema));
190
+ };
191
+ };
192
+ /** Callback handler used to deal with changing the value of the data in the array at the `index`. Calls the
193
+ * `onChange` callback with the updated form data
194
+ *
195
+ * @param index - The index of the item being changed
196
+ */
197
+ this.onChangeForIndex = (index) => {
198
+ return (value, newErrorSchema, id) => {
199
+ const { formData, onChange, errorSchema } = this.props;
200
+ const arrayData = Array.isArray(formData) ? formData : [];
201
+ const newFormData = arrayData.map((item, i) => {
202
+ // We need to treat undefined items as nulls to have validation.
203
+ // See https://github.com/tdegrunt/jsonschema/issues/206
204
+ const jsonValue = typeof value === 'undefined' ? null : value;
205
+ return index === i ? jsonValue : item;
206
+ });
207
+ onChange(newFormData, errorSchema &&
208
+ errorSchema && Object.assign(Object.assign({}, errorSchema), { [index]: newErrorSchema }), id);
209
+ };
210
+ };
211
+ /** Callback handler used to change the value for a checkbox */
212
+ this.onSelectChange = (value) => {
213
+ const { onChange, idSchema } = this.props;
214
+ onChange(value, undefined, idSchema && idSchema.$id);
215
+ };
216
+ const { formData = [] } = props;
217
+ const keyedFormData = generateKeyedFormData(formData);
218
+ this.state = {
219
+ keyedFormData,
220
+ updatedKeyedFormData: false,
221
+ };
222
+ }
223
+ /** React lifecycle method that is called when the props are about to change allowing the state to be updated. It
224
+ * regenerates the keyed form data and returns it
225
+ *
226
+ * @param nextProps - The next set of props data
227
+ * @param prevState - The previous set of state data
228
+ */
229
+ static getDerivedStateFromProps(nextProps, prevState) {
230
+ // Don't call getDerivedStateFromProps if keyed formdata was just updated.
231
+ if (prevState.updatedKeyedFormData) {
232
+ return {
233
+ updatedKeyedFormData: false,
234
+ };
235
+ }
236
+ const nextFormData = Array.isArray(nextProps.formData) ? nextProps.formData : [];
237
+ const previousKeyedFormData = prevState.keyedFormData || [];
238
+ const newKeyedFormData = nextFormData.length === previousKeyedFormData.length
239
+ ? previousKeyedFormData.map((previousKeyedFormDatum, index) => {
240
+ return {
241
+ key: previousKeyedFormDatum.key,
242
+ item: nextFormData[index],
243
+ };
244
+ })
245
+ : generateKeyedFormData(nextFormData);
246
+ return {
247
+ keyedFormData: newKeyedFormData,
248
+ };
249
+ }
250
+ /** Returns the appropriate title for an item by getting first the title from the schema.items, then falling back to
251
+ * the description from the schema.items, and finally the string "Item"
252
+ */
253
+ get itemTitle() {
254
+ const { schema, registry } = this.props;
255
+ const { translateString } = registry;
256
+ return get(schema, [ITEMS_KEY, 'title'], get(schema, [ITEMS_KEY, 'description'], translateString(TranslatableString.ArrayItemTitle)));
257
+ }
258
+ /** Determines whether the item described in the schema is always required, which is determined by whether any item
259
+ * may be null.
260
+ *
261
+ * @param itemSchema - The schema for the item
262
+ * @return - True if the item schema type does not contain the "null" type
263
+ */
264
+ isItemRequired(itemSchema) {
265
+ if (Array.isArray(itemSchema.type)) {
266
+ // While we don't yet support composite/nullable jsonschema types, it's
267
+ // future-proof to check for requirement against these.
268
+ return !itemSchema.type.includes('null');
269
+ }
270
+ // All non-null array item types are inherently required by design
271
+ return itemSchema.type !== 'null';
272
+ }
273
+ /** Determines whether more items can be added to the array. If the uiSchema indicates the array doesn't allow adding
274
+ * then false is returned. Otherwise, if the schema indicates that there are a maximum number of items and the
275
+ * `formData` matches that value, then false is returned, otherwise true is returned.
276
+ *
277
+ * @param formItems - The list of items in the form
278
+ * @returns - True if the item is addable otherwise false
279
+ */
280
+ canAddItem(formItems) {
281
+ const { schema, uiSchema, registry } = this.props;
282
+ let { addable } = getUiOptions(uiSchema, registry.globalUiOptions);
283
+ if (addable !== false) {
284
+ // if ui:options.addable was not explicitly set to false, we can add
285
+ // another item if we have not exceeded maxItems yet
286
+ if (schema.maxItems !== undefined) {
287
+ addable = formItems.length < schema.maxItems;
288
+ }
289
+ else {
290
+ addable = true;
291
+ }
292
+ }
293
+ return addable;
294
+ }
295
+ /** Callback handler for when the user clicks on the add or add at index buttons. Creates a new row of keyed form data
296
+ * either at the end of the list (when index is not specified) or inserted at the `index` when it is, adding it into
297
+ * the state, and then returning `onChange()` with the plain form data converted from the keyed data
298
+ *
299
+ * @param event - The event for the click
300
+ * @param [index] - The optional index at which to add the new data
301
+ */
302
+ _handleAddClick(event, index) {
303
+ if (event) {
304
+ event.preventDefault();
305
+ }
306
+ const { onChange } = this.props;
307
+ const { keyedFormData } = this.state;
308
+ const newKeyedFormDataRow = {
309
+ key: generateRowId(),
310
+ item: this._getNewFormDataRow(),
311
+ };
312
+ const newKeyedFormData = [...keyedFormData];
313
+ if (index !== undefined) {
314
+ newKeyedFormData.splice(index, 0, newKeyedFormDataRow);
315
+ }
316
+ else {
317
+ newKeyedFormData.push(newKeyedFormDataRow);
318
+ }
319
+ this.setState({
320
+ keyedFormData: newKeyedFormData,
321
+ updatedKeyedFormData: true,
322
+ }, () => onChange(keyedToPlainFormData(newKeyedFormData)));
323
+ }
324
+ /** Renders the `ArrayField` depending on the specific needs of the schema and uischema elements
325
+ */
326
+ render() {
327
+ const { schema, uiSchema, idSchema, registry } = this.props;
328
+ const { schemaUtils, translateString } = registry;
329
+ if (!(ITEMS_KEY in schema)) {
330
+ const uiOptions = getUiOptions(uiSchema);
331
+ const UnsupportedFieldTemplate = getTemplate('UnsupportedFieldTemplate', registry, uiOptions);
332
+ return (_jsx(UnsupportedFieldTemplate, { schema: schema, idSchema: idSchema, reason: translateString(TranslatableString.MissingItems), registry: registry }));
333
+ }
334
+ if (schemaUtils.isMultiSelect(schema)) {
335
+ // If array has enum or uniqueItems set to true, call renderMultiSelect() to render the default multiselect widget or a custom widget, if specified.
336
+ return this.renderMultiSelect();
337
+ }
338
+ if (isCustomWidget(uiSchema)) {
339
+ return this.renderCustomWidget();
340
+ }
341
+ if (isFixedItems(schema)) {
342
+ return this.renderFixedArray();
343
+ }
344
+ if (schemaUtils.isFilesArray(schema, uiSchema)) {
345
+ return this.renderFiles();
346
+ }
347
+ return this.renderNormalArray();
348
+ }
349
+ /** Renders a normal array without any limitations of length
350
+ */
351
+ renderNormalArray() {
352
+ const { schema, uiSchema = {}, errorSchema, idSchema, name, disabled = false, readonly = false, autofocus = false, required = false, registry, onBlur, onFocus, idPrefix, idSeparator = '_', rawErrors, } = this.props;
353
+ const { keyedFormData } = this.state;
354
+ const title = schema.title === undefined ? name : schema.title;
355
+ const { schemaUtils, formContext } = registry;
356
+ const uiOptions = getUiOptions(uiSchema);
357
+ const _schemaItems = isObject(schema.items) ? schema.items : {};
358
+ const itemsSchema = schemaUtils.retrieveSchema(_schemaItems);
359
+ const formData = keyedToPlainFormData(this.state.keyedFormData);
360
+ const canAdd = this.canAddItem(formData);
361
+ const arrayProps = {
362
+ canAdd,
363
+ items: keyedFormData.map((keyedItem, index) => {
364
+ const { key, item } = keyedItem;
365
+ // While we are actually dealing with a single item of type T, the types require a T[], so cast
366
+ const itemCast = item;
367
+ const itemSchema = schemaUtils.retrieveSchema(_schemaItems, itemCast);
368
+ const itemErrorSchema = errorSchema ? errorSchema[index] : undefined;
369
+ const itemIdPrefix = idSchema.$id + idSeparator + index;
370
+ const itemIdSchema = schemaUtils.toIdSchema(itemSchema, itemIdPrefix, itemCast, idPrefix, idSeparator);
371
+ return this.renderArrayFieldItem({
372
+ key,
373
+ index,
374
+ name: name && `${name}-${index}`,
375
+ canAdd,
376
+ canMoveUp: index > 0,
377
+ canMoveDown: index < formData.length - 1,
378
+ itemSchema,
379
+ itemIdSchema,
380
+ itemErrorSchema,
381
+ itemData: itemCast,
382
+ itemUiSchema: uiSchema.items,
383
+ autofocus: autofocus && index === 0,
384
+ onBlur,
385
+ onFocus,
386
+ rawErrors,
387
+ totalItems: keyedFormData.length,
388
+ });
389
+ }),
390
+ className: `field field-array field-array-of-${itemsSchema.type}`,
391
+ disabled,
392
+ idSchema,
393
+ uiSchema,
394
+ onAddClick: this.onAddClick,
395
+ readonly,
396
+ required,
397
+ schema,
398
+ title,
399
+ formContext,
400
+ formData,
401
+ rawErrors,
402
+ registry,
403
+ };
404
+ const Template = getTemplate('ArrayFieldTemplate', registry, uiOptions);
405
+ return _jsx(Template, Object.assign({}, arrayProps));
406
+ }
407
+ /** Renders an array using the custom widget provided by the user in the `uiSchema`
408
+ */
409
+ renderCustomWidget() {
410
+ var _a;
411
+ const { schema, idSchema, uiSchema, disabled = false, readonly = false, autofocus = false, required = false, hideError, placeholder, onBlur, onFocus, formData: items = [], registry, rawErrors, name, } = this.props;
412
+ const { widgets, formContext, globalUiOptions, schemaUtils } = registry;
413
+ const _b = getUiOptions(uiSchema, globalUiOptions), { widget, title: uiTitle } = _b, options = __rest(_b, ["widget", "title"]);
414
+ const Widget = getWidget(schema, widget, widgets);
415
+ const label = (_a = uiTitle !== null && uiTitle !== void 0 ? uiTitle : schema.title) !== null && _a !== void 0 ? _a : name;
416
+ const displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema, globalUiOptions);
417
+ return (_jsx(Widget, { id: idSchema.$id, name: name, multiple: true, onChange: this.onSelectChange, onBlur: onBlur, onFocus: onFocus, options: options, schema: schema, uiSchema: uiSchema, registry: registry, value: items, disabled: disabled, readonly: readonly, hideError: hideError, required: required, label: label, hideLabel: !displayLabel, placeholder: placeholder, formContext: formContext, autofocus: autofocus, rawErrors: rawErrors }));
418
+ }
419
+ /** Renders an array as a set of checkboxes
420
+ */
421
+ renderMultiSelect() {
422
+ var _a;
423
+ const { schema, idSchema, uiSchema, formData: items = [], disabled = false, readonly = false, autofocus = false, required = false, placeholder, onBlur, onFocus, registry, rawErrors, name, } = this.props;
424
+ const { widgets, schemaUtils, formContext, globalUiOptions } = registry;
425
+ const itemsSchema = schemaUtils.retrieveSchema(schema.items, items);
426
+ const enumOptions = optionsList(itemsSchema);
427
+ const _b = getUiOptions(uiSchema, globalUiOptions), { widget = 'select', title: uiTitle } = _b, options = __rest(_b, ["widget", "title"]);
428
+ const Widget = getWidget(schema, widget, widgets);
429
+ const label = (_a = uiTitle !== null && uiTitle !== void 0 ? uiTitle : schema.title) !== null && _a !== void 0 ? _a : name;
430
+ const displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema, globalUiOptions);
431
+ return (_jsx(Widget, { id: idSchema.$id, name: name, multiple: true, onChange: this.onSelectChange, onBlur: onBlur, onFocus: onFocus, options: Object.assign(Object.assign({}, options), { enumOptions }), schema: schema, uiSchema: uiSchema, registry: registry, value: items, disabled: disabled, readonly: readonly, required: required, label: label, hideLabel: !displayLabel, placeholder: placeholder, formContext: formContext, autofocus: autofocus, rawErrors: rawErrors }));
432
+ }
433
+ /** Renders an array of files using the `FileWidget`
434
+ */
435
+ renderFiles() {
436
+ var _a;
437
+ const { schema, uiSchema, idSchema, name, disabled = false, readonly = false, autofocus = false, required = false, onBlur, onFocus, registry, formData: items = [], rawErrors, } = this.props;
438
+ const { widgets, formContext, globalUiOptions, schemaUtils } = registry;
439
+ const _b = getUiOptions(uiSchema, globalUiOptions), { widget = 'files', title: uiTitle } = _b, options = __rest(_b, ["widget", "title"]);
440
+ const Widget = getWidget(schema, widget, widgets);
441
+ const label = (_a = uiTitle !== null && uiTitle !== void 0 ? uiTitle : schema.title) !== null && _a !== void 0 ? _a : name;
442
+ const displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema, globalUiOptions);
443
+ return (_jsx(Widget, { options: options, id: idSchema.$id, name: name, multiple: true, onChange: this.onSelectChange, onBlur: onBlur, onFocus: onFocus, schema: schema, uiSchema: uiSchema, value: items, disabled: disabled, readonly: readonly, required: required, registry: registry, formContext: formContext, autofocus: autofocus, rawErrors: rawErrors, label: label, hideLabel: !displayLabel }));
444
+ }
445
+ /** Renders an array that has a maximum limit of items
446
+ */
447
+ renderFixedArray() {
448
+ const { schema, uiSchema = {}, formData = [], errorSchema, idPrefix, idSeparator = '_', idSchema, name, disabled = false, readonly = false, autofocus = false, required = false, registry, onBlur, onFocus, rawErrors, } = this.props;
449
+ const { keyedFormData } = this.state;
450
+ let { formData: items = [] } = this.props;
451
+ const title = schema.title || name;
452
+ const uiOptions = getUiOptions(uiSchema);
453
+ const { schemaUtils, formContext } = registry;
454
+ const _schemaItems = isObject(schema.items) ? schema.items : [];
455
+ const itemSchemas = _schemaItems.map((item, index) => schemaUtils.retrieveSchema(item, formData[index]));
456
+ const additionalSchema = isObject(schema.additionalItems)
457
+ ? schemaUtils.retrieveSchema(schema.additionalItems, formData)
458
+ : null;
459
+ if (!items || items.length < itemSchemas.length) {
460
+ // to make sure at least all fixed items are generated
461
+ items = items || [];
462
+ items = items.concat(new Array(itemSchemas.length - items.length));
463
+ }
464
+ // These are the props passed into the render function
465
+ const canAdd = this.canAddItem(items) && !!additionalSchema;
466
+ const arrayProps = {
467
+ canAdd,
468
+ className: 'field field-array field-array-fixed-items',
469
+ disabled,
470
+ idSchema,
471
+ formData,
472
+ items: keyedFormData.map((keyedItem, index) => {
473
+ const { key, item } = keyedItem;
474
+ // While we are actually dealing with a single item of type T, the types require a T[], so cast
475
+ const itemCast = item;
476
+ const additional = index >= itemSchemas.length;
477
+ const itemSchema = additional && isObject(schema.additionalItems)
478
+ ? schemaUtils.retrieveSchema(schema.additionalItems, itemCast)
479
+ : itemSchemas[index];
480
+ const itemIdPrefix = idSchema.$id + idSeparator + index;
481
+ const itemIdSchema = schemaUtils.toIdSchema(itemSchema, itemIdPrefix, itemCast, idPrefix, idSeparator);
482
+ const itemUiSchema = additional
483
+ ? uiSchema.additionalItems || {}
484
+ : Array.isArray(uiSchema.items)
485
+ ? uiSchema.items[index]
486
+ : uiSchema.items || {};
487
+ const itemErrorSchema = errorSchema ? errorSchema[index] : undefined;
488
+ return this.renderArrayFieldItem({
489
+ key,
490
+ index,
491
+ name: name && `${name}-${index}`,
492
+ canAdd,
493
+ canRemove: additional,
494
+ canMoveUp: index >= itemSchemas.length + 1,
495
+ canMoveDown: additional && index < items.length - 1,
496
+ itemSchema,
497
+ itemData: itemCast,
498
+ itemUiSchema,
499
+ itemIdSchema,
500
+ itemErrorSchema,
501
+ autofocus: autofocus && index === 0,
502
+ onBlur,
503
+ onFocus,
504
+ rawErrors,
505
+ totalItems: keyedFormData.length,
506
+ });
507
+ }),
508
+ onAddClick: this.onAddClick,
509
+ readonly,
510
+ required,
511
+ registry,
512
+ schema,
513
+ uiSchema,
514
+ title,
515
+ formContext,
516
+ rawErrors,
517
+ };
518
+ const Template = getTemplate('ArrayFieldTemplate', registry, uiOptions);
519
+ return _jsx(Template, Object.assign({}, arrayProps));
520
+ }
521
+ /** Renders the individual array item using a `SchemaField` along with the additional properties required to be send
522
+ * back to the `ArrayFieldItemTemplate`.
523
+ *
524
+ * @param props - The props for the individual array item to be rendered
525
+ */
526
+ renderArrayFieldItem(props) {
527
+ const { key, index, name, canAdd, canRemove = true, canMoveUp, canMoveDown, itemSchema, itemData, itemUiSchema, itemIdSchema, itemErrorSchema, autofocus, onBlur, onFocus, rawErrors, totalItems, } = props;
528
+ const { disabled, hideError, idPrefix, idSeparator, readonly, uiSchema, registry, formContext } = this.props;
529
+ const { fields: { ArraySchemaField, SchemaField }, globalUiOptions, } = registry;
530
+ const ItemSchemaField = ArraySchemaField || SchemaField;
531
+ const { orderable = true, removable = true, copyable = false } = getUiOptions(uiSchema, globalUiOptions);
532
+ const has = {
533
+ moveUp: orderable && canMoveUp,
534
+ moveDown: orderable && canMoveDown,
535
+ copy: copyable && canAdd,
536
+ remove: removable && canRemove,
537
+ toolbar: false,
538
+ };
539
+ has.toolbar = Object.keys(has).some((key) => has[key]);
540
+ return {
541
+ children: (_jsx(ItemSchemaField, { name: name, index: index, schema: itemSchema, uiSchema: itemUiSchema, formData: itemData, formContext: formContext, errorSchema: itemErrorSchema, idPrefix: idPrefix, idSeparator: idSeparator, idSchema: itemIdSchema, required: this.isItemRequired(itemSchema), onChange: this.onChangeForIndex(index), onBlur: onBlur, onFocus: onFocus, registry: registry, disabled: disabled, readonly: readonly, hideError: hideError, autofocus: autofocus, rawErrors: rawErrors })),
542
+ className: 'array-item',
543
+ disabled,
544
+ canAdd,
545
+ hasCopy: has.copy,
546
+ hasToolbar: has.toolbar,
547
+ hasMoveUp: has.moveUp,
548
+ hasMoveDown: has.moveDown,
549
+ hasRemove: has.remove,
550
+ index,
551
+ totalItems,
552
+ key,
553
+ onAddIndexClick: this.onAddIndexClick,
554
+ onCopyIndexClick: this.onCopyIndexClick,
555
+ onDropIndexClick: this.onDropIndexClick,
556
+ onReorderClick: this.onReorderClick,
557
+ readonly,
558
+ registry,
559
+ schema: itemSchema,
560
+ uiSchema: itemUiSchema,
561
+ };
562
+ }
563
+ }
564
+ /** `ArrayField` is `React.ComponentType<FieldProps<T[], S, F>>` (necessarily) but the `registry` requires things to be a
565
+ * `Field` which is defined as `React.ComponentType<FieldProps<T, S, F>>`, so cast it to make `registry` happy.
566
+ */
567
+ export default ArrayField;
568
+ //# sourceMappingURL=ArrayField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArrayField.js","sourceRoot":"","sources":["../../../src/components/fields/ArrayField.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,SAAS,EAAc,MAAM,OAAO,CAAC;AAC9C,OAAO,EACL,WAAW,EACX,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,WAAW,EAQX,kBAAkB,EAElB,SAAS,GACV,MAAM,aAAa,CAAC;AACrB,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAahC,2DAA2D;AAC3D,SAAS,aAAa;IACpB,OAAO,MAAM,EAAE,CAAC;AAClB,CAAC;AAED;;;;GAIG;AACH,SAAS,qBAAqB,CAAI,QAAa;IAC7C,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;QAC7B,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACpB,OAAO;gBACL,GAAG,EAAE,aAAa,EAAE;gBACpB,IAAI;aACL,CAAC;QACJ,CAAC,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H,eAAe,UAAU,CAAC"}
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { FieldProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
3
+ /** The `BooleanField` component is used to render a field in the schema is boolean. It constructs `enumOptions` for the
4
+ * two boolean values based on the various alternatives in the schema.
5
+ *
6
+ * @param props - The `FieldProps` for this template
7
+ */
8
+ declare function BooleanField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: FieldProps<T, S, F>): JSX.Element;
9
+ export default BooleanField;