@rjsf/react-bootstrap 6.0.0-alpha.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 (206) hide show
  1. package/LICENSE.md +201 -0
  2. package/README.md +111 -0
  3. package/dist/index.js +940 -0
  4. package/dist/index.js.map +7 -0
  5. package/dist/react-bootstrap.esm.js +948 -0
  6. package/dist/react-bootstrap.esm.js.map +7 -0
  7. package/dist/react-bootstrap.umd.js +804 -0
  8. package/lib/AddButton/AddButton.d.ts +2 -0
  9. package/lib/AddButton/AddButton.js +9 -0
  10. package/lib/AddButton/AddButton.js.map +1 -0
  11. package/lib/AddButton/index.d.ts +2 -0
  12. package/lib/AddButton/index.js +3 -0
  13. package/lib/AddButton/index.js.map +1 -0
  14. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +2 -0
  15. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +15 -0
  16. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -0
  17. package/lib/ArrayFieldItemTemplate/index.d.ts +2 -0
  18. package/lib/ArrayFieldItemTemplate/index.js +3 -0
  19. package/lib/ArrayFieldItemTemplate/index.js.map +1 -0
  20. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +2 -0
  21. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +17 -0
  22. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -0
  23. package/lib/ArrayFieldTemplate/index.d.ts +2 -0
  24. package/lib/ArrayFieldTemplate/index.js +3 -0
  25. package/lib/ArrayFieldTemplate/index.js.map +1 -0
  26. package/lib/BaseInputTemplate/BaseInputTemplate.d.ts +2 -0
  27. package/lib/BaseInputTemplate/BaseInputTemplate.js +19 -0
  28. package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -0
  29. package/lib/BaseInputTemplate/index.d.ts +2 -0
  30. package/lib/BaseInputTemplate/index.js +3 -0
  31. package/lib/BaseInputTemplate/index.js.map +1 -0
  32. package/lib/CheckboxWidget/CheckboxWidget.d.ts +2 -0
  33. package/lib/CheckboxWidget/CheckboxWidget.js +17 -0
  34. package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -0
  35. package/lib/CheckboxWidget/index.d.ts +2 -0
  36. package/lib/CheckboxWidget/index.js +3 -0
  37. package/lib/CheckboxWidget/index.js.map +1 -0
  38. package/lib/CheckboxesWidget/CheckboxesWidget.d.ts +2 -0
  39. package/lib/CheckboxesWidget/CheckboxesWidget.js +24 -0
  40. package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -0
  41. package/lib/CheckboxesWidget/index.d.ts +2 -0
  42. package/lib/CheckboxesWidget/index.js +3 -0
  43. package/lib/CheckboxesWidget/index.js.map +1 -0
  44. package/lib/DescriptionField/DescriptionField.d.ts +2 -0
  45. package/lib/DescriptionField/DescriptionField.js +8 -0
  46. package/lib/DescriptionField/DescriptionField.js.map +1 -0
  47. package/lib/DescriptionField/index.d.ts +2 -0
  48. package/lib/DescriptionField/index.js +3 -0
  49. package/lib/DescriptionField/index.js.map +1 -0
  50. package/lib/ErrorList/ErrorList.d.ts +2 -0
  51. package/lib/ErrorList/ErrorList.js +11 -0
  52. package/lib/ErrorList/ErrorList.js.map +1 -0
  53. package/lib/ErrorList/index.d.ts +2 -0
  54. package/lib/ErrorList/index.js +3 -0
  55. package/lib/ErrorList/index.js.map +1 -0
  56. package/lib/FieldErrorTemplate/FieldErrorTemplate.d.ts +6 -0
  57. package/lib/FieldErrorTemplate/FieldErrorTemplate.js +18 -0
  58. package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -0
  59. package/lib/FieldErrorTemplate/index.d.ts +2 -0
  60. package/lib/FieldErrorTemplate/index.js +3 -0
  61. package/lib/FieldErrorTemplate/index.js.map +1 -0
  62. package/lib/FieldHelpTemplate/FieldHelpTemplate.d.ts +6 -0
  63. package/lib/FieldHelpTemplate/FieldHelpTemplate.js +16 -0
  64. package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -0
  65. package/lib/FieldHelpTemplate/index.d.ts +2 -0
  66. package/lib/FieldHelpTemplate/index.js +3 -0
  67. package/lib/FieldHelpTemplate/index.js.map +1 -0
  68. package/lib/FieldTemplate/FieldTemplate.d.ts +2 -0
  69. package/lib/FieldTemplate/FieldTemplate.js +12 -0
  70. package/lib/FieldTemplate/FieldTemplate.js.map +1 -0
  71. package/lib/FieldTemplate/index.d.ts +2 -0
  72. package/lib/FieldTemplate/index.js +3 -0
  73. package/lib/FieldTemplate/index.js.map +1 -0
  74. package/lib/Form/Form.d.ts +6 -0
  75. package/lib/Form/Form.js +7 -0
  76. package/lib/Form/Form.js.map +1 -0
  77. package/lib/Form/index.d.ts +2 -0
  78. package/lib/Form/index.js +3 -0
  79. package/lib/Form/index.js.map +1 -0
  80. package/lib/IconButton/IconButton.d.ts +7 -0
  81. package/lib/IconButton/IconButton.js +28 -0
  82. package/lib/IconButton/IconButton.js.map +1 -0
  83. package/lib/IconButton/index.d.ts +2 -0
  84. package/lib/IconButton/index.js +3 -0
  85. package/lib/IconButton/index.js.map +1 -0
  86. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +2 -0
  87. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +14 -0
  88. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -0
  89. package/lib/ObjectFieldTemplate/index.d.ts +2 -0
  90. package/lib/ObjectFieldTemplate/index.js +3 -0
  91. package/lib/ObjectFieldTemplate/index.js.map +1 -0
  92. package/lib/RadioWidget/RadioWidget.d.ts +2 -0
  93. package/lib/RadioWidget/RadioWidget.js +18 -0
  94. package/lib/RadioWidget/RadioWidget.js.map +1 -0
  95. package/lib/RadioWidget/index.d.ts +2 -0
  96. package/lib/RadioWidget/index.js +3 -0
  97. package/lib/RadioWidget/index.js.map +1 -0
  98. package/lib/RangeWidget/RangeWidget.d.ts +2 -0
  99. package/lib/RangeWidget/RangeWidget.js +21 -0
  100. package/lib/RangeWidget/RangeWidget.js.map +1 -0
  101. package/lib/RangeWidget/index.d.ts +2 -0
  102. package/lib/RangeWidget/index.js +3 -0
  103. package/lib/RangeWidget/index.js.map +1 -0
  104. package/lib/SelectWidget/SelectWidget.d.ts +2 -0
  105. package/lib/SelectWidget/SelectWidget.js +36 -0
  106. package/lib/SelectWidget/SelectWidget.js.map +1 -0
  107. package/lib/SelectWidget/index.d.ts +2 -0
  108. package/lib/SelectWidget/index.js +3 -0
  109. package/lib/SelectWidget/index.js.map +1 -0
  110. package/lib/SubmitButton/SubmitButton.d.ts +2 -0
  111. package/lib/SubmitButton/SubmitButton.js +11 -0
  112. package/lib/SubmitButton/SubmitButton.js.map +1 -0
  113. package/lib/SubmitButton/index.d.ts +2 -0
  114. package/lib/SubmitButton/index.js +3 -0
  115. package/lib/SubmitButton/index.js.map +1 -0
  116. package/lib/Templates/Templates.d.ts +4 -0
  117. package/lib/Templates/Templates.js +39 -0
  118. package/lib/Templates/Templates.js.map +1 -0
  119. package/lib/Templates/index.d.ts +2 -0
  120. package/lib/Templates/index.js +3 -0
  121. package/lib/Templates/index.js.map +1 -0
  122. package/lib/TextareaWidget/TextareaWidget.d.ts +6 -0
  123. package/lib/TextareaWidget/TextareaWidget.js +11 -0
  124. package/lib/TextareaWidget/TextareaWidget.js.map +1 -0
  125. package/lib/TextareaWidget/index.d.ts +2 -0
  126. package/lib/TextareaWidget/index.js +3 -0
  127. package/lib/TextareaWidget/index.js.map +1 -0
  128. package/lib/Theme/Theme.d.ts +5 -0
  129. package/lib/Theme/Theme.js +10 -0
  130. package/lib/Theme/Theme.js.map +1 -0
  131. package/lib/Theme/index.d.ts +2 -0
  132. package/lib/Theme/index.js +3 -0
  133. package/lib/Theme/index.js.map +1 -0
  134. package/lib/TitleField/TitleField.d.ts +2 -0
  135. package/lib/TitleField/TitleField.js +7 -0
  136. package/lib/TitleField/TitleField.js.map +1 -0
  137. package/lib/TitleField/index.d.ts +2 -0
  138. package/lib/TitleField/index.js +3 -0
  139. package/lib/TitleField/index.js.map +1 -0
  140. package/lib/Widgets/Widgets.d.ts +4 -0
  141. package/lib/Widgets/Widgets.js +18 -0
  142. package/lib/Widgets/Widgets.js.map +1 -0
  143. package/lib/Widgets/index.d.ts +2 -0
  144. package/lib/Widgets/index.js +3 -0
  145. package/lib/Widgets/index.js.map +1 -0
  146. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.d.ts +2 -0
  147. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +19 -0
  148. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -0
  149. package/lib/WrapIfAdditionalTemplate/index.d.ts +2 -0
  150. package/lib/WrapIfAdditionalTemplate/index.js +3 -0
  151. package/lib/WrapIfAdditionalTemplate/index.js.map +1 -0
  152. package/lib/index.d.ts +6 -0
  153. package/lib/index.js +7 -0
  154. package/lib/index.js.map +1 -0
  155. package/lib/tsconfig.tsbuildinfo +1 -0
  156. package/package.json +98 -0
  157. package/src/AddButton/AddButton.tsx +21 -0
  158. package/src/AddButton/index.ts +2 -0
  159. package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +94 -0
  160. package/src/ArrayFieldItemTemplate/index.ts +2 -0
  161. package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +86 -0
  162. package/src/ArrayFieldTemplate/index.ts +2 -0
  163. package/src/BaseInputTemplate/BaseInputTemplate.tsx +77 -0
  164. package/src/BaseInputTemplate/index.ts +2 -0
  165. package/src/CheckboxWidget/CheckboxWidget.tsx +80 -0
  166. package/src/CheckboxWidget/index.ts +2 -0
  167. package/src/CheckboxesWidget/CheckboxesWidget.tsx +68 -0
  168. package/src/CheckboxesWidget/index.ts +2 -0
  169. package/src/DescriptionField/DescriptionField.tsx +19 -0
  170. package/src/DescriptionField/index.ts +2 -0
  171. package/src/ErrorList/ErrorList.tsx +27 -0
  172. package/src/ErrorList/index.ts +2 -0
  173. package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +30 -0
  174. package/src/FieldErrorTemplate/index.ts +2 -0
  175. package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +23 -0
  176. package/src/FieldHelpTemplate/index.ts +2 -0
  177. package/src/FieldTemplate/FieldTemplate.tsx +77 -0
  178. package/src/FieldTemplate/index.ts +2 -0
  179. package/src/Form/Form.tsx +15 -0
  180. package/src/Form/index.ts +2 -0
  181. package/src/IconButton/IconButton.tsx +62 -0
  182. package/src/IconButton/index.ts +2 -0
  183. package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +89 -0
  184. package/src/ObjectFieldTemplate/index.ts +2 -0
  185. package/src/RadioWidget/RadioWidget.tsx +65 -0
  186. package/src/RadioWidget/index.ts +2 -0
  187. package/src/RangeWidget/RangeWidget.tsx +31 -0
  188. package/src/RangeWidget/index.ts +2 -0
  189. package/src/SelectWidget/SelectWidget.tsx +91 -0
  190. package/src/SelectWidget/index.ts +2 -0
  191. package/src/SubmitButton/SubmitButton.tsx +18 -0
  192. package/src/SubmitButton/index.ts +2 -0
  193. package/src/Templates/Templates.ts +45 -0
  194. package/src/Templates/index.ts +2 -0
  195. package/src/TextareaWidget/TextareaWidget.tsx +56 -0
  196. package/src/TextareaWidget/index.ts +2 -0
  197. package/src/Theme/Theme.tsx +18 -0
  198. package/src/Theme/index.ts +2 -0
  199. package/src/TitleField/TitleField.tsx +15 -0
  200. package/src/TitleField/index.ts +2 -0
  201. package/src/Widgets/Widgets.ts +24 -0
  202. package/src/Widgets/index.ts +2 -0
  203. package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +79 -0
  204. package/src/WrapIfAdditionalTemplate/index.ts +2 -0
  205. package/src/index.ts +8 -0
  206. package/src/tsconfig.json +23 -0
@@ -0,0 +1,948 @@
1
+ // src/Form/Form.tsx
2
+ import { withTheme } from "@rjsf/core";
3
+
4
+ // src/AddButton/AddButton.tsx
5
+ import { TranslatableString } from "@rjsf/utils";
6
+ import Button from "react-bootstrap/Button";
7
+ import { BsPlus } from "@react-icons/all-files/bs/BsPlus";
8
+ import { jsx } from "react/jsx-runtime";
9
+ function AddButton({
10
+ uiSchema,
11
+ registry,
12
+ ...props
13
+ }) {
14
+ const { translateString } = registry;
15
+ return /* @__PURE__ */ jsx(
16
+ Button,
17
+ {
18
+ ...props,
19
+ style: { width: "100%" },
20
+ className: `ml-1 ${props.className}`,
21
+ title: translateString(TranslatableString.AddItemButton),
22
+ children: /* @__PURE__ */ jsx(BsPlus, {})
23
+ }
24
+ );
25
+ }
26
+
27
+ // src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx
28
+ import Row from "react-bootstrap/Row";
29
+ import Col from "react-bootstrap/Col";
30
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
31
+ function ArrayFieldItemTemplate(props) {
32
+ const {
33
+ children,
34
+ disabled,
35
+ hasToolbar,
36
+ hasCopy,
37
+ hasMoveDown,
38
+ hasMoveUp,
39
+ hasRemove,
40
+ index,
41
+ onCopyIndexClick,
42
+ onDropIndexClick,
43
+ onReorderClick,
44
+ readonly,
45
+ registry,
46
+ uiSchema
47
+ } = props;
48
+ const { CopyButton: CopyButton2, MoveDownButton: MoveDownButton2, MoveUpButton: MoveUpButton2, RemoveButton: RemoveButton2 } = registry.templates.ButtonTemplates;
49
+ const btnStyle = {
50
+ flex: 1,
51
+ paddingLeft: 6,
52
+ paddingRight: 6,
53
+ fontWeight: "bold"
54
+ };
55
+ return /* @__PURE__ */ jsx2("div", { children: /* @__PURE__ */ jsxs(Row, { className: "mb-2 d-flex align-items-center", children: [
56
+ /* @__PURE__ */ jsx2(Col, { xs: "9", lg: "9", children }),
57
+ /* @__PURE__ */ jsx2(Col, { xs: "3", lg: "3", className: "py-4", children: hasToolbar && /* @__PURE__ */ jsxs("div", { className: "d-flex flex-row", children: [
58
+ (hasMoveUp || hasMoveDown) && /* @__PURE__ */ jsx2("div", { className: "m-0 p-0", children: /* @__PURE__ */ jsx2(
59
+ MoveUpButton2,
60
+ {
61
+ className: "array-item-move-up",
62
+ style: btnStyle,
63
+ disabled: disabled || readonly || !hasMoveUp,
64
+ onClick: onReorderClick(index, index - 1),
65
+ uiSchema,
66
+ registry
67
+ }
68
+ ) }),
69
+ (hasMoveUp || hasMoveDown) && /* @__PURE__ */ jsx2("div", { className: "m-0 p-0", children: /* @__PURE__ */ jsx2(
70
+ MoveDownButton2,
71
+ {
72
+ style: btnStyle,
73
+ disabled: disabled || readonly || !hasMoveDown,
74
+ onClick: onReorderClick(index, index + 1),
75
+ uiSchema,
76
+ registry
77
+ }
78
+ ) }),
79
+ hasCopy && /* @__PURE__ */ jsx2("div", { className: "m-0 p-0", children: /* @__PURE__ */ jsx2(
80
+ CopyButton2,
81
+ {
82
+ style: btnStyle,
83
+ disabled: disabled || readonly,
84
+ onClick: onCopyIndexClick(index),
85
+ uiSchema,
86
+ registry
87
+ }
88
+ ) }),
89
+ hasRemove && /* @__PURE__ */ jsx2("div", { className: "m-0 p-0", children: /* @__PURE__ */ jsx2(
90
+ RemoveButton2,
91
+ {
92
+ style: btnStyle,
93
+ disabled: disabled || readonly,
94
+ onClick: onDropIndexClick(index),
95
+ uiSchema,
96
+ registry
97
+ }
98
+ ) })
99
+ ] }) })
100
+ ] }) });
101
+ }
102
+
103
+ // src/ArrayFieldTemplate/ArrayFieldTemplate.tsx
104
+ import Row2 from "react-bootstrap/Row";
105
+ import Col2 from "react-bootstrap/Col";
106
+ import Container from "react-bootstrap/Container";
107
+ import {
108
+ getTemplate,
109
+ getUiOptions
110
+ } from "@rjsf/utils";
111
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
112
+ function ArrayFieldTemplate(props) {
113
+ const { canAdd, disabled, idSchema, uiSchema, items, onAddClick, readonly, registry, required, schema, title } = props;
114
+ const uiOptions = getUiOptions(uiSchema);
115
+ const ArrayFieldDescriptionTemplate = getTemplate(
116
+ "ArrayFieldDescriptionTemplate",
117
+ registry,
118
+ uiOptions
119
+ );
120
+ const ArrayFieldItemTemplate2 = getTemplate(
121
+ "ArrayFieldItemTemplate",
122
+ registry,
123
+ uiOptions
124
+ );
125
+ const ArrayFieldTitleTemplate = getTemplate(
126
+ "ArrayFieldTitleTemplate",
127
+ registry,
128
+ uiOptions
129
+ );
130
+ const {
131
+ ButtonTemplates: { AddButton: AddButton2 }
132
+ } = registry.templates;
133
+ return /* @__PURE__ */ jsx3("div", { children: /* @__PURE__ */ jsx3(Row2, { className: "p-0 m-0", children: /* @__PURE__ */ jsxs2(Col2, { className: "p-0 m-0", children: [
134
+ /* @__PURE__ */ jsx3(
135
+ ArrayFieldTitleTemplate,
136
+ {
137
+ idSchema,
138
+ title: uiOptions.title || title,
139
+ schema,
140
+ uiSchema,
141
+ required,
142
+ registry
143
+ }
144
+ ),
145
+ /* @__PURE__ */ jsx3(
146
+ ArrayFieldDescriptionTemplate,
147
+ {
148
+ idSchema,
149
+ description: uiOptions.description || schema.description,
150
+ schema,
151
+ uiSchema,
152
+ registry
153
+ }
154
+ ),
155
+ /* @__PURE__ */ jsxs2(Container, { fluid: true, className: "p-0 m-0", children: [
156
+ items && items.map(({ key, ...itemProps }) => /* @__PURE__ */ jsx3(ArrayFieldItemTemplate2, { ...itemProps }, key)),
157
+ canAdd && /* @__PURE__ */ jsx3(Container, { className: "", children: /* @__PURE__ */ jsxs2(Row2, { className: "mt-2", children: [
158
+ /* @__PURE__ */ jsx3(Col2, { xs: 9 }),
159
+ /* @__PURE__ */ jsx3(Col2, { xs: 3, className: "py-4 col-lg-3 col-3", children: /* @__PURE__ */ jsx3(
160
+ AddButton2,
161
+ {
162
+ className: "array-item-add",
163
+ onClick: onAddClick,
164
+ disabled: disabled || readonly,
165
+ uiSchema,
166
+ registry
167
+ }
168
+ ) })
169
+ ] }) })
170
+ ] }, `array-item-list-${idSchema.$id}`)
171
+ ] }) }) });
172
+ }
173
+
174
+ // src/BaseInputTemplate/BaseInputTemplate.tsx
175
+ import Form from "react-bootstrap/Form";
176
+ import {
177
+ ariaDescribedByIds,
178
+ examplesId,
179
+ getInputProps
180
+ } from "@rjsf/utils";
181
+ import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
182
+ function BaseInputTemplate({
183
+ id,
184
+ placeholder,
185
+ required,
186
+ readonly,
187
+ disabled,
188
+ type,
189
+ value,
190
+ onChange,
191
+ onChangeOverride,
192
+ onBlur,
193
+ onFocus,
194
+ autofocus,
195
+ options,
196
+ schema,
197
+ rawErrors = [],
198
+ children,
199
+ extraProps
200
+ }) {
201
+ const inputProps = {
202
+ ...extraProps,
203
+ ...getInputProps(schema, type, options)
204
+ };
205
+ const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
206
+ const _onBlur = ({ target }) => onBlur(id, target && target.value);
207
+ const _onFocus = ({ target }) => onFocus(id, target && target.value);
208
+ return /* @__PURE__ */ jsxs3(Fragment, { children: [
209
+ /* @__PURE__ */ jsx4(
210
+ Form.Control,
211
+ {
212
+ id,
213
+ name: id,
214
+ placeholder,
215
+ autoFocus: autofocus,
216
+ required,
217
+ disabled,
218
+ readOnly: readonly,
219
+ className: rawErrors.length > 0 ? "is-invalid" : "",
220
+ list: schema.examples ? examplesId(id) : void 0,
221
+ ...inputProps,
222
+ value: value || value === 0 ? value : "",
223
+ onChange: onChangeOverride || _onChange,
224
+ onBlur: _onBlur,
225
+ onFocus: _onFocus,
226
+ "aria-describedby": ariaDescribedByIds(id, !!schema.examples)
227
+ }
228
+ ),
229
+ children,
230
+ Array.isArray(schema.examples) ? /* @__PURE__ */ jsx4("datalist", { id: examplesId(id), children: schema.examples.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : []).map((example) => {
231
+ return /* @__PURE__ */ jsx4("option", { value: example }, example);
232
+ }) }) : null
233
+ ] });
234
+ }
235
+
236
+ // src/DescriptionField/DescriptionField.tsx
237
+ import { jsx as jsx5 } from "react/jsx-runtime";
238
+ function DescriptionField({ id, description }) {
239
+ if (description) {
240
+ return /* @__PURE__ */ jsx5("div", { children: /* @__PURE__ */ jsx5("div", { id, className: "mb-3", children: description }) });
241
+ }
242
+ return null;
243
+ }
244
+
245
+ // src/ErrorList/ErrorList.tsx
246
+ import Card from "react-bootstrap/Card";
247
+ import ListGroup from "react-bootstrap/ListGroup";
248
+ import { TranslatableString as TranslatableString2 } from "@rjsf/utils";
249
+ import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
250
+ function ErrorList({
251
+ errors,
252
+ registry
253
+ }) {
254
+ const { translateString } = registry;
255
+ return /* @__PURE__ */ jsxs4(Card, { border: "danger", className: "mb-4", children: [
256
+ /* @__PURE__ */ jsx6(Card.Header, { className: "alert-danger", children: translateString(TranslatableString2.ErrorsLabel) }),
257
+ /* @__PURE__ */ jsx6(Card.Body, { className: "p-0", children: /* @__PURE__ */ jsx6(ListGroup, { children: errors.map((error, i) => {
258
+ return /* @__PURE__ */ jsx6(ListGroup.Item, { className: "border-0", children: /* @__PURE__ */ jsx6("span", { children: error.stack }) }, i);
259
+ }) }) })
260
+ ] });
261
+ }
262
+
263
+ // src/IconButton/IconButton.tsx
264
+ import { TranslatableString as TranslatableString3 } from "@rjsf/utils";
265
+ import Button2 from "react-bootstrap/Button";
266
+ import { IoIosCopy } from "@react-icons/all-files/io/IoIosCopy";
267
+ import { IoIosRemove } from "@react-icons/all-files/io/IoIosRemove";
268
+ import { AiOutlineArrowUp } from "@react-icons/all-files/ai/AiOutlineArrowUp";
269
+ import { AiOutlineArrowDown } from "@react-icons/all-files/ai/AiOutlineArrowDown";
270
+ import { jsx as jsx7 } from "react/jsx-runtime";
271
+ function IconButton(props) {
272
+ const { icon, iconType, className, uiSchema, registry, ...otherProps } = props;
273
+ return /* @__PURE__ */ jsx7(Button2, { ...otherProps, variant: props.variant || "light", size: "sm", children: icon });
274
+ }
275
+ function CopyButton(props) {
276
+ const {
277
+ registry: { translateString }
278
+ } = props;
279
+ return /* @__PURE__ */ jsx7(IconButton, { title: translateString(TranslatableString3.CopyButton), ...props, icon: /* @__PURE__ */ jsx7(IoIosCopy, {}) });
280
+ }
281
+ function MoveDownButton(props) {
282
+ const {
283
+ registry: { translateString }
284
+ } = props;
285
+ return /* @__PURE__ */ jsx7(IconButton, { title: translateString(TranslatableString3.MoveDownButton), ...props, icon: /* @__PURE__ */ jsx7(AiOutlineArrowDown, {}) });
286
+ }
287
+ function MoveUpButton(props) {
288
+ const {
289
+ registry: { translateString }
290
+ } = props;
291
+ return /* @__PURE__ */ jsx7(IconButton, { title: translateString(TranslatableString3.MoveUpButton), ...props, icon: /* @__PURE__ */ jsx7(AiOutlineArrowUp, {}) });
292
+ }
293
+ function RemoveButton(props) {
294
+ const {
295
+ registry: { translateString }
296
+ } = props;
297
+ return /* @__PURE__ */ jsx7(
298
+ IconButton,
299
+ {
300
+ title: translateString(TranslatableString3.RemoveButton),
301
+ ...props,
302
+ variant: "danger",
303
+ icon: /* @__PURE__ */ jsx7(IoIosRemove, {})
304
+ }
305
+ );
306
+ }
307
+
308
+ // src/FieldErrorTemplate/FieldErrorTemplate.tsx
309
+ import { errorId } from "@rjsf/utils";
310
+ import ListGroup2 from "react-bootstrap/ListGroup";
311
+ import { jsx as jsx8 } from "react/jsx-runtime";
312
+ function FieldErrorTemplate(props) {
313
+ const { errors = [], idSchema } = props;
314
+ if (errors.length === 0) {
315
+ return null;
316
+ }
317
+ const id = errorId(idSchema);
318
+ return /* @__PURE__ */ jsx8(ListGroup2, { as: "ul", id, children: errors.map((error, i) => {
319
+ return /* @__PURE__ */ jsx8(ListGroup2.Item, { as: "li", className: "border-0 m-0 p-0", children: /* @__PURE__ */ jsx8("small", { className: "m-0 text-danger", children: error }) }, i);
320
+ }) });
321
+ }
322
+
323
+ // src/FieldHelpTemplate/FieldHelpTemplate.tsx
324
+ import { helpId } from "@rjsf/utils";
325
+ import Form2 from "react-bootstrap/Form";
326
+ import { jsx as jsx9 } from "react/jsx-runtime";
327
+ function FieldHelpTemplate(props) {
328
+ const { idSchema, help, hasErrors } = props;
329
+ if (!help) {
330
+ return null;
331
+ }
332
+ const id = helpId(idSchema);
333
+ return /* @__PURE__ */ jsx9(Form2.Text, { className: hasErrors ? "text-danger" : "text-muted", id, children: help });
334
+ }
335
+
336
+ // src/FieldTemplate/FieldTemplate.tsx
337
+ import {
338
+ getTemplate as getTemplate2,
339
+ getUiOptions as getUiOptions2
340
+ } from "@rjsf/utils";
341
+ import Form3 from "react-bootstrap/Form";
342
+ import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
343
+ function FieldTemplate({
344
+ id,
345
+ children,
346
+ displayLabel,
347
+ rawErrors = [],
348
+ errors,
349
+ help,
350
+ description,
351
+ rawDescription,
352
+ classNames,
353
+ style,
354
+ disabled,
355
+ label,
356
+ hidden,
357
+ onDropPropertyClick,
358
+ onKeyChange,
359
+ readonly,
360
+ required,
361
+ schema,
362
+ uiSchema,
363
+ registry
364
+ }) {
365
+ const uiOptions = getUiOptions2(uiSchema);
366
+ const WrapIfAdditionalTemplate2 = getTemplate2(
367
+ "WrapIfAdditionalTemplate",
368
+ registry,
369
+ uiOptions
370
+ );
371
+ if (hidden) {
372
+ return /* @__PURE__ */ jsx10("div", { className: "hidden", children });
373
+ }
374
+ return /* @__PURE__ */ jsx10(
375
+ WrapIfAdditionalTemplate2,
376
+ {
377
+ classNames,
378
+ style,
379
+ disabled,
380
+ id,
381
+ label,
382
+ onDropPropertyClick,
383
+ onKeyChange,
384
+ readonly,
385
+ required,
386
+ schema,
387
+ uiSchema,
388
+ registry,
389
+ children: /* @__PURE__ */ jsxs5(Form3.Group, { children: [
390
+ displayLabel && /* @__PURE__ */ jsxs5(Form3.Label, { htmlFor: id, className: rawErrors.length > 0 ? "text-danger" : "", children: [
391
+ label,
392
+ required ? "*" : null
393
+ ] }),
394
+ children,
395
+ displayLabel && rawDescription && /* @__PURE__ */ jsx10(Form3.Text, { className: rawErrors.length > 0 ? "text-danger" : "text-muted", children: description }),
396
+ errors,
397
+ help
398
+ ] })
399
+ }
400
+ );
401
+ }
402
+
403
+ // src/ObjectFieldTemplate/ObjectFieldTemplate.tsx
404
+ import Row3 from "react-bootstrap/Row";
405
+ import Col3 from "react-bootstrap/Col";
406
+ import Container2 from "react-bootstrap/Container";
407
+ import {
408
+ canExpand,
409
+ descriptionId,
410
+ getTemplate as getTemplate3,
411
+ getUiOptions as getUiOptions3,
412
+ titleId
413
+ } from "@rjsf/utils";
414
+ import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
415
+ function ObjectFieldTemplate({
416
+ description,
417
+ title,
418
+ properties,
419
+ required,
420
+ uiSchema,
421
+ idSchema,
422
+ schema,
423
+ formData,
424
+ onAddClick,
425
+ disabled,
426
+ readonly,
427
+ registry
428
+ }) {
429
+ const uiOptions = getUiOptions3(uiSchema);
430
+ const TitleFieldTemplate = getTemplate3("TitleFieldTemplate", registry, uiOptions);
431
+ const DescriptionFieldTemplate = getTemplate3(
432
+ "DescriptionFieldTemplate",
433
+ registry,
434
+ uiOptions
435
+ );
436
+ const {
437
+ ButtonTemplates: { AddButton: AddButton2 }
438
+ } = registry.templates;
439
+ return /* @__PURE__ */ jsxs6(Fragment2, { children: [
440
+ title && /* @__PURE__ */ jsx11(
441
+ TitleFieldTemplate,
442
+ {
443
+ id: titleId(idSchema),
444
+ title,
445
+ required,
446
+ schema,
447
+ uiSchema,
448
+ registry
449
+ }
450
+ ),
451
+ description && /* @__PURE__ */ jsx11(
452
+ DescriptionFieldTemplate,
453
+ {
454
+ id: descriptionId(idSchema),
455
+ description,
456
+ schema,
457
+ uiSchema,
458
+ registry
459
+ }
460
+ ),
461
+ /* @__PURE__ */ jsxs6(Container2, { fluid: true, className: "p-0", children: [
462
+ properties.map((element, index) => /* @__PURE__ */ jsx11(Row3, { style: { marginBottom: "10px" }, className: element.hidden ? "d-none" : void 0, children: /* @__PURE__ */ jsxs6(Col3, { xs: 12, children: [
463
+ " ",
464
+ element.content
465
+ ] }) }, index)),
466
+ canExpand(schema, uiSchema, formData) ? /* @__PURE__ */ jsx11(Row3, { children: /* @__PURE__ */ jsx11(Col3, { xs: { offset: 9, span: 3 }, className: "py-4", children: /* @__PURE__ */ jsx11(
467
+ AddButton2,
468
+ {
469
+ onClick: onAddClick(schema),
470
+ disabled: disabled || readonly,
471
+ className: "object-property-expand",
472
+ uiSchema,
473
+ registry
474
+ }
475
+ ) }) }) : null
476
+ ] })
477
+ ] });
478
+ }
479
+
480
+ // src/SubmitButton/SubmitButton.tsx
481
+ import Button3 from "react-bootstrap/Button";
482
+ import { getSubmitButtonOptions } from "@rjsf/utils";
483
+ import { jsx as jsx12 } from "react/jsx-runtime";
484
+ function SubmitButton(props) {
485
+ const { submitText, norender, props: submitButtonProps } = getSubmitButtonOptions(props.uiSchema);
486
+ if (norender) {
487
+ return null;
488
+ }
489
+ return /* @__PURE__ */ jsx12("div", { children: /* @__PURE__ */ jsx12(Button3, { variant: "primary", type: "submit", ...submitButtonProps, children: submitText }) });
490
+ }
491
+
492
+ // src/TitleField/TitleField.tsx
493
+ import { getUiOptions as getUiOptions4 } from "@rjsf/utils";
494
+ import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
495
+ function TitleField({
496
+ id,
497
+ title,
498
+ uiSchema
499
+ }) {
500
+ const uiOptions = getUiOptions4(uiSchema);
501
+ return /* @__PURE__ */ jsxs7("div", { id, className: "my-1", children: [
502
+ /* @__PURE__ */ jsx13("h5", { children: uiOptions.title || title }),
503
+ /* @__PURE__ */ jsx13("hr", { className: "border-0 bg-secondary", style: { height: "1px" } })
504
+ ] });
505
+ }
506
+
507
+ // src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx
508
+ import {
509
+ ADDITIONAL_PROPERTY_FLAG,
510
+ TranslatableString as TranslatableString4
511
+ } from "@rjsf/utils";
512
+ import Row4 from "react-bootstrap/Row";
513
+ import Col4 from "react-bootstrap/Col";
514
+ import Form4 from "react-bootstrap/Form";
515
+ import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
516
+ function WrapIfAdditionalTemplate({
517
+ classNames,
518
+ style,
519
+ children,
520
+ disabled,
521
+ id,
522
+ label,
523
+ onDropPropertyClick,
524
+ onKeyChange,
525
+ readonly,
526
+ required,
527
+ schema,
528
+ uiSchema,
529
+ registry
530
+ }) {
531
+ const { templates, translateString } = registry;
532
+ const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
533
+ const keyLabel = translateString(TranslatableString4.KeyLabel, [label]);
534
+ const additional = ADDITIONAL_PROPERTY_FLAG in schema;
535
+ if (!additional) {
536
+ return /* @__PURE__ */ jsx14("div", { className: classNames, style, children });
537
+ }
538
+ const handleBlur = ({ target }) => onKeyChange(target.value);
539
+ const keyId = `${id}-key`;
540
+ return /* @__PURE__ */ jsxs8(Row4, { className: classNames, style, children: [
541
+ /* @__PURE__ */ jsx14(Col4, { xs: 5, children: /* @__PURE__ */ jsxs8(Form4.Group, { children: [
542
+ /* @__PURE__ */ jsx14(Form4.Label, { htmlFor: keyId, children: keyLabel }),
543
+ /* @__PURE__ */ jsx14(
544
+ Form4.Control,
545
+ {
546
+ required,
547
+ defaultValue: label,
548
+ disabled: disabled || readonly,
549
+ id: keyId,
550
+ name: keyId,
551
+ onBlur: !readonly ? handleBlur : void 0,
552
+ type: "text"
553
+ }
554
+ )
555
+ ] }) }),
556
+ /* @__PURE__ */ jsx14(Col4, { xs: 5, children }),
557
+ /* @__PURE__ */ jsx14(Col4, { xs: 2, className: "py-4 d-grid gap-2", children: /* @__PURE__ */ jsx14(
558
+ RemoveButton2,
559
+ {
560
+ className: "w-100",
561
+ disabled: disabled || readonly,
562
+ onClick: onDropPropertyClick(label),
563
+ uiSchema,
564
+ registry
565
+ }
566
+ ) })
567
+ ] }, keyId);
568
+ }
569
+
570
+ // src/Templates/Templates.ts
571
+ function generateTemplates() {
572
+ return {
573
+ ArrayFieldItemTemplate,
574
+ ArrayFieldTemplate,
575
+ BaseInputTemplate,
576
+ ButtonTemplates: {
577
+ AddButton,
578
+ CopyButton,
579
+ MoveDownButton,
580
+ MoveUpButton,
581
+ RemoveButton,
582
+ SubmitButton
583
+ },
584
+ DescriptionFieldTemplate: DescriptionField,
585
+ ErrorListTemplate: ErrorList,
586
+ FieldErrorTemplate,
587
+ FieldHelpTemplate,
588
+ FieldTemplate,
589
+ ObjectFieldTemplate,
590
+ TitleFieldTemplate: TitleField,
591
+ WrapIfAdditionalTemplate
592
+ };
593
+ }
594
+ var Templates_default = generateTemplates();
595
+
596
+ // src/CheckboxWidget/CheckboxWidget.tsx
597
+ import {
598
+ ariaDescribedByIds as ariaDescribedByIds2,
599
+ descriptionId as descriptionId2,
600
+ getTemplate as getTemplate4,
601
+ labelValue,
602
+ schemaRequiresTrueValue
603
+ } from "@rjsf/utils";
604
+ import Form5 from "react-bootstrap/Form";
605
+ import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
606
+ function CheckboxWidget(props) {
607
+ const {
608
+ id,
609
+ value,
610
+ disabled,
611
+ readonly,
612
+ label,
613
+ hideLabel,
614
+ schema,
615
+ autofocus,
616
+ options,
617
+ onChange,
618
+ onBlur,
619
+ onFocus,
620
+ registry,
621
+ uiSchema
622
+ } = props;
623
+ const required = schemaRequiresTrueValue(schema);
624
+ const DescriptionFieldTemplate = getTemplate4(
625
+ "DescriptionFieldTemplate",
626
+ registry,
627
+ options
628
+ );
629
+ const _onChange = ({ target: { checked } }) => onChange(checked);
630
+ const _onBlur = ({ target }) => onBlur(id, target && target.checked);
631
+ const _onFocus = ({ target }) => onFocus(id, target && target.checked);
632
+ const description = options.description || schema.description;
633
+ return /* @__PURE__ */ jsxs9(
634
+ Form5.Group,
635
+ {
636
+ className: `checkbox ${disabled || readonly ? "disabled" : ""}`,
637
+ "aria-describedby": ariaDescribedByIds2(id),
638
+ children: [
639
+ !hideLabel && !!description && /* @__PURE__ */ jsx15(
640
+ DescriptionFieldTemplate,
641
+ {
642
+ id: descriptionId2(id),
643
+ description,
644
+ schema,
645
+ uiSchema,
646
+ registry
647
+ }
648
+ ),
649
+ /* @__PURE__ */ jsx15(
650
+ Form5.Check,
651
+ {
652
+ id,
653
+ name: id,
654
+ label: labelValue(label, hideLabel || !label),
655
+ checked: typeof value === "undefined" ? false : value,
656
+ required,
657
+ disabled: disabled || readonly,
658
+ autoFocus: autofocus,
659
+ onChange: _onChange,
660
+ type: "checkbox",
661
+ onBlur: _onBlur,
662
+ onFocus: _onFocus
663
+ }
664
+ )
665
+ ]
666
+ }
667
+ );
668
+ }
669
+
670
+ // src/CheckboxesWidget/CheckboxesWidget.tsx
671
+ import Form6 from "react-bootstrap/Form";
672
+ import {
673
+ ariaDescribedByIds as ariaDescribedByIds3,
674
+ enumOptionsDeselectValue,
675
+ enumOptionsIsSelected,
676
+ enumOptionsSelectValue,
677
+ enumOptionsValueForIndex,
678
+ optionId
679
+ } from "@rjsf/utils";
680
+ import { jsx as jsx16 } from "react/jsx-runtime";
681
+ function CheckboxesWidget({ id, disabled, options, value, autofocus, readonly, required, onChange, onBlur, onFocus }) {
682
+ const { enumOptions, enumDisabled, inline, emptyValue } = options;
683
+ const checkboxesValues = Array.isArray(value) ? value : [value];
684
+ const _onChange = (index) => ({ target: { checked } }) => {
685
+ if (checked) {
686
+ onChange(enumOptionsSelectValue(index, checkboxesValues, enumOptions));
687
+ } else {
688
+ onChange(enumOptionsDeselectValue(index, checkboxesValues, enumOptions));
689
+ }
690
+ };
691
+ const _onBlur = ({ target }) => onBlur(id, enumOptionsValueForIndex(target && target.value, enumOptions, emptyValue));
692
+ const _onFocus = ({ target }) => onFocus(id, enumOptionsValueForIndex(target && target.value, enumOptions, emptyValue));
693
+ return /* @__PURE__ */ jsx16(Form6.Group, { children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
694
+ const checked = enumOptionsIsSelected(option.value, checkboxesValues);
695
+ const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
696
+ return /* @__PURE__ */ jsx16(
697
+ Form6.Check,
698
+ {
699
+ inline,
700
+ required,
701
+ checked,
702
+ className: "bg-transparent border-0",
703
+ type: "checkbox",
704
+ id: optionId(id, index),
705
+ name: id,
706
+ label: option.label,
707
+ autoFocus: autofocus && index === 0,
708
+ onChange: _onChange(index),
709
+ onBlur: _onBlur,
710
+ onFocus: _onFocus,
711
+ disabled: disabled || itemDisabled || readonly,
712
+ "aria-describedby": ariaDescribedByIds3(id)
713
+ },
714
+ option.value
715
+ );
716
+ }) });
717
+ }
718
+
719
+ // src/RadioWidget/RadioWidget.tsx
720
+ import Form7 from "react-bootstrap/Form";
721
+ import {
722
+ ariaDescribedByIds as ariaDescribedByIds4,
723
+ enumOptionsIsSelected as enumOptionsIsSelected2,
724
+ enumOptionsValueForIndex as enumOptionsValueForIndex2,
725
+ optionId as optionId2
726
+ } from "@rjsf/utils";
727
+ import { jsx as jsx17 } from "react/jsx-runtime";
728
+ function RadioWidget({
729
+ id,
730
+ options,
731
+ value,
732
+ required,
733
+ disabled,
734
+ readonly,
735
+ onChange,
736
+ onBlur,
737
+ onFocus
738
+ }) {
739
+ const { enumOptions, enumDisabled, emptyValue } = options;
740
+ const _onChange = ({ target: { value: value2 } }) => onChange(enumOptionsValueForIndex2(value2, enumOptions, emptyValue));
741
+ const _onBlur = ({ target }) => onBlur(id, enumOptionsValueForIndex2(target && target.value, enumOptions, emptyValue));
742
+ const _onFocus = ({ target }) => onFocus(id, enumOptionsValueForIndex2(target && target.value, enumOptions, emptyValue));
743
+ const inline = Boolean(options && options.inline);
744
+ return /* @__PURE__ */ jsx17(Form7.Group, { className: "mb-0", children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
745
+ const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
746
+ const checked = enumOptionsIsSelected2(option.value, value);
747
+ const radio = /* @__PURE__ */ jsx17(
748
+ Form7.Check,
749
+ {
750
+ inline,
751
+ label: option.label,
752
+ id: optionId2(id, index),
753
+ name: id,
754
+ type: "radio",
755
+ disabled: disabled || itemDisabled || readonly,
756
+ checked,
757
+ required,
758
+ value: String(index),
759
+ onChange: _onChange,
760
+ onBlur: _onBlur,
761
+ onFocus: _onFocus,
762
+ "aria-describedby": ariaDescribedByIds4(id)
763
+ },
764
+ index
765
+ );
766
+ return radio;
767
+ }) });
768
+ }
769
+
770
+ // src/RangeWidget/RangeWidget.tsx
771
+ import { rangeSpec } from "@rjsf/utils";
772
+ import FormRange from "react-bootstrap/FormRange";
773
+ import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
774
+ function RangeWidget(props) {
775
+ const { id, value, disabled, onChange, onBlur, onFocus, schema } = props;
776
+ const _onChange = ({ target: { value: value2 } }) => onChange(value2);
777
+ const _onBlur = ({ target: { value: value2 } }) => onBlur(id, value2);
778
+ const _onFocus = ({ target: { value: value2 } }) => onFocus(id, value2);
779
+ const rangeProps = {
780
+ value,
781
+ id,
782
+ name: id,
783
+ disabled,
784
+ onChange: _onChange,
785
+ onBlur: _onBlur,
786
+ onFocus: _onFocus,
787
+ ...rangeSpec(schema)
788
+ };
789
+ return /* @__PURE__ */ jsxs10(Fragment3, { children: [
790
+ /* @__PURE__ */ jsx18(FormRange, { ...rangeProps }),
791
+ /* @__PURE__ */ jsx18("span", { className: "range-view", children: value })
792
+ ] });
793
+ }
794
+
795
+ // src/SelectWidget/SelectWidget.tsx
796
+ import FormSelect from "react-bootstrap/FormSelect";
797
+ import {
798
+ ariaDescribedByIds as ariaDescribedByIds5,
799
+ enumOptionsIndexForValue,
800
+ enumOptionsValueForIndex as enumOptionsValueForIndex3
801
+ } from "@rjsf/utils";
802
+ import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
803
+ function SelectWidget({
804
+ schema,
805
+ id,
806
+ options,
807
+ required,
808
+ disabled,
809
+ readonly,
810
+ value,
811
+ multiple,
812
+ autofocus,
813
+ onChange,
814
+ onBlur,
815
+ onFocus,
816
+ placeholder,
817
+ rawErrors = []
818
+ }) {
819
+ const { enumOptions, enumDisabled, emptyValue: optEmptyValue } = options;
820
+ const emptyValue = multiple ? [] : "";
821
+ function getValue(event, multiple2) {
822
+ if (multiple2) {
823
+ return [].slice.call(event.target.options).filter((o) => o.selected).map((o) => o.value);
824
+ } else {
825
+ return event.target.value;
826
+ }
827
+ }
828
+ const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, multiple);
829
+ const showPlaceholderOption = !multiple && schema.default === void 0;
830
+ return /* @__PURE__ */ jsxs11(
831
+ FormSelect,
832
+ {
833
+ id,
834
+ name: id,
835
+ value: typeof selectedIndexes === "undefined" ? emptyValue : selectedIndexes,
836
+ required,
837
+ multiple,
838
+ disabled: disabled || readonly,
839
+ autoFocus: autofocus,
840
+ className: rawErrors.length > 0 ? "is-invalid" : "",
841
+ onBlur: onBlur && ((event) => {
842
+ const newValue = getValue(event, multiple);
843
+ onBlur(id, enumOptionsValueForIndex3(newValue, enumOptions, optEmptyValue));
844
+ }),
845
+ onFocus: onFocus && ((event) => {
846
+ const newValue = getValue(event, multiple);
847
+ onFocus(id, enumOptionsValueForIndex3(newValue, enumOptions, optEmptyValue));
848
+ }),
849
+ onChange: (event) => {
850
+ const newValue = getValue(event, multiple);
851
+ onChange(enumOptionsValueForIndex3(newValue, enumOptions, optEmptyValue));
852
+ },
853
+ "aria-describedby": ariaDescribedByIds5(id),
854
+ children: [
855
+ showPlaceholderOption && /* @__PURE__ */ jsx19("option", { value: "", children: placeholder }),
856
+ enumOptions.map(({ value: value2, label }, i) => {
857
+ const disabled2 = Array.isArray(enumDisabled) && enumDisabled.indexOf(value2) != -1;
858
+ return /* @__PURE__ */ jsx19("option", { id: label, value: String(i), disabled: disabled2, children: label }, i);
859
+ })
860
+ ]
861
+ }
862
+ );
863
+ }
864
+
865
+ // src/TextareaWidget/TextareaWidget.tsx
866
+ import { ariaDescribedByIds as ariaDescribedByIds6 } from "@rjsf/utils";
867
+ import FormControl from "react-bootstrap/FormControl";
868
+ import InputGroup from "react-bootstrap/InputGroup";
869
+ import { jsx as jsx20 } from "react/jsx-runtime";
870
+ function TextareaWidget({
871
+ id,
872
+ placeholder,
873
+ value,
874
+ required,
875
+ disabled,
876
+ autofocus,
877
+ readonly,
878
+ onBlur,
879
+ onFocus,
880
+ onChange,
881
+ options
882
+ }) {
883
+ const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
884
+ const _onBlur = ({ target }) => onBlur(id, target && target.value);
885
+ const _onFocus = ({ target }) => onFocus(id, target && target.value);
886
+ return /* @__PURE__ */ jsx20(InputGroup, { children: /* @__PURE__ */ jsx20(
887
+ FormControl,
888
+ {
889
+ id,
890
+ name: id,
891
+ as: "textarea",
892
+ placeholder,
893
+ disabled,
894
+ readOnly: readonly,
895
+ value,
896
+ required,
897
+ autoFocus: autofocus,
898
+ rows: options.rows || 5,
899
+ onChange: _onChange,
900
+ onBlur: _onBlur,
901
+ onFocus: _onFocus,
902
+ "aria-describedby": ariaDescribedByIds6(id)
903
+ }
904
+ ) });
905
+ }
906
+
907
+ // src/Widgets/Widgets.ts
908
+ function generateWidgets() {
909
+ return {
910
+ CheckboxWidget,
911
+ CheckboxesWidget,
912
+ RadioWidget,
913
+ RangeWidget,
914
+ SelectWidget,
915
+ TextareaWidget
916
+ };
917
+ }
918
+ var Widgets_default = generateWidgets();
919
+
920
+ // src/Theme/Theme.tsx
921
+ function generateTheme() {
922
+ return {
923
+ templates: generateTemplates(),
924
+ widgets: generateWidgets()
925
+ };
926
+ }
927
+ var Theme_default = generateTheme();
928
+
929
+ // src/Form/Form.tsx
930
+ function generateForm() {
931
+ return withTheme(generateTheme());
932
+ }
933
+ var Form_default = generateForm();
934
+
935
+ // src/index.ts
936
+ var src_default = Form_default;
937
+ export {
938
+ Form_default as Form,
939
+ Templates_default as Templates,
940
+ Theme_default as Theme,
941
+ Widgets_default as Widgets,
942
+ src_default as default,
943
+ generateForm,
944
+ generateTemplates,
945
+ generateTheme,
946
+ generateWidgets
947
+ };
948
+ //# sourceMappingURL=react-bootstrap.esm.js.map