@rjsf/react-bootstrap 6.0.0-alpha.0 → 6.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.js +168 -203
- package/dist/index.js.map +4 -4
- package/dist/react-bootstrap.esm.js +92 -121
- package/dist/react-bootstrap.esm.js.map +4 -4
- package/dist/react-bootstrap.umd.js +23 -64
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +2 -2
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +5 -3
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +2 -2
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
- package/lib/DescriptionField/DescriptionField.js.map +1 -1
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -1
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -1
- package/lib/FieldTemplate/FieldTemplate.js.map +1 -1
- package/lib/GridTemplate/GridTemplate.d.ts +7 -0
- package/lib/GridTemplate/GridTemplate.js +16 -0
- package/lib/GridTemplate/GridTemplate.js.map +1 -0
- package/lib/GridTemplate/index.d.ts +2 -0
- package/lib/GridTemplate/index.js +3 -0
- package/lib/GridTemplate/index.js.map +1 -0
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +2 -2
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
- package/lib/SelectWidget/SelectWidget.js.map +1 -1
- package/lib/SubmitButton/SubmitButton.js.map +1 -1
- package/lib/Templates/Templates.js +2 -0
- package/lib/Templates/Templates.js.map +1 -1
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +2 -2
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +41 -34
- package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +17 -64
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +9 -7
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +1 -1
- package/src/CheckboxWidget/CheckboxWidget.tsx +2 -2
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +1 -1
- package/src/DescriptionField/DescriptionField.tsx +1 -1
- package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +1 -1
- package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +1 -1
- package/src/FieldTemplate/FieldTemplate.tsx +2 -2
- package/src/Form/Form.tsx +1 -1
- package/src/GridTemplate/GridTemplate.tsx +16 -0
- package/src/GridTemplate/index.ts +2 -0
- package/src/IconButton/IconButton.tsx +5 -5
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +5 -3
- package/src/RangeWidget/RangeWidget.tsx +1 -1
- package/src/SelectWidget/SelectWidget.tsx +1 -1
- package/src/SubmitButton/SubmitButton.tsx +1 -1
- package/src/Templates/Templates.ts +3 -1
- package/src/TextareaWidget/TextareaWidget.tsx +1 -1
- package/src/Theme/Theme.tsx +1 -1
- package/src/Widgets/Widgets.ts +1 -1
- package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +4 -2
- package/LICENSE.md +0 -201
package/dist/index.js
CHANGED
|
@@ -28,26 +28,26 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
30
|
// src/index.ts
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
33
|
Form: () => Form_default,
|
|
34
34
|
Templates: () => Templates_default,
|
|
35
35
|
Theme: () => Theme_default,
|
|
36
36
|
Widgets: () => Widgets_default,
|
|
37
|
-
default: () =>
|
|
37
|
+
default: () => index_default,
|
|
38
38
|
generateForm: () => generateForm,
|
|
39
39
|
generateTemplates: () => generateTemplates,
|
|
40
40
|
generateTheme: () => generateTheme,
|
|
41
41
|
generateWidgets: () => generateWidgets
|
|
42
42
|
});
|
|
43
|
-
module.exports = __toCommonJS(
|
|
43
|
+
module.exports = __toCommonJS(index_exports);
|
|
44
44
|
|
|
45
45
|
// src/Form/Form.tsx
|
|
46
46
|
var import_core = require("@rjsf/core");
|
|
47
47
|
|
|
48
48
|
// src/AddButton/AddButton.tsx
|
|
49
49
|
var import_utils = require("@rjsf/utils");
|
|
50
|
-
var import_Button = __toESM(require("react-bootstrap/Button"));
|
|
50
|
+
var import_Button = __toESM(require("react-bootstrap/Button"), 1);
|
|
51
51
|
var import_BsPlus = require("@react-icons/all-files/bs/BsPlus");
|
|
52
52
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
53
53
|
function AddButton({
|
|
@@ -69,27 +69,18 @@ function AddButton({
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
// src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx
|
|
72
|
-
var import_Row = __toESM(require("react-bootstrap/Row"));
|
|
73
|
-
var import_Col = __toESM(require("react-bootstrap/Col"));
|
|
72
|
+
var import_Row = __toESM(require("react-bootstrap/Row"), 1);
|
|
73
|
+
var import_Col = __toESM(require("react-bootstrap/Col"), 1);
|
|
74
|
+
var import_utils2 = require("@rjsf/utils");
|
|
74
75
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
75
76
|
function ArrayFieldItemTemplate(props) {
|
|
76
|
-
const {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
hasCopy,
|
|
81
|
-
hasMoveDown,
|
|
82
|
-
hasMoveUp,
|
|
83
|
-
hasRemove,
|
|
84
|
-
index,
|
|
85
|
-
onCopyIndexClick,
|
|
86
|
-
onDropIndexClick,
|
|
87
|
-
onReorderClick,
|
|
88
|
-
readonly,
|
|
77
|
+
const { children, buttonsProps, hasToolbar, uiSchema, registry } = props;
|
|
78
|
+
const uiOptions = (0, import_utils2.getUiOptions)(uiSchema);
|
|
79
|
+
const ArrayFieldItemButtonsTemplate = (0, import_utils2.getTemplate)(
|
|
80
|
+
"ArrayFieldItemButtonsTemplate",
|
|
89
81
|
registry,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const { CopyButton: CopyButton2, MoveDownButton: MoveDownButton2, MoveUpButton: MoveUpButton2, RemoveButton: RemoveButton2 } = registry.templates.ButtonTemplates;
|
|
82
|
+
uiOptions
|
|
83
|
+
);
|
|
93
84
|
const btnStyle = {
|
|
94
85
|
flex: 1,
|
|
95
86
|
paddingLeft: 6,
|
|
@@ -98,72 +89,30 @@ function ArrayFieldItemTemplate(props) {
|
|
|
98
89
|
};
|
|
99
90
|
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
91
|
/* @__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.
|
|
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
|
-
] }) })
|
|
92
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_Col.default, { xs: "3", lg: "3", className: "py-4", children: hasToolbar && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "d-flex flex-row", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ArrayFieldItemButtonsTemplate, { ...buttonsProps, style: btnStyle }) }) })
|
|
144
93
|
] }) });
|
|
145
94
|
}
|
|
146
95
|
|
|
147
96
|
// 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
|
|
97
|
+
var import_Row2 = __toESM(require("react-bootstrap/Row"), 1);
|
|
98
|
+
var import_Col2 = __toESM(require("react-bootstrap/Col"), 1);
|
|
99
|
+
var import_Container = __toESM(require("react-bootstrap/Container"), 1);
|
|
100
|
+
var import_utils3 = require("@rjsf/utils");
|
|
152
101
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
153
102
|
function ArrayFieldTemplate(props) {
|
|
154
103
|
const { canAdd, disabled, idSchema, uiSchema, items, onAddClick, readonly, registry, required, schema, title } = props;
|
|
155
|
-
const uiOptions = (0,
|
|
156
|
-
const ArrayFieldDescriptionTemplate = (0,
|
|
104
|
+
const uiOptions = (0, import_utils3.getUiOptions)(uiSchema);
|
|
105
|
+
const ArrayFieldDescriptionTemplate = (0, import_utils3.getTemplate)(
|
|
157
106
|
"ArrayFieldDescriptionTemplate",
|
|
158
107
|
registry,
|
|
159
108
|
uiOptions
|
|
160
109
|
);
|
|
161
|
-
const ArrayFieldItemTemplate2 = (0,
|
|
110
|
+
const ArrayFieldItemTemplate2 = (0, import_utils3.getTemplate)(
|
|
162
111
|
"ArrayFieldItemTemplate",
|
|
163
112
|
registry,
|
|
164
113
|
uiOptions
|
|
165
114
|
);
|
|
166
|
-
const ArrayFieldTitleTemplate = (0,
|
|
115
|
+
const ArrayFieldTitleTemplate = (0, import_utils3.getTemplate)(
|
|
167
116
|
"ArrayFieldTitleTemplate",
|
|
168
117
|
registry,
|
|
169
118
|
uiOptions
|
|
@@ -200,7 +149,8 @@ function ArrayFieldTemplate(props) {
|
|
|
200
149
|
/* @__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
150
|
AddButton2,
|
|
202
151
|
{
|
|
203
|
-
|
|
152
|
+
id: (0, import_utils3.buttonId)(idSchema, "add"),
|
|
153
|
+
className: "rjsf-array-item-add",
|
|
204
154
|
onClick: onAddClick,
|
|
205
155
|
disabled: disabled || readonly,
|
|
206
156
|
uiSchema,
|
|
@@ -213,8 +163,8 @@ function ArrayFieldTemplate(props) {
|
|
|
213
163
|
}
|
|
214
164
|
|
|
215
165
|
// src/BaseInputTemplate/BaseInputTemplate.tsx
|
|
216
|
-
var import_Form = __toESM(require("react-bootstrap/Form"));
|
|
217
|
-
var
|
|
166
|
+
var import_Form = __toESM(require("react-bootstrap/Form"), 1);
|
|
167
|
+
var import_utils4 = require("@rjsf/utils");
|
|
218
168
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
219
169
|
function BaseInputTemplate({
|
|
220
170
|
id,
|
|
@@ -237,7 +187,7 @@ function BaseInputTemplate({
|
|
|
237
187
|
}) {
|
|
238
188
|
const inputProps = {
|
|
239
189
|
...extraProps,
|
|
240
|
-
...(0,
|
|
190
|
+
...(0, import_utils4.getInputProps)(schema, type, options)
|
|
241
191
|
};
|
|
242
192
|
const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
|
|
243
193
|
const _onBlur = ({ target }) => onBlur(id, target && target.value);
|
|
@@ -254,17 +204,17 @@ function BaseInputTemplate({
|
|
|
254
204
|
disabled,
|
|
255
205
|
readOnly: readonly,
|
|
256
206
|
className: rawErrors.length > 0 ? "is-invalid" : "",
|
|
257
|
-
list: schema.examples ? (0,
|
|
207
|
+
list: schema.examples ? (0, import_utils4.examplesId)(id) : void 0,
|
|
258
208
|
...inputProps,
|
|
259
209
|
value: value || value === 0 ? value : "",
|
|
260
210
|
onChange: onChangeOverride || _onChange,
|
|
261
211
|
onBlur: _onBlur,
|
|
262
212
|
onFocus: _onFocus,
|
|
263
|
-
"aria-describedby": (0,
|
|
213
|
+
"aria-describedby": (0, import_utils4.ariaDescribedByIds)(id, !!schema.examples)
|
|
264
214
|
}
|
|
265
215
|
),
|
|
266
216
|
children,
|
|
267
|
-
Array.isArray(schema.examples) ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("datalist", { id: (0,
|
|
217
|
+
Array.isArray(schema.examples) ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("datalist", { id: (0, import_utils4.examplesId)(id), children: schema.examples.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : []).map((example) => {
|
|
268
218
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: example }, example);
|
|
269
219
|
}) }) : null
|
|
270
220
|
] });
|
|
@@ -280,9 +230,9 @@ function DescriptionField({ id, description }) {
|
|
|
280
230
|
}
|
|
281
231
|
|
|
282
232
|
// src/ErrorList/ErrorList.tsx
|
|
283
|
-
var import_Card = __toESM(require("react-bootstrap/Card"));
|
|
284
|
-
var import_ListGroup = __toESM(require("react-bootstrap/ListGroup"));
|
|
285
|
-
var
|
|
233
|
+
var import_Card = __toESM(require("react-bootstrap/Card"), 1);
|
|
234
|
+
var import_ListGroup = __toESM(require("react-bootstrap/ListGroup"), 1);
|
|
235
|
+
var import_utils5 = require("@rjsf/utils");
|
|
286
236
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
287
237
|
function ErrorList({
|
|
288
238
|
errors,
|
|
@@ -290,7 +240,7 @@ function ErrorList({
|
|
|
290
240
|
}) {
|
|
291
241
|
const { translateString } = registry;
|
|
292
242
|
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(
|
|
243
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Card.default.Header, { className: "alert-danger", children: translateString(import_utils5.TranslatableString.ErrorsLabel) }),
|
|
294
244
|
/* @__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
245
|
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
246
|
}) }) })
|
|
@@ -298,8 +248,8 @@ function ErrorList({
|
|
|
298
248
|
}
|
|
299
249
|
|
|
300
250
|
// src/IconButton/IconButton.tsx
|
|
301
|
-
var
|
|
302
|
-
var import_Button2 = __toESM(require("react-bootstrap/Button"));
|
|
251
|
+
var import_utils6 = require("@rjsf/utils");
|
|
252
|
+
var import_Button2 = __toESM(require("react-bootstrap/Button"), 1);
|
|
303
253
|
var import_IoIosCopy = require("@react-icons/all-files/io/IoIosCopy");
|
|
304
254
|
var import_IoIosRemove = require("@react-icons/all-files/io/IoIosRemove");
|
|
305
255
|
var import_AiOutlineArrowUp = require("@react-icons/all-files/ai/AiOutlineArrowUp");
|
|
@@ -313,19 +263,19 @@ function CopyButton(props) {
|
|
|
313
263
|
const {
|
|
314
264
|
registry: { translateString }
|
|
315
265
|
} = props;
|
|
316
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconButton, { title: translateString(
|
|
266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconButton, { title: translateString(import_utils6.TranslatableString.CopyButton), ...props, icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_IoIosCopy.IoIosCopy, {}) });
|
|
317
267
|
}
|
|
318
268
|
function MoveDownButton(props) {
|
|
319
269
|
const {
|
|
320
270
|
registry: { translateString }
|
|
321
271
|
} = props;
|
|
322
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconButton, { title: translateString(
|
|
272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconButton, { title: translateString(import_utils6.TranslatableString.MoveDownButton), ...props, icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_AiOutlineArrowDown.AiOutlineArrowDown, {}) });
|
|
323
273
|
}
|
|
324
274
|
function MoveUpButton(props) {
|
|
325
275
|
const {
|
|
326
276
|
registry: { translateString }
|
|
327
277
|
} = props;
|
|
328
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconButton, { title: translateString(
|
|
278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconButton, { title: translateString(import_utils6.TranslatableString.MoveUpButton), ...props, icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_AiOutlineArrowUp.AiOutlineArrowUp, {}) });
|
|
329
279
|
}
|
|
330
280
|
function RemoveButton(props) {
|
|
331
281
|
const {
|
|
@@ -334,7 +284,7 @@ function RemoveButton(props) {
|
|
|
334
284
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
335
285
|
IconButton,
|
|
336
286
|
{
|
|
337
|
-
title: translateString(
|
|
287
|
+
title: translateString(import_utils6.TranslatableString.RemoveButton),
|
|
338
288
|
...props,
|
|
339
289
|
variant: "danger",
|
|
340
290
|
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_IoIosRemove.IoIosRemove, {})
|
|
@@ -343,36 +293,36 @@ function RemoveButton(props) {
|
|
|
343
293
|
}
|
|
344
294
|
|
|
345
295
|
// src/FieldErrorTemplate/FieldErrorTemplate.tsx
|
|
346
|
-
var
|
|
347
|
-
var import_ListGroup2 = __toESM(require("react-bootstrap/ListGroup"));
|
|
296
|
+
var import_utils7 = require("@rjsf/utils");
|
|
297
|
+
var import_ListGroup2 = __toESM(require("react-bootstrap/ListGroup"), 1);
|
|
348
298
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
349
299
|
function FieldErrorTemplate(props) {
|
|
350
300
|
const { errors = [], idSchema } = props;
|
|
351
301
|
if (errors.length === 0) {
|
|
352
302
|
return null;
|
|
353
303
|
}
|
|
354
|
-
const id = (0,
|
|
304
|
+
const id = (0, import_utils7.errorId)(idSchema);
|
|
355
305
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_ListGroup2.default, { as: "ul", id, children: errors.map((error, i) => {
|
|
356
306
|
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
307
|
}) });
|
|
358
308
|
}
|
|
359
309
|
|
|
360
310
|
// src/FieldHelpTemplate/FieldHelpTemplate.tsx
|
|
361
|
-
var
|
|
362
|
-
var import_Form2 = __toESM(require("react-bootstrap/Form"));
|
|
311
|
+
var import_utils8 = require("@rjsf/utils");
|
|
312
|
+
var import_Form2 = __toESM(require("react-bootstrap/Form"), 1);
|
|
363
313
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
364
314
|
function FieldHelpTemplate(props) {
|
|
365
315
|
const { idSchema, help, hasErrors } = props;
|
|
366
316
|
if (!help) {
|
|
367
317
|
return null;
|
|
368
318
|
}
|
|
369
|
-
const id = (0,
|
|
319
|
+
const id = (0, import_utils8.helpId)(idSchema);
|
|
370
320
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_Form2.default.Text, { className: hasErrors ? "text-danger" : "text-muted", id, children: help });
|
|
371
321
|
}
|
|
372
322
|
|
|
373
323
|
// src/FieldTemplate/FieldTemplate.tsx
|
|
374
|
-
var
|
|
375
|
-
var import_Form3 = __toESM(require("react-bootstrap/Form"));
|
|
324
|
+
var import_utils9 = require("@rjsf/utils");
|
|
325
|
+
var import_Form3 = __toESM(require("react-bootstrap/Form"), 1);
|
|
376
326
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
377
327
|
function FieldTemplate({
|
|
378
328
|
id,
|
|
@@ -396,8 +346,8 @@ function FieldTemplate({
|
|
|
396
346
|
uiSchema,
|
|
397
347
|
registry
|
|
398
348
|
}) {
|
|
399
|
-
const uiOptions = (0,
|
|
400
|
-
const WrapIfAdditionalTemplate2 = (0,
|
|
349
|
+
const uiOptions = (0, import_utils9.getUiOptions)(uiSchema);
|
|
350
|
+
const WrapIfAdditionalTemplate2 = (0, import_utils9.getTemplate)(
|
|
401
351
|
"WrapIfAdditionalTemplate",
|
|
402
352
|
registry,
|
|
403
353
|
uiOptions
|
|
@@ -434,12 +384,24 @@ function FieldTemplate({
|
|
|
434
384
|
);
|
|
435
385
|
}
|
|
436
386
|
|
|
437
|
-
// src/
|
|
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");
|
|
387
|
+
// src/GridTemplate/GridTemplate.tsx
|
|
388
|
+
var import_Row3 = __toESM(require("react-bootstrap/Row"), 1);
|
|
389
|
+
var import_Col3 = __toESM(require("react-bootstrap/Col"), 1);
|
|
442
390
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
391
|
+
function GridTemplate(props) {
|
|
392
|
+
const { children, column, ...rest } = props;
|
|
393
|
+
if (column) {
|
|
394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_Col3.default, { ...rest, children });
|
|
395
|
+
}
|
|
396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_Row3.default, { ...rest, children });
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
// src/ObjectFieldTemplate/ObjectFieldTemplate.tsx
|
|
400
|
+
var import_Row4 = __toESM(require("react-bootstrap/Row"), 1);
|
|
401
|
+
var import_Col4 = __toESM(require("react-bootstrap/Col"), 1);
|
|
402
|
+
var import_Container2 = __toESM(require("react-bootstrap/Container"), 1);
|
|
403
|
+
var import_utils10 = require("@rjsf/utils");
|
|
404
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
443
405
|
function ObjectFieldTemplate({
|
|
444
406
|
description,
|
|
445
407
|
title,
|
|
@@ -454,9 +416,9 @@ function ObjectFieldTemplate({
|
|
|
454
416
|
readonly,
|
|
455
417
|
registry
|
|
456
418
|
}) {
|
|
457
|
-
const uiOptions = (0,
|
|
458
|
-
const TitleFieldTemplate = (0,
|
|
459
|
-
const DescriptionFieldTemplate = (0,
|
|
419
|
+
const uiOptions = (0, import_utils10.getUiOptions)(uiSchema);
|
|
420
|
+
const TitleFieldTemplate = (0, import_utils10.getTemplate)("TitleFieldTemplate", registry, uiOptions);
|
|
421
|
+
const DescriptionFieldTemplate = (0, import_utils10.getTemplate)(
|
|
460
422
|
"DescriptionFieldTemplate",
|
|
461
423
|
registry,
|
|
462
424
|
uiOptions
|
|
@@ -464,11 +426,11 @@ function ObjectFieldTemplate({
|
|
|
464
426
|
const {
|
|
465
427
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
466
428
|
} = registry.templates;
|
|
467
|
-
return /* @__PURE__ */ (0,
|
|
468
|
-
title && /* @__PURE__ */ (0,
|
|
429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
430
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
469
431
|
TitleFieldTemplate,
|
|
470
432
|
{
|
|
471
|
-
id: (0,
|
|
433
|
+
id: (0, import_utils10.titleId)(idSchema),
|
|
472
434
|
title,
|
|
473
435
|
required,
|
|
474
436
|
schema,
|
|
@@ -476,27 +438,28 @@ function ObjectFieldTemplate({
|
|
|
476
438
|
registry
|
|
477
439
|
}
|
|
478
440
|
),
|
|
479
|
-
description && /* @__PURE__ */ (0,
|
|
441
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
480
442
|
DescriptionFieldTemplate,
|
|
481
443
|
{
|
|
482
|
-
id: (0,
|
|
444
|
+
id: (0, import_utils10.descriptionId)(idSchema),
|
|
483
445
|
description,
|
|
484
446
|
schema,
|
|
485
447
|
uiSchema,
|
|
486
448
|
registry
|
|
487
449
|
}
|
|
488
450
|
),
|
|
489
|
-
/* @__PURE__ */ (0,
|
|
490
|
-
properties.map((element, index) => /* @__PURE__ */ (0,
|
|
451
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_Container2.default, { fluid: true, className: "p-0", children: [
|
|
452
|
+
properties.map((element, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_Row4.default, { style: { marginBottom: "10px" }, className: element.hidden ? "d-none" : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_Col4.default, { xs: 12, children: [
|
|
491
453
|
" ",
|
|
492
454
|
element.content
|
|
493
455
|
] }) }, index)),
|
|
494
|
-
(0,
|
|
456
|
+
(0, import_utils10.canExpand)(schema, uiSchema, formData) ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_Row4.default, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_Col4.default, { xs: { offset: 9, span: 3 }, className: "py-4", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
495
457
|
AddButton2,
|
|
496
458
|
{
|
|
459
|
+
id: (0, import_utils10.buttonId)(idSchema, "add"),
|
|
497
460
|
onClick: onAddClick(schema),
|
|
498
461
|
disabled: disabled || readonly,
|
|
499
|
-
className: "object-property-expand",
|
|
462
|
+
className: "rjsf-object-property-expand",
|
|
500
463
|
uiSchema,
|
|
501
464
|
registry
|
|
502
465
|
}
|
|
@@ -506,38 +469,38 @@ function ObjectFieldTemplate({
|
|
|
506
469
|
}
|
|
507
470
|
|
|
508
471
|
// src/SubmitButton/SubmitButton.tsx
|
|
509
|
-
var import_Button3 = __toESM(require("react-bootstrap/Button"));
|
|
510
|
-
var
|
|
511
|
-
var
|
|
472
|
+
var import_Button3 = __toESM(require("react-bootstrap/Button"), 1);
|
|
473
|
+
var import_utils11 = require("@rjsf/utils");
|
|
474
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
512
475
|
function SubmitButton(props) {
|
|
513
|
-
const { submitText, norender, props: submitButtonProps } = (0,
|
|
476
|
+
const { submitText, norender, props: submitButtonProps } = (0, import_utils11.getSubmitButtonOptions)(props.uiSchema);
|
|
514
477
|
if (norender) {
|
|
515
478
|
return null;
|
|
516
479
|
}
|
|
517
|
-
return /* @__PURE__ */ (0,
|
|
480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_Button3.default, { variant: "primary", type: "submit", ...submitButtonProps, children: submitText }) });
|
|
518
481
|
}
|
|
519
482
|
|
|
520
483
|
// src/TitleField/TitleField.tsx
|
|
521
|
-
var
|
|
522
|
-
var
|
|
484
|
+
var import_utils12 = require("@rjsf/utils");
|
|
485
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
523
486
|
function TitleField({
|
|
524
487
|
id,
|
|
525
488
|
title,
|
|
526
489
|
uiSchema
|
|
527
490
|
}) {
|
|
528
|
-
const uiOptions = (0,
|
|
529
|
-
return /* @__PURE__ */ (0,
|
|
530
|
-
/* @__PURE__ */ (0,
|
|
531
|
-
/* @__PURE__ */ (0,
|
|
491
|
+
const uiOptions = (0, import_utils12.getUiOptions)(uiSchema);
|
|
492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { id, className: "my-1", children: [
|
|
493
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h5", { children: uiOptions.title || title }),
|
|
494
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("hr", { className: "border-0 bg-secondary", style: { height: "1px" } })
|
|
532
495
|
] });
|
|
533
496
|
}
|
|
534
497
|
|
|
535
498
|
// src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx
|
|
536
|
-
var
|
|
537
|
-
var
|
|
538
|
-
var
|
|
539
|
-
var import_Form4 = __toESM(require("react-bootstrap/Form"));
|
|
540
|
-
var
|
|
499
|
+
var import_utils13 = require("@rjsf/utils");
|
|
500
|
+
var import_Row5 = __toESM(require("react-bootstrap/Row"), 1);
|
|
501
|
+
var import_Col5 = __toESM(require("react-bootstrap/Col"), 1);
|
|
502
|
+
var import_Form4 = __toESM(require("react-bootstrap/Form"), 1);
|
|
503
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
541
504
|
function WrapIfAdditionalTemplate({
|
|
542
505
|
classNames,
|
|
543
506
|
style,
|
|
@@ -555,17 +518,17 @@ function WrapIfAdditionalTemplate({
|
|
|
555
518
|
}) {
|
|
556
519
|
const { templates, translateString } = registry;
|
|
557
520
|
const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
|
|
558
|
-
const keyLabel = translateString(
|
|
559
|
-
const additional =
|
|
521
|
+
const keyLabel = translateString(import_utils13.TranslatableString.KeyLabel, [label]);
|
|
522
|
+
const additional = import_utils13.ADDITIONAL_PROPERTY_FLAG in schema;
|
|
560
523
|
if (!additional) {
|
|
561
|
-
return /* @__PURE__ */ (0,
|
|
524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: classNames, style, children });
|
|
562
525
|
}
|
|
563
526
|
const handleBlur = ({ target }) => onKeyChange(target.value);
|
|
564
527
|
const keyId = `${id}-key`;
|
|
565
|
-
return /* @__PURE__ */ (0,
|
|
566
|
-
/* @__PURE__ */ (0,
|
|
567
|
-
/* @__PURE__ */ (0,
|
|
568
|
-
/* @__PURE__ */ (0,
|
|
528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_Row5.default, { className: classNames, style, children: [
|
|
529
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_Col5.default, { xs: 5, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_Form4.default.Group, { children: [
|
|
530
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_Form4.default.Label, { htmlFor: keyId, children: keyLabel }),
|
|
531
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
569
532
|
import_Form4.default.Control,
|
|
570
533
|
{
|
|
571
534
|
required,
|
|
@@ -578,11 +541,12 @@ function WrapIfAdditionalTemplate({
|
|
|
578
541
|
}
|
|
579
542
|
)
|
|
580
543
|
] }) }),
|
|
581
|
-
/* @__PURE__ */ (0,
|
|
582
|
-
/* @__PURE__ */ (0,
|
|
544
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_Col5.default, { xs: 5, children }),
|
|
545
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_Col5.default, { xs: 2, className: "py-4 d-grid gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
583
546
|
RemoveButton2,
|
|
584
547
|
{
|
|
585
|
-
|
|
548
|
+
id: (0, import_utils13.buttonId)(id, "remove"),
|
|
549
|
+
className: "rjsf-object-property-remove w-100",
|
|
586
550
|
disabled: disabled || readonly,
|
|
587
551
|
onClick: onDropPropertyClick(label),
|
|
588
552
|
uiSchema,
|
|
@@ -611,6 +575,7 @@ function generateTemplates() {
|
|
|
611
575
|
FieldErrorTemplate,
|
|
612
576
|
FieldHelpTemplate,
|
|
613
577
|
FieldTemplate,
|
|
578
|
+
GridTemplate,
|
|
614
579
|
ObjectFieldTemplate,
|
|
615
580
|
TitleFieldTemplate: TitleField,
|
|
616
581
|
WrapIfAdditionalTemplate
|
|
@@ -619,9 +584,9 @@ function generateTemplates() {
|
|
|
619
584
|
var Templates_default = generateTemplates();
|
|
620
585
|
|
|
621
586
|
// src/CheckboxWidget/CheckboxWidget.tsx
|
|
622
|
-
var
|
|
623
|
-
var import_Form5 = __toESM(require("react-bootstrap/Form"));
|
|
624
|
-
var
|
|
587
|
+
var import_utils14 = require("@rjsf/utils");
|
|
588
|
+
var import_Form5 = __toESM(require("react-bootstrap/Form"), 1);
|
|
589
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
625
590
|
function CheckboxWidget(props) {
|
|
626
591
|
const {
|
|
627
592
|
id,
|
|
@@ -639,8 +604,8 @@ function CheckboxWidget(props) {
|
|
|
639
604
|
registry,
|
|
640
605
|
uiSchema
|
|
641
606
|
} = props;
|
|
642
|
-
const required = (0,
|
|
643
|
-
const DescriptionFieldTemplate = (0,
|
|
607
|
+
const required = (0, import_utils14.schemaRequiresTrueValue)(schema);
|
|
608
|
+
const DescriptionFieldTemplate = (0, import_utils14.getTemplate)(
|
|
644
609
|
"DescriptionFieldTemplate",
|
|
645
610
|
registry,
|
|
646
611
|
options
|
|
@@ -649,28 +614,28 @@ function CheckboxWidget(props) {
|
|
|
649
614
|
const _onBlur = ({ target }) => onBlur(id, target && target.checked);
|
|
650
615
|
const _onFocus = ({ target }) => onFocus(id, target && target.checked);
|
|
651
616
|
const description = options.description || schema.description;
|
|
652
|
-
return /* @__PURE__ */ (0,
|
|
617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
653
618
|
import_Form5.default.Group,
|
|
654
619
|
{
|
|
655
620
|
className: `checkbox ${disabled || readonly ? "disabled" : ""}`,
|
|
656
|
-
"aria-describedby": (0,
|
|
621
|
+
"aria-describedby": (0, import_utils14.ariaDescribedByIds)(id),
|
|
657
622
|
children: [
|
|
658
|
-
!hideLabel && !!description && /* @__PURE__ */ (0,
|
|
623
|
+
!hideLabel && !!description && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
659
624
|
DescriptionFieldTemplate,
|
|
660
625
|
{
|
|
661
|
-
id: (0,
|
|
626
|
+
id: (0, import_utils14.descriptionId)(id),
|
|
662
627
|
description,
|
|
663
628
|
schema,
|
|
664
629
|
uiSchema,
|
|
665
630
|
registry
|
|
666
631
|
}
|
|
667
632
|
),
|
|
668
|
-
/* @__PURE__ */ (0,
|
|
633
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
669
634
|
import_Form5.default.Check,
|
|
670
635
|
{
|
|
671
636
|
id,
|
|
672
637
|
name: id,
|
|
673
|
-
label: (0,
|
|
638
|
+
label: (0, import_utils14.labelValue)(label, hideLabel || !label),
|
|
674
639
|
checked: typeof value === "undefined" ? false : value,
|
|
675
640
|
required,
|
|
676
641
|
disabled: disabled || readonly,
|
|
@@ -687,25 +652,25 @@ function CheckboxWidget(props) {
|
|
|
687
652
|
}
|
|
688
653
|
|
|
689
654
|
// src/CheckboxesWidget/CheckboxesWidget.tsx
|
|
690
|
-
var import_Form6 = __toESM(require("react-bootstrap/Form"));
|
|
691
|
-
var
|
|
692
|
-
var
|
|
655
|
+
var import_Form6 = __toESM(require("react-bootstrap/Form"), 1);
|
|
656
|
+
var import_utils15 = require("@rjsf/utils");
|
|
657
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
693
658
|
function CheckboxesWidget({ id, disabled, options, value, autofocus, readonly, required, onChange, onBlur, onFocus }) {
|
|
694
659
|
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
695
660
|
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
696
661
|
const _onChange = (index) => ({ target: { checked } }) => {
|
|
697
662
|
if (checked) {
|
|
698
|
-
onChange((0,
|
|
663
|
+
onChange((0, import_utils15.enumOptionsSelectValue)(index, checkboxesValues, enumOptions));
|
|
699
664
|
} else {
|
|
700
|
-
onChange((0,
|
|
665
|
+
onChange((0, import_utils15.enumOptionsDeselectValue)(index, checkboxesValues, enumOptions));
|
|
701
666
|
}
|
|
702
667
|
};
|
|
703
|
-
const _onBlur = ({ target }) => onBlur(id, (0,
|
|
704
|
-
const _onFocus = ({ target }) => onFocus(id, (0,
|
|
705
|
-
return /* @__PURE__ */ (0,
|
|
706
|
-
const checked = (0,
|
|
668
|
+
const _onBlur = ({ target }) => onBlur(id, (0, import_utils15.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
669
|
+
const _onFocus = ({ target }) => onFocus(id, (0, import_utils15.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
670
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_Form6.default.Group, { children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
671
|
+
const checked = (0, import_utils15.enumOptionsIsSelected)(option.value, checkboxesValues);
|
|
707
672
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
708
|
-
return /* @__PURE__ */ (0,
|
|
673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
709
674
|
import_Form6.default.Check,
|
|
710
675
|
{
|
|
711
676
|
inline,
|
|
@@ -713,7 +678,7 @@ function CheckboxesWidget({ id, disabled, options, value, autofocus, readonly, r
|
|
|
713
678
|
checked,
|
|
714
679
|
className: "bg-transparent border-0",
|
|
715
680
|
type: "checkbox",
|
|
716
|
-
id: (0,
|
|
681
|
+
id: (0, import_utils15.optionId)(id, index),
|
|
717
682
|
name: id,
|
|
718
683
|
label: option.label,
|
|
719
684
|
autoFocus: autofocus && index === 0,
|
|
@@ -721,7 +686,7 @@ function CheckboxesWidget({ id, disabled, options, value, autofocus, readonly, r
|
|
|
721
686
|
onBlur: _onBlur,
|
|
722
687
|
onFocus: _onFocus,
|
|
723
688
|
disabled: disabled || itemDisabled || readonly,
|
|
724
|
-
"aria-describedby": (0,
|
|
689
|
+
"aria-describedby": (0, import_utils15.ariaDescribedByIds)(id)
|
|
725
690
|
},
|
|
726
691
|
option.value
|
|
727
692
|
);
|
|
@@ -729,9 +694,9 @@ function CheckboxesWidget({ id, disabled, options, value, autofocus, readonly, r
|
|
|
729
694
|
}
|
|
730
695
|
|
|
731
696
|
// src/RadioWidget/RadioWidget.tsx
|
|
732
|
-
var import_Form7 = __toESM(require("react-bootstrap/Form"));
|
|
733
|
-
var
|
|
734
|
-
var
|
|
697
|
+
var import_Form7 = __toESM(require("react-bootstrap/Form"), 1);
|
|
698
|
+
var import_utils16 = require("@rjsf/utils");
|
|
699
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
735
700
|
function RadioWidget({
|
|
736
701
|
id,
|
|
737
702
|
options,
|
|
@@ -744,19 +709,19 @@ function RadioWidget({
|
|
|
744
709
|
onFocus
|
|
745
710
|
}) {
|
|
746
711
|
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
747
|
-
const _onChange = ({ target: { value: value2 } }) => onChange((0,
|
|
748
|
-
const _onBlur = ({ target }) => onBlur(id, (0,
|
|
749
|
-
const _onFocus = ({ target }) => onFocus(id, (0,
|
|
712
|
+
const _onChange = ({ target: { value: value2 } }) => onChange((0, import_utils16.enumOptionsValueForIndex)(value2, enumOptions, emptyValue));
|
|
713
|
+
const _onBlur = ({ target }) => onBlur(id, (0, import_utils16.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
714
|
+
const _onFocus = ({ target }) => onFocus(id, (0, import_utils16.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
750
715
|
const inline = Boolean(options && options.inline);
|
|
751
|
-
return /* @__PURE__ */ (0,
|
|
716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_Form7.default.Group, { className: "mb-0", children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
752
717
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
753
|
-
const checked = (0,
|
|
754
|
-
const radio = /* @__PURE__ */ (0,
|
|
718
|
+
const checked = (0, import_utils16.enumOptionsIsSelected)(option.value, value);
|
|
719
|
+
const radio = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
755
720
|
import_Form7.default.Check,
|
|
756
721
|
{
|
|
757
722
|
inline,
|
|
758
723
|
label: option.label,
|
|
759
|
-
id: (0,
|
|
724
|
+
id: (0, import_utils16.optionId)(id, index),
|
|
760
725
|
name: id,
|
|
761
726
|
type: "radio",
|
|
762
727
|
disabled: disabled || itemDisabled || readonly,
|
|
@@ -766,7 +731,7 @@ function RadioWidget({
|
|
|
766
731
|
onChange: _onChange,
|
|
767
732
|
onBlur: _onBlur,
|
|
768
733
|
onFocus: _onFocus,
|
|
769
|
-
"aria-describedby": (0,
|
|
734
|
+
"aria-describedby": (0, import_utils16.ariaDescribedByIds)(id)
|
|
770
735
|
},
|
|
771
736
|
index
|
|
772
737
|
);
|
|
@@ -775,9 +740,9 @@ function RadioWidget({
|
|
|
775
740
|
}
|
|
776
741
|
|
|
777
742
|
// src/RangeWidget/RangeWidget.tsx
|
|
778
|
-
var
|
|
779
|
-
var import_FormRange = __toESM(require("react-bootstrap/FormRange"));
|
|
780
|
-
var
|
|
743
|
+
var import_utils17 = require("@rjsf/utils");
|
|
744
|
+
var import_FormRange = __toESM(require("react-bootstrap/FormRange"), 1);
|
|
745
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
781
746
|
function RangeWidget(props) {
|
|
782
747
|
const { id, value, disabled, onChange, onBlur, onFocus, schema } = props;
|
|
783
748
|
const _onChange = ({ target: { value: value2 } }) => onChange(value2);
|
|
@@ -791,18 +756,18 @@ function RangeWidget(props) {
|
|
|
791
756
|
onChange: _onChange,
|
|
792
757
|
onBlur: _onBlur,
|
|
793
758
|
onFocus: _onFocus,
|
|
794
|
-
...(0,
|
|
759
|
+
...(0, import_utils17.rangeSpec)(schema)
|
|
795
760
|
};
|
|
796
|
-
return /* @__PURE__ */ (0,
|
|
797
|
-
/* @__PURE__ */ (0,
|
|
798
|
-
/* @__PURE__ */ (0,
|
|
761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
762
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_FormRange.default, { ...rangeProps }),
|
|
763
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "range-view", children: value })
|
|
799
764
|
] });
|
|
800
765
|
}
|
|
801
766
|
|
|
802
767
|
// src/SelectWidget/SelectWidget.tsx
|
|
803
|
-
var import_FormSelect = __toESM(require("react-bootstrap/FormSelect"));
|
|
804
|
-
var
|
|
805
|
-
var
|
|
768
|
+
var import_FormSelect = __toESM(require("react-bootstrap/FormSelect"), 1);
|
|
769
|
+
var import_utils18 = require("@rjsf/utils");
|
|
770
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
806
771
|
function SelectWidget({
|
|
807
772
|
schema,
|
|
808
773
|
id,
|
|
@@ -828,9 +793,9 @@ function SelectWidget({
|
|
|
828
793
|
return event.target.value;
|
|
829
794
|
}
|
|
830
795
|
}
|
|
831
|
-
const selectedIndexes = (0,
|
|
796
|
+
const selectedIndexes = (0, import_utils18.enumOptionsIndexForValue)(value, enumOptions, multiple);
|
|
832
797
|
const showPlaceholderOption = !multiple && schema.default === void 0;
|
|
833
|
-
return /* @__PURE__ */ (0,
|
|
798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
834
799
|
import_FormSelect.default,
|
|
835
800
|
{
|
|
836
801
|
id,
|
|
@@ -843,22 +808,22 @@ function SelectWidget({
|
|
|
843
808
|
className: rawErrors.length > 0 ? "is-invalid" : "",
|
|
844
809
|
onBlur: onBlur && ((event) => {
|
|
845
810
|
const newValue = getValue(event, multiple);
|
|
846
|
-
onBlur(id, (0,
|
|
811
|
+
onBlur(id, (0, import_utils18.enumOptionsValueForIndex)(newValue, enumOptions, optEmptyValue));
|
|
847
812
|
}),
|
|
848
813
|
onFocus: onFocus && ((event) => {
|
|
849
814
|
const newValue = getValue(event, multiple);
|
|
850
|
-
onFocus(id, (0,
|
|
815
|
+
onFocus(id, (0, import_utils18.enumOptionsValueForIndex)(newValue, enumOptions, optEmptyValue));
|
|
851
816
|
}),
|
|
852
817
|
onChange: (event) => {
|
|
853
818
|
const newValue = getValue(event, multiple);
|
|
854
|
-
onChange((0,
|
|
819
|
+
onChange((0, import_utils18.enumOptionsValueForIndex)(newValue, enumOptions, optEmptyValue));
|
|
855
820
|
},
|
|
856
|
-
"aria-describedby": (0,
|
|
821
|
+
"aria-describedby": (0, import_utils18.ariaDescribedByIds)(id),
|
|
857
822
|
children: [
|
|
858
|
-
showPlaceholderOption && /* @__PURE__ */ (0,
|
|
823
|
+
showPlaceholderOption && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: "", children: placeholder }),
|
|
859
824
|
enumOptions.map(({ value: value2, label }, i) => {
|
|
860
825
|
const disabled2 = Array.isArray(enumDisabled) && enumDisabled.indexOf(value2) != -1;
|
|
861
|
-
return /* @__PURE__ */ (0,
|
|
826
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { id: label, value: String(i), disabled: disabled2, children: label }, i);
|
|
862
827
|
})
|
|
863
828
|
]
|
|
864
829
|
}
|
|
@@ -866,10 +831,10 @@ function SelectWidget({
|
|
|
866
831
|
}
|
|
867
832
|
|
|
868
833
|
// src/TextareaWidget/TextareaWidget.tsx
|
|
869
|
-
var
|
|
870
|
-
var import_FormControl = __toESM(require("react-bootstrap/FormControl"));
|
|
871
|
-
var import_InputGroup = __toESM(require("react-bootstrap/InputGroup"));
|
|
872
|
-
var
|
|
834
|
+
var import_utils19 = require("@rjsf/utils");
|
|
835
|
+
var import_FormControl = __toESM(require("react-bootstrap/FormControl"), 1);
|
|
836
|
+
var import_InputGroup = __toESM(require("react-bootstrap/InputGroup"), 1);
|
|
837
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
873
838
|
function TextareaWidget({
|
|
874
839
|
id,
|
|
875
840
|
placeholder,
|
|
@@ -886,7 +851,7 @@ function TextareaWidget({
|
|
|
886
851
|
const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
|
|
887
852
|
const _onBlur = ({ target }) => onBlur(id, target && target.value);
|
|
888
853
|
const _onFocus = ({ target }) => onFocus(id, target && target.value);
|
|
889
|
-
return /* @__PURE__ */ (0,
|
|
854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_InputGroup.default, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
890
855
|
import_FormControl.default,
|
|
891
856
|
{
|
|
892
857
|
id,
|
|
@@ -902,7 +867,7 @@ function TextareaWidget({
|
|
|
902
867
|
onChange: _onChange,
|
|
903
868
|
onBlur: _onBlur,
|
|
904
869
|
onFocus: _onFocus,
|
|
905
|
-
"aria-describedby": (0,
|
|
870
|
+
"aria-describedby": (0, import_utils19.ariaDescribedByIds)(id)
|
|
906
871
|
}
|
|
907
872
|
) });
|
|
908
873
|
}
|
|
@@ -936,5 +901,5 @@ function generateForm() {
|
|
|
936
901
|
var Form_default = generateForm();
|
|
937
902
|
|
|
938
903
|
// src/index.ts
|
|
939
|
-
var
|
|
904
|
+
var index_default = Form_default;
|
|
940
905
|
//# sourceMappingURL=index.js.map
|