@rjsf/react-bootstrap 6.0.0-alpha.0 → 6.0.0-beta.2
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 +197 -238
- package/dist/index.js.map +4 -4
- package/dist/react-bootstrap.esm.js +123 -158
- package/dist/react-bootstrap.esm.js.map +4 -4
- package/dist/react-bootstrap.umd.js +55 -103
- 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/CheckboxWidget/CheckboxWidget.js +1 -1
- package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
- package/lib/DescriptionField/DescriptionField.d.ts +5 -1
- package/lib/DescriptionField/DescriptionField.js +9 -4
- 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 +4 -7
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +1 -1
- package/src/DescriptionField/DescriptionField.tsx +16 -11
- 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
|
-
var
|
|
46
|
+
var import_core2 = 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,35 +204,36 @@ 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
|
] });
|
|
271
221
|
}
|
|
272
222
|
|
|
273
223
|
// src/DescriptionField/DescriptionField.tsx
|
|
224
|
+
var import_core = require("@rjsf/core");
|
|
274
225
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
275
|
-
function DescriptionField({ id, description }) {
|
|
276
|
-
if (description) {
|
|
277
|
-
return
|
|
226
|
+
function DescriptionField({ id, description, registry, uiSchema }) {
|
|
227
|
+
if (!description) {
|
|
228
|
+
return null;
|
|
278
229
|
}
|
|
279
|
-
return
|
|
230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { id, className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_core.RichDescription, { description, registry, uiSchema }) }) });
|
|
280
231
|
}
|
|
281
232
|
|
|
282
233
|
// src/ErrorList/ErrorList.tsx
|
|
283
|
-
var import_Card = __toESM(require("react-bootstrap/Card"));
|
|
284
|
-
var import_ListGroup = __toESM(require("react-bootstrap/ListGroup"));
|
|
285
|
-
var
|
|
234
|
+
var import_Card = __toESM(require("react-bootstrap/Card"), 1);
|
|
235
|
+
var import_ListGroup = __toESM(require("react-bootstrap/ListGroup"), 1);
|
|
236
|
+
var import_utils5 = require("@rjsf/utils");
|
|
286
237
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
287
238
|
function ErrorList({
|
|
288
239
|
errors,
|
|
@@ -290,7 +241,7 @@ function ErrorList({
|
|
|
290
241
|
}) {
|
|
291
242
|
const { translateString } = registry;
|
|
292
243
|
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(
|
|
244
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Card.default.Header, { className: "alert-danger", children: translateString(import_utils5.TranslatableString.ErrorsLabel) }),
|
|
294
245
|
/* @__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
246
|
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
247
|
}) }) })
|
|
@@ -298,8 +249,8 @@ function ErrorList({
|
|
|
298
249
|
}
|
|
299
250
|
|
|
300
251
|
// src/IconButton/IconButton.tsx
|
|
301
|
-
var
|
|
302
|
-
var import_Button2 = __toESM(require("react-bootstrap/Button"));
|
|
252
|
+
var import_utils6 = require("@rjsf/utils");
|
|
253
|
+
var import_Button2 = __toESM(require("react-bootstrap/Button"), 1);
|
|
303
254
|
var import_IoIosCopy = require("@react-icons/all-files/io/IoIosCopy");
|
|
304
255
|
var import_IoIosRemove = require("@react-icons/all-files/io/IoIosRemove");
|
|
305
256
|
var import_AiOutlineArrowUp = require("@react-icons/all-files/ai/AiOutlineArrowUp");
|
|
@@ -313,19 +264,19 @@ function CopyButton(props) {
|
|
|
313
264
|
const {
|
|
314
265
|
registry: { translateString }
|
|
315
266
|
} = props;
|
|
316
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconButton, { title: translateString(
|
|
267
|
+
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
268
|
}
|
|
318
269
|
function MoveDownButton(props) {
|
|
319
270
|
const {
|
|
320
271
|
registry: { translateString }
|
|
321
272
|
} = props;
|
|
322
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconButton, { title: translateString(
|
|
273
|
+
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
274
|
}
|
|
324
275
|
function MoveUpButton(props) {
|
|
325
276
|
const {
|
|
326
277
|
registry: { translateString }
|
|
327
278
|
} = props;
|
|
328
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconButton, { title: translateString(
|
|
279
|
+
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
280
|
}
|
|
330
281
|
function RemoveButton(props) {
|
|
331
282
|
const {
|
|
@@ -334,7 +285,7 @@ function RemoveButton(props) {
|
|
|
334
285
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
335
286
|
IconButton,
|
|
336
287
|
{
|
|
337
|
-
title: translateString(
|
|
288
|
+
title: translateString(import_utils6.TranslatableString.RemoveButton),
|
|
338
289
|
...props,
|
|
339
290
|
variant: "danger",
|
|
340
291
|
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_IoIosRemove.IoIosRemove, {})
|
|
@@ -343,36 +294,36 @@ function RemoveButton(props) {
|
|
|
343
294
|
}
|
|
344
295
|
|
|
345
296
|
// src/FieldErrorTemplate/FieldErrorTemplate.tsx
|
|
346
|
-
var
|
|
347
|
-
var import_ListGroup2 = __toESM(require("react-bootstrap/ListGroup"));
|
|
297
|
+
var import_utils7 = require("@rjsf/utils");
|
|
298
|
+
var import_ListGroup2 = __toESM(require("react-bootstrap/ListGroup"), 1);
|
|
348
299
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
349
300
|
function FieldErrorTemplate(props) {
|
|
350
301
|
const { errors = [], idSchema } = props;
|
|
351
302
|
if (errors.length === 0) {
|
|
352
303
|
return null;
|
|
353
304
|
}
|
|
354
|
-
const id = (0,
|
|
305
|
+
const id = (0, import_utils7.errorId)(idSchema);
|
|
355
306
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_ListGroup2.default, { as: "ul", id, children: errors.map((error, i) => {
|
|
356
307
|
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
308
|
}) });
|
|
358
309
|
}
|
|
359
310
|
|
|
360
311
|
// src/FieldHelpTemplate/FieldHelpTemplate.tsx
|
|
361
|
-
var
|
|
362
|
-
var import_Form2 = __toESM(require("react-bootstrap/Form"));
|
|
312
|
+
var import_utils8 = require("@rjsf/utils");
|
|
313
|
+
var import_Form2 = __toESM(require("react-bootstrap/Form"), 1);
|
|
363
314
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
364
315
|
function FieldHelpTemplate(props) {
|
|
365
316
|
const { idSchema, help, hasErrors } = props;
|
|
366
317
|
if (!help) {
|
|
367
318
|
return null;
|
|
368
319
|
}
|
|
369
|
-
const id = (0,
|
|
320
|
+
const id = (0, import_utils8.helpId)(idSchema);
|
|
370
321
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_Form2.default.Text, { className: hasErrors ? "text-danger" : "text-muted", id, children: help });
|
|
371
322
|
}
|
|
372
323
|
|
|
373
324
|
// src/FieldTemplate/FieldTemplate.tsx
|
|
374
|
-
var
|
|
375
|
-
var import_Form3 = __toESM(require("react-bootstrap/Form"));
|
|
325
|
+
var import_utils9 = require("@rjsf/utils");
|
|
326
|
+
var import_Form3 = __toESM(require("react-bootstrap/Form"), 1);
|
|
376
327
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
377
328
|
function FieldTemplate({
|
|
378
329
|
id,
|
|
@@ -396,8 +347,8 @@ function FieldTemplate({
|
|
|
396
347
|
uiSchema,
|
|
397
348
|
registry
|
|
398
349
|
}) {
|
|
399
|
-
const uiOptions = (0,
|
|
400
|
-
const WrapIfAdditionalTemplate2 = (0,
|
|
350
|
+
const uiOptions = (0, import_utils9.getUiOptions)(uiSchema);
|
|
351
|
+
const WrapIfAdditionalTemplate2 = (0, import_utils9.getTemplate)(
|
|
401
352
|
"WrapIfAdditionalTemplate",
|
|
402
353
|
registry,
|
|
403
354
|
uiOptions
|
|
@@ -434,12 +385,24 @@ function FieldTemplate({
|
|
|
434
385
|
);
|
|
435
386
|
}
|
|
436
387
|
|
|
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");
|
|
388
|
+
// src/GridTemplate/GridTemplate.tsx
|
|
389
|
+
var import_Row3 = __toESM(require("react-bootstrap/Row"), 1);
|
|
390
|
+
var import_Col3 = __toESM(require("react-bootstrap/Col"), 1);
|
|
442
391
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
392
|
+
function GridTemplate(props) {
|
|
393
|
+
const { children, column, ...rest } = props;
|
|
394
|
+
if (column) {
|
|
395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_Col3.default, { ...rest, children });
|
|
396
|
+
}
|
|
397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_Row3.default, { ...rest, children });
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
// src/ObjectFieldTemplate/ObjectFieldTemplate.tsx
|
|
401
|
+
var import_Row4 = __toESM(require("react-bootstrap/Row"), 1);
|
|
402
|
+
var import_Col4 = __toESM(require("react-bootstrap/Col"), 1);
|
|
403
|
+
var import_Container2 = __toESM(require("react-bootstrap/Container"), 1);
|
|
404
|
+
var import_utils10 = require("@rjsf/utils");
|
|
405
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
443
406
|
function ObjectFieldTemplate({
|
|
444
407
|
description,
|
|
445
408
|
title,
|
|
@@ -454,9 +417,9 @@ function ObjectFieldTemplate({
|
|
|
454
417
|
readonly,
|
|
455
418
|
registry
|
|
456
419
|
}) {
|
|
457
|
-
const uiOptions = (0,
|
|
458
|
-
const TitleFieldTemplate = (0,
|
|
459
|
-
const DescriptionFieldTemplate = (0,
|
|
420
|
+
const uiOptions = (0, import_utils10.getUiOptions)(uiSchema);
|
|
421
|
+
const TitleFieldTemplate = (0, import_utils10.getTemplate)("TitleFieldTemplate", registry, uiOptions);
|
|
422
|
+
const DescriptionFieldTemplate = (0, import_utils10.getTemplate)(
|
|
460
423
|
"DescriptionFieldTemplate",
|
|
461
424
|
registry,
|
|
462
425
|
uiOptions
|
|
@@ -464,11 +427,11 @@ function ObjectFieldTemplate({
|
|
|
464
427
|
const {
|
|
465
428
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
466
429
|
} = registry.templates;
|
|
467
|
-
return /* @__PURE__ */ (0,
|
|
468
|
-
title && /* @__PURE__ */ (0,
|
|
430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
431
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
469
432
|
TitleFieldTemplate,
|
|
470
433
|
{
|
|
471
|
-
id: (0,
|
|
434
|
+
id: (0, import_utils10.titleId)(idSchema),
|
|
472
435
|
title,
|
|
473
436
|
required,
|
|
474
437
|
schema,
|
|
@@ -476,27 +439,28 @@ function ObjectFieldTemplate({
|
|
|
476
439
|
registry
|
|
477
440
|
}
|
|
478
441
|
),
|
|
479
|
-
description && /* @__PURE__ */ (0,
|
|
442
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
480
443
|
DescriptionFieldTemplate,
|
|
481
444
|
{
|
|
482
|
-
id: (0,
|
|
445
|
+
id: (0, import_utils10.descriptionId)(idSchema),
|
|
483
446
|
description,
|
|
484
447
|
schema,
|
|
485
448
|
uiSchema,
|
|
486
449
|
registry
|
|
487
450
|
}
|
|
488
451
|
),
|
|
489
|
-
/* @__PURE__ */ (0,
|
|
490
|
-
properties.map((element, index) => /* @__PURE__ */ (0,
|
|
452
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_Container2.default, { fluid: true, className: "p-0", children: [
|
|
453
|
+
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
454
|
" ",
|
|
492
455
|
element.content
|
|
493
456
|
] }) }, index)),
|
|
494
|
-
(0,
|
|
457
|
+
(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
458
|
AddButton2,
|
|
496
459
|
{
|
|
460
|
+
id: (0, import_utils10.buttonId)(idSchema, "add"),
|
|
497
461
|
onClick: onAddClick(schema),
|
|
498
462
|
disabled: disabled || readonly,
|
|
499
|
-
className: "object-property-expand",
|
|
463
|
+
className: "rjsf-object-property-expand",
|
|
500
464
|
uiSchema,
|
|
501
465
|
registry
|
|
502
466
|
}
|
|
@@ -506,38 +470,38 @@ function ObjectFieldTemplate({
|
|
|
506
470
|
}
|
|
507
471
|
|
|
508
472
|
// src/SubmitButton/SubmitButton.tsx
|
|
509
|
-
var import_Button3 = __toESM(require("react-bootstrap/Button"));
|
|
510
|
-
var
|
|
511
|
-
var
|
|
473
|
+
var import_Button3 = __toESM(require("react-bootstrap/Button"), 1);
|
|
474
|
+
var import_utils11 = require("@rjsf/utils");
|
|
475
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
512
476
|
function SubmitButton(props) {
|
|
513
|
-
const { submitText, norender, props: submitButtonProps } = (0,
|
|
477
|
+
const { submitText, norender, props: submitButtonProps } = (0, import_utils11.getSubmitButtonOptions)(props.uiSchema);
|
|
514
478
|
if (norender) {
|
|
515
479
|
return null;
|
|
516
480
|
}
|
|
517
|
-
return /* @__PURE__ */ (0,
|
|
481
|
+
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
482
|
}
|
|
519
483
|
|
|
520
484
|
// src/TitleField/TitleField.tsx
|
|
521
|
-
var
|
|
522
|
-
var
|
|
485
|
+
var import_utils12 = require("@rjsf/utils");
|
|
486
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
523
487
|
function TitleField({
|
|
524
488
|
id,
|
|
525
489
|
title,
|
|
526
490
|
uiSchema
|
|
527
491
|
}) {
|
|
528
|
-
const uiOptions = (0,
|
|
529
|
-
return /* @__PURE__ */ (0,
|
|
530
|
-
/* @__PURE__ */ (0,
|
|
531
|
-
/* @__PURE__ */ (0,
|
|
492
|
+
const uiOptions = (0, import_utils12.getUiOptions)(uiSchema);
|
|
493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { id, className: "my-1", children: [
|
|
494
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h5", { children: uiOptions.title || title }),
|
|
495
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("hr", { className: "border-0 bg-secondary", style: { height: "1px" } })
|
|
532
496
|
] });
|
|
533
497
|
}
|
|
534
498
|
|
|
535
499
|
// src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx
|
|
536
|
-
var
|
|
537
|
-
var
|
|
538
|
-
var
|
|
539
|
-
var import_Form4 = __toESM(require("react-bootstrap/Form"));
|
|
540
|
-
var
|
|
500
|
+
var import_utils13 = require("@rjsf/utils");
|
|
501
|
+
var import_Row5 = __toESM(require("react-bootstrap/Row"), 1);
|
|
502
|
+
var import_Col5 = __toESM(require("react-bootstrap/Col"), 1);
|
|
503
|
+
var import_Form4 = __toESM(require("react-bootstrap/Form"), 1);
|
|
504
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
541
505
|
function WrapIfAdditionalTemplate({
|
|
542
506
|
classNames,
|
|
543
507
|
style,
|
|
@@ -555,17 +519,17 @@ function WrapIfAdditionalTemplate({
|
|
|
555
519
|
}) {
|
|
556
520
|
const { templates, translateString } = registry;
|
|
557
521
|
const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
|
|
558
|
-
const keyLabel = translateString(
|
|
559
|
-
const additional =
|
|
522
|
+
const keyLabel = translateString(import_utils13.TranslatableString.KeyLabel, [label]);
|
|
523
|
+
const additional = import_utils13.ADDITIONAL_PROPERTY_FLAG in schema;
|
|
560
524
|
if (!additional) {
|
|
561
|
-
return /* @__PURE__ */ (0,
|
|
525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: classNames, style, children });
|
|
562
526
|
}
|
|
563
527
|
const handleBlur = ({ target }) => onKeyChange(target.value);
|
|
564
528
|
const keyId = `${id}-key`;
|
|
565
|
-
return /* @__PURE__ */ (0,
|
|
566
|
-
/* @__PURE__ */ (0,
|
|
567
|
-
/* @__PURE__ */ (0,
|
|
568
|
-
/* @__PURE__ */ (0,
|
|
529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_Row5.default, { className: classNames, style, children: [
|
|
530
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_Col5.default, { xs: 5, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_Form4.default.Group, { children: [
|
|
531
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_Form4.default.Label, { htmlFor: keyId, children: keyLabel }),
|
|
532
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
569
533
|
import_Form4.default.Control,
|
|
570
534
|
{
|
|
571
535
|
required,
|
|
@@ -578,11 +542,12 @@ function WrapIfAdditionalTemplate({
|
|
|
578
542
|
}
|
|
579
543
|
)
|
|
580
544
|
] }) }),
|
|
581
|
-
/* @__PURE__ */ (0,
|
|
582
|
-
/* @__PURE__ */ (0,
|
|
545
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_Col5.default, { xs: 5, children }),
|
|
546
|
+
/* @__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
547
|
RemoveButton2,
|
|
584
548
|
{
|
|
585
|
-
|
|
549
|
+
id: (0, import_utils13.buttonId)(id, "remove"),
|
|
550
|
+
className: "rjsf-object-property-remove w-100",
|
|
586
551
|
disabled: disabled || readonly,
|
|
587
552
|
onClick: onDropPropertyClick(label),
|
|
588
553
|
uiSchema,
|
|
@@ -611,6 +576,7 @@ function generateTemplates() {
|
|
|
611
576
|
FieldErrorTemplate,
|
|
612
577
|
FieldHelpTemplate,
|
|
613
578
|
FieldTemplate,
|
|
579
|
+
GridTemplate,
|
|
614
580
|
ObjectFieldTemplate,
|
|
615
581
|
TitleFieldTemplate: TitleField,
|
|
616
582
|
WrapIfAdditionalTemplate
|
|
@@ -619,9 +585,9 @@ function generateTemplates() {
|
|
|
619
585
|
var Templates_default = generateTemplates();
|
|
620
586
|
|
|
621
587
|
// src/CheckboxWidget/CheckboxWidget.tsx
|
|
622
|
-
var
|
|
623
|
-
var import_Form5 = __toESM(require("react-bootstrap/Form"));
|
|
624
|
-
var
|
|
588
|
+
var import_utils14 = require("@rjsf/utils");
|
|
589
|
+
var import_Form5 = __toESM(require("react-bootstrap/Form"), 1);
|
|
590
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
625
591
|
function CheckboxWidget(props) {
|
|
626
592
|
const {
|
|
627
593
|
id,
|
|
@@ -639,8 +605,8 @@ function CheckboxWidget(props) {
|
|
|
639
605
|
registry,
|
|
640
606
|
uiSchema
|
|
641
607
|
} = props;
|
|
642
|
-
const required = (0,
|
|
643
|
-
const DescriptionFieldTemplate = (0,
|
|
608
|
+
const required = (0, import_utils14.schemaRequiresTrueValue)(schema);
|
|
609
|
+
const DescriptionFieldTemplate = (0, import_utils14.getTemplate)(
|
|
644
610
|
"DescriptionFieldTemplate",
|
|
645
611
|
registry,
|
|
646
612
|
options
|
|
@@ -649,63 +615,56 @@ function CheckboxWidget(props) {
|
|
|
649
615
|
const _onBlur = ({ target }) => onBlur(id, target && target.checked);
|
|
650
616
|
const _onFocus = ({ target }) => onFocus(id, target && target.checked);
|
|
651
617
|
const description = options.description || schema.description;
|
|
652
|
-
return /* @__PURE__ */ (0,
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
onBlur: _onBlur,
|
|
681
|
-
onFocus: _onFocus
|
|
682
|
-
}
|
|
683
|
-
)
|
|
684
|
-
]
|
|
685
|
-
}
|
|
686
|
-
);
|
|
618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_Form5.default.Group, { className: disabled || readonly ? "disabled" : "", "aria-describedby": (0, import_utils14.ariaDescribedByIds)(id), children: [
|
|
619
|
+
!hideLabel && description && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
620
|
+
DescriptionFieldTemplate,
|
|
621
|
+
{
|
|
622
|
+
id: (0, import_utils14.descriptionId)(id),
|
|
623
|
+
description,
|
|
624
|
+
schema,
|
|
625
|
+
uiSchema,
|
|
626
|
+
registry
|
|
627
|
+
}
|
|
628
|
+
),
|
|
629
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
630
|
+
import_Form5.default.Check,
|
|
631
|
+
{
|
|
632
|
+
id,
|
|
633
|
+
name: id,
|
|
634
|
+
label: (0, import_utils14.labelValue)(label, hideLabel || !label),
|
|
635
|
+
checked: typeof value === "undefined" ? false : value,
|
|
636
|
+
required,
|
|
637
|
+
disabled: disabled || readonly,
|
|
638
|
+
autoFocus: autofocus,
|
|
639
|
+
onChange: _onChange,
|
|
640
|
+
type: "checkbox",
|
|
641
|
+
onBlur: _onBlur,
|
|
642
|
+
onFocus: _onFocus
|
|
643
|
+
}
|
|
644
|
+
)
|
|
645
|
+
] });
|
|
687
646
|
}
|
|
688
647
|
|
|
689
648
|
// src/CheckboxesWidget/CheckboxesWidget.tsx
|
|
690
|
-
var import_Form6 = __toESM(require("react-bootstrap/Form"));
|
|
691
|
-
var
|
|
692
|
-
var
|
|
649
|
+
var import_Form6 = __toESM(require("react-bootstrap/Form"), 1);
|
|
650
|
+
var import_utils15 = require("@rjsf/utils");
|
|
651
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
693
652
|
function CheckboxesWidget({ id, disabled, options, value, autofocus, readonly, required, onChange, onBlur, onFocus }) {
|
|
694
653
|
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
695
654
|
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
696
655
|
const _onChange = (index) => ({ target: { checked } }) => {
|
|
697
656
|
if (checked) {
|
|
698
|
-
onChange((0,
|
|
657
|
+
onChange((0, import_utils15.enumOptionsSelectValue)(index, checkboxesValues, enumOptions));
|
|
699
658
|
} else {
|
|
700
|
-
onChange((0,
|
|
659
|
+
onChange((0, import_utils15.enumOptionsDeselectValue)(index, checkboxesValues, enumOptions));
|
|
701
660
|
}
|
|
702
661
|
};
|
|
703
|
-
const _onBlur = ({ target }) => onBlur(id, (0,
|
|
704
|
-
const _onFocus = ({ target }) => onFocus(id, (0,
|
|
705
|
-
return /* @__PURE__ */ (0,
|
|
706
|
-
const checked = (0,
|
|
662
|
+
const _onBlur = ({ target }) => onBlur(id, (0, import_utils15.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
663
|
+
const _onFocus = ({ target }) => onFocus(id, (0, import_utils15.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
664
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_Form6.default.Group, { children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
665
|
+
const checked = (0, import_utils15.enumOptionsIsSelected)(option.value, checkboxesValues);
|
|
707
666
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
708
|
-
return /* @__PURE__ */ (0,
|
|
667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
709
668
|
import_Form6.default.Check,
|
|
710
669
|
{
|
|
711
670
|
inline,
|
|
@@ -713,7 +672,7 @@ function CheckboxesWidget({ id, disabled, options, value, autofocus, readonly, r
|
|
|
713
672
|
checked,
|
|
714
673
|
className: "bg-transparent border-0",
|
|
715
674
|
type: "checkbox",
|
|
716
|
-
id: (0,
|
|
675
|
+
id: (0, import_utils15.optionId)(id, index),
|
|
717
676
|
name: id,
|
|
718
677
|
label: option.label,
|
|
719
678
|
autoFocus: autofocus && index === 0,
|
|
@@ -721,7 +680,7 @@ function CheckboxesWidget({ id, disabled, options, value, autofocus, readonly, r
|
|
|
721
680
|
onBlur: _onBlur,
|
|
722
681
|
onFocus: _onFocus,
|
|
723
682
|
disabled: disabled || itemDisabled || readonly,
|
|
724
|
-
"aria-describedby": (0,
|
|
683
|
+
"aria-describedby": (0, import_utils15.ariaDescribedByIds)(id)
|
|
725
684
|
},
|
|
726
685
|
option.value
|
|
727
686
|
);
|
|
@@ -729,9 +688,9 @@ function CheckboxesWidget({ id, disabled, options, value, autofocus, readonly, r
|
|
|
729
688
|
}
|
|
730
689
|
|
|
731
690
|
// src/RadioWidget/RadioWidget.tsx
|
|
732
|
-
var import_Form7 = __toESM(require("react-bootstrap/Form"));
|
|
733
|
-
var
|
|
734
|
-
var
|
|
691
|
+
var import_Form7 = __toESM(require("react-bootstrap/Form"), 1);
|
|
692
|
+
var import_utils16 = require("@rjsf/utils");
|
|
693
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
735
694
|
function RadioWidget({
|
|
736
695
|
id,
|
|
737
696
|
options,
|
|
@@ -744,19 +703,19 @@ function RadioWidget({
|
|
|
744
703
|
onFocus
|
|
745
704
|
}) {
|
|
746
705
|
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,
|
|
706
|
+
const _onChange = ({ target: { value: value2 } }) => onChange((0, import_utils16.enumOptionsValueForIndex)(value2, enumOptions, emptyValue));
|
|
707
|
+
const _onBlur = ({ target }) => onBlur(id, (0, import_utils16.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
708
|
+
const _onFocus = ({ target }) => onFocus(id, (0, import_utils16.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
750
709
|
const inline = Boolean(options && options.inline);
|
|
751
|
-
return /* @__PURE__ */ (0,
|
|
710
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_Form7.default.Group, { className: "mb-0", children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
752
711
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
753
|
-
const checked = (0,
|
|
754
|
-
const radio = /* @__PURE__ */ (0,
|
|
712
|
+
const checked = (0, import_utils16.enumOptionsIsSelected)(option.value, value);
|
|
713
|
+
const radio = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
755
714
|
import_Form7.default.Check,
|
|
756
715
|
{
|
|
757
716
|
inline,
|
|
758
717
|
label: option.label,
|
|
759
|
-
id: (0,
|
|
718
|
+
id: (0, import_utils16.optionId)(id, index),
|
|
760
719
|
name: id,
|
|
761
720
|
type: "radio",
|
|
762
721
|
disabled: disabled || itemDisabled || readonly,
|
|
@@ -766,7 +725,7 @@ function RadioWidget({
|
|
|
766
725
|
onChange: _onChange,
|
|
767
726
|
onBlur: _onBlur,
|
|
768
727
|
onFocus: _onFocus,
|
|
769
|
-
"aria-describedby": (0,
|
|
728
|
+
"aria-describedby": (0, import_utils16.ariaDescribedByIds)(id)
|
|
770
729
|
},
|
|
771
730
|
index
|
|
772
731
|
);
|
|
@@ -775,9 +734,9 @@ function RadioWidget({
|
|
|
775
734
|
}
|
|
776
735
|
|
|
777
736
|
// src/RangeWidget/RangeWidget.tsx
|
|
778
|
-
var
|
|
779
|
-
var import_FormRange = __toESM(require("react-bootstrap/FormRange"));
|
|
780
|
-
var
|
|
737
|
+
var import_utils17 = require("@rjsf/utils");
|
|
738
|
+
var import_FormRange = __toESM(require("react-bootstrap/FormRange"), 1);
|
|
739
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
781
740
|
function RangeWidget(props) {
|
|
782
741
|
const { id, value, disabled, onChange, onBlur, onFocus, schema } = props;
|
|
783
742
|
const _onChange = ({ target: { value: value2 } }) => onChange(value2);
|
|
@@ -791,18 +750,18 @@ function RangeWidget(props) {
|
|
|
791
750
|
onChange: _onChange,
|
|
792
751
|
onBlur: _onBlur,
|
|
793
752
|
onFocus: _onFocus,
|
|
794
|
-
...(0,
|
|
753
|
+
...(0, import_utils17.rangeSpec)(schema)
|
|
795
754
|
};
|
|
796
|
-
return /* @__PURE__ */ (0,
|
|
797
|
-
/* @__PURE__ */ (0,
|
|
798
|
-
/* @__PURE__ */ (0,
|
|
755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
756
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_FormRange.default, { ...rangeProps }),
|
|
757
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "range-view", children: value })
|
|
799
758
|
] });
|
|
800
759
|
}
|
|
801
760
|
|
|
802
761
|
// src/SelectWidget/SelectWidget.tsx
|
|
803
|
-
var import_FormSelect = __toESM(require("react-bootstrap/FormSelect"));
|
|
804
|
-
var
|
|
805
|
-
var
|
|
762
|
+
var import_FormSelect = __toESM(require("react-bootstrap/FormSelect"), 1);
|
|
763
|
+
var import_utils18 = require("@rjsf/utils");
|
|
764
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
806
765
|
function SelectWidget({
|
|
807
766
|
schema,
|
|
808
767
|
id,
|
|
@@ -828,9 +787,9 @@ function SelectWidget({
|
|
|
828
787
|
return event.target.value;
|
|
829
788
|
}
|
|
830
789
|
}
|
|
831
|
-
const selectedIndexes = (0,
|
|
790
|
+
const selectedIndexes = (0, import_utils18.enumOptionsIndexForValue)(value, enumOptions, multiple);
|
|
832
791
|
const showPlaceholderOption = !multiple && schema.default === void 0;
|
|
833
|
-
return /* @__PURE__ */ (0,
|
|
792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
834
793
|
import_FormSelect.default,
|
|
835
794
|
{
|
|
836
795
|
id,
|
|
@@ -843,22 +802,22 @@ function SelectWidget({
|
|
|
843
802
|
className: rawErrors.length > 0 ? "is-invalid" : "",
|
|
844
803
|
onBlur: onBlur && ((event) => {
|
|
845
804
|
const newValue = getValue(event, multiple);
|
|
846
|
-
onBlur(id, (0,
|
|
805
|
+
onBlur(id, (0, import_utils18.enumOptionsValueForIndex)(newValue, enumOptions, optEmptyValue));
|
|
847
806
|
}),
|
|
848
807
|
onFocus: onFocus && ((event) => {
|
|
849
808
|
const newValue = getValue(event, multiple);
|
|
850
|
-
onFocus(id, (0,
|
|
809
|
+
onFocus(id, (0, import_utils18.enumOptionsValueForIndex)(newValue, enumOptions, optEmptyValue));
|
|
851
810
|
}),
|
|
852
811
|
onChange: (event) => {
|
|
853
812
|
const newValue = getValue(event, multiple);
|
|
854
|
-
onChange((0,
|
|
813
|
+
onChange((0, import_utils18.enumOptionsValueForIndex)(newValue, enumOptions, optEmptyValue));
|
|
855
814
|
},
|
|
856
|
-
"aria-describedby": (0,
|
|
815
|
+
"aria-describedby": (0, import_utils18.ariaDescribedByIds)(id),
|
|
857
816
|
children: [
|
|
858
|
-
showPlaceholderOption && /* @__PURE__ */ (0,
|
|
817
|
+
showPlaceholderOption && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: "", children: placeholder }),
|
|
859
818
|
enumOptions.map(({ value: value2, label }, i) => {
|
|
860
819
|
const disabled2 = Array.isArray(enumDisabled) && enumDisabled.indexOf(value2) != -1;
|
|
861
|
-
return /* @__PURE__ */ (0,
|
|
820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { id: label, value: String(i), disabled: disabled2, children: label }, i);
|
|
862
821
|
})
|
|
863
822
|
]
|
|
864
823
|
}
|
|
@@ -866,10 +825,10 @@ function SelectWidget({
|
|
|
866
825
|
}
|
|
867
826
|
|
|
868
827
|
// 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
|
|
828
|
+
var import_utils19 = require("@rjsf/utils");
|
|
829
|
+
var import_FormControl = __toESM(require("react-bootstrap/FormControl"), 1);
|
|
830
|
+
var import_InputGroup = __toESM(require("react-bootstrap/InputGroup"), 1);
|
|
831
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
873
832
|
function TextareaWidget({
|
|
874
833
|
id,
|
|
875
834
|
placeholder,
|
|
@@ -886,7 +845,7 @@ function TextareaWidget({
|
|
|
886
845
|
const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
|
|
887
846
|
const _onBlur = ({ target }) => onBlur(id, target && target.value);
|
|
888
847
|
const _onFocus = ({ target }) => onFocus(id, target && target.value);
|
|
889
|
-
return /* @__PURE__ */ (0,
|
|
848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_InputGroup.default, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
890
849
|
import_FormControl.default,
|
|
891
850
|
{
|
|
892
851
|
id,
|
|
@@ -902,7 +861,7 @@ function TextareaWidget({
|
|
|
902
861
|
onChange: _onChange,
|
|
903
862
|
onBlur: _onBlur,
|
|
904
863
|
onFocus: _onFocus,
|
|
905
|
-
"aria-describedby": (0,
|
|
864
|
+
"aria-describedby": (0, import_utils19.ariaDescribedByIds)(id)
|
|
906
865
|
}
|
|
907
866
|
) });
|
|
908
867
|
}
|
|
@@ -931,10 +890,10 @@ var Theme_default = generateTheme();
|
|
|
931
890
|
|
|
932
891
|
// src/Form/Form.tsx
|
|
933
892
|
function generateForm() {
|
|
934
|
-
return (0,
|
|
893
|
+
return (0, import_core2.withTheme)(generateTheme());
|
|
935
894
|
}
|
|
936
895
|
var Form_default = generateForm();
|
|
937
896
|
|
|
938
897
|
// src/index.ts
|
|
939
|
-
var
|
|
898
|
+
var index_default = Form_default;
|
|
940
899
|
//# sourceMappingURL=index.js.map
|