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