@rjsf/primereact 6.5.3 → 6.6.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.
- package/dist/index.cjs +276 -276
- package/dist/index.cjs.map +4 -4
- package/dist/primereact.esm.js +279 -279
- package/dist/primereact.esm.js.map +4 -4
- package/dist/primereact.umd.js +180 -180
- package/lib/AddButton/AddButton.js +1 -1
- package/lib/AddButton/AddButton.js.map +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.js +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
- package/lib/DescriptionField/DescriptionField.js.map +1 -1
- package/lib/ErrorList/ErrorList.js +2 -2
- package/lib/ErrorList/ErrorList.js.map +1 -1
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js +1 -1
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -1
- package/lib/IconButton/IconButton.d.ts +1 -1
- package/lib/IconButton/IconButton.js +1 -1
- package/lib/IconButton/IconButton.js.map +1 -1
- package/lib/RangeWidget/RangeWidget.js +1 -1
- package/lib/RangeWidget/RangeWidget.js.map +1 -1
- package/lib/SelectWidget/SelectWidget.js +1 -1
- package/lib/SelectWidget/SelectWidget.js.map +1 -1
- package/lib/SubmitButton/SubmitButton.js +1 -1
- package/lib/SubmitButton/SubmitButton.js.map +1 -1
- package/lib/Templates/Templates.js +3 -3
- package/lib/Templates/Templates.js.map +1 -1
- package/lib/TextareaWidget/TextareaWidget.js.map +1 -1
- package/lib/Theme/Theme.d.ts +1 -1
- package/lib/TitleField/TitleField.js +1 -1
- package/lib/TitleField/TitleField.js.map +1 -1
- package/lib/Widgets/Widgets.js +1 -1
- package/lib/Widgets/Widgets.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -14
- package/src/AddButton/AddButton.tsx +1 -1
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +1 -0
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +1 -1
- package/src/DescriptionField/DescriptionField.tsx +1 -1
- package/src/ErrorList/ErrorList.tsx +2 -2
- package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +1 -1
- package/src/IconButton/IconButton.tsx +1 -1
- 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 -3
- package/src/TextareaWidget/TextareaWidget.tsx +1 -1
- package/src/Theme/Theme.ts +1 -1
- package/src/TitleField/TitleField.tsx +1 -1
- package/src/Widgets/Widgets.tsx +1 -1
- package/src/tsconfig.json +0 -1
package/dist/index.cjs
CHANGED
|
@@ -36,8 +36,8 @@ module.exports = __toCommonJS(index_exports);
|
|
|
36
36
|
var import_core3 = require("@rjsf/core");
|
|
37
37
|
|
|
38
38
|
// src/AddButton/AddButton.tsx
|
|
39
|
-
var import_button = require("primereact/button");
|
|
40
39
|
var import_utils = require("@rjsf/utils");
|
|
40
|
+
var import_button = require("primereact/button");
|
|
41
41
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
42
|
function AddButton({
|
|
43
43
|
uiSchema,
|
|
@@ -175,11 +175,30 @@ function ArrayFieldTemplate(props) {
|
|
|
175
175
|
] });
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
+
// src/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.tsx
|
|
179
|
+
var import_utils4 = require("@rjsf/utils");
|
|
180
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
181
|
+
function ArrayFieldTitleTemplate({ title, uiSchema, required, fieldPathId, optionalDataControl }) {
|
|
182
|
+
const uiOptions = (0, import_utils4.getUiOptions)(uiSchema);
|
|
183
|
+
let heading = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("h5", { id: (0, import_utils4.titleId)(fieldPathId), style: { margin: 0, fontSize: "1.5rem", marginBottom: "0.2rem" }, children: [
|
|
184
|
+
uiOptions.title || title,
|
|
185
|
+
" ",
|
|
186
|
+
required ? "*" : ""
|
|
187
|
+
] });
|
|
188
|
+
if (optionalDataControl) {
|
|
189
|
+
heading = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "flex" }, children: [
|
|
190
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { flexGrow: 1 }, children: heading }),
|
|
191
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { children: optionalDataControl })
|
|
192
|
+
] });
|
|
193
|
+
}
|
|
194
|
+
return heading;
|
|
195
|
+
}
|
|
196
|
+
|
|
178
197
|
// src/BaseInputTemplate/BaseInputTemplate.tsx
|
|
179
198
|
var import_react = require("react");
|
|
180
|
-
var
|
|
199
|
+
var import_utils5 = require("@rjsf/utils");
|
|
181
200
|
var import_inputtext = require("primereact/inputtext");
|
|
182
|
-
var
|
|
201
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
183
202
|
function BaseInputTemplate(props) {
|
|
184
203
|
const {
|
|
185
204
|
id,
|
|
@@ -202,7 +221,7 @@ function BaseInputTemplate(props) {
|
|
|
202
221
|
} = props;
|
|
203
222
|
const { ClearButton: ClearButton2 } = registry.templates.ButtonTemplates;
|
|
204
223
|
const { AutoCompleteWidget: AutoCompleteWidget2 } = registry.widgets;
|
|
205
|
-
const inputProps = (0,
|
|
224
|
+
const inputProps = (0, import_utils5.getInputProps)(schema, type, options);
|
|
206
225
|
const primeProps = options.prime || {};
|
|
207
226
|
const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
|
|
208
227
|
const _onBlur = () => onBlur && onBlur(id, value);
|
|
@@ -216,10 +235,10 @@ function BaseInputTemplate(props) {
|
|
|
216
235
|
[onChange, options.emptyValue]
|
|
217
236
|
);
|
|
218
237
|
if (Array.isArray(schema.examples)) {
|
|
219
|
-
return /* @__PURE__ */ (0,
|
|
238
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AutoCompleteWidget2, { ...props });
|
|
220
239
|
}
|
|
221
|
-
return /* @__PURE__ */ (0,
|
|
222
|
-
/* @__PURE__ */ (0,
|
|
240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
241
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
223
242
|
import_inputtext.InputText,
|
|
224
243
|
{
|
|
225
244
|
id,
|
|
@@ -230,48 +249,48 @@ function BaseInputTemplate(props) {
|
|
|
230
249
|
required,
|
|
231
250
|
autoFocus: autofocus,
|
|
232
251
|
disabled: disabled || readonly,
|
|
233
|
-
list: schema.examples ? (0,
|
|
252
|
+
list: schema.examples ? (0, import_utils5.examplesId)(id) : void 0,
|
|
234
253
|
value: value || value === 0 ? value : "",
|
|
235
254
|
invalid: rawErrors.length > 0,
|
|
236
255
|
onChange: onChangeOverride || _onChange,
|
|
237
256
|
onBlur: _onBlur,
|
|
238
257
|
onFocus: _onFocus,
|
|
239
|
-
"aria-describedby": (0,
|
|
258
|
+
"aria-describedby": (0, import_utils5.ariaDescribedByIds)(id, !!schema.examples)
|
|
240
259
|
}
|
|
241
260
|
),
|
|
242
|
-
options.allowClearTextInputs && !readonly && !disabled && value && /* @__PURE__ */ (0,
|
|
261
|
+
options.allowClearTextInputs && !readonly && !disabled && value && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ClearButton2, { registry, onClick: _onClear })
|
|
243
262
|
] });
|
|
244
263
|
}
|
|
245
264
|
|
|
246
265
|
// src/DescriptionField/DescriptionField.tsx
|
|
247
266
|
var import_core = require("@rjsf/core");
|
|
248
|
-
var
|
|
267
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
249
268
|
function DescriptionField(props) {
|
|
250
269
|
const { id, description, registry, uiSchema } = props;
|
|
251
270
|
if (!description) {
|
|
252
271
|
return null;
|
|
253
272
|
}
|
|
254
|
-
return /* @__PURE__ */ (0,
|
|
273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { id, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core.RichDescription, { description, registry, uiSchema }) });
|
|
255
274
|
}
|
|
256
275
|
|
|
257
276
|
// src/ErrorList/ErrorList.tsx
|
|
258
|
-
var
|
|
277
|
+
var import_utils6 = require("@rjsf/utils");
|
|
259
278
|
var import_timescircle = require("primereact/icons/timescircle");
|
|
260
|
-
var
|
|
261
|
-
var
|
|
279
|
+
var import_message = require("primereact/message");
|
|
280
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
262
281
|
function ErrorList({
|
|
263
282
|
errors,
|
|
264
283
|
registry
|
|
265
284
|
}) {
|
|
266
285
|
const { translateString } = registry;
|
|
267
|
-
const content = /* @__PURE__ */ (0,
|
|
268
|
-
/* @__PURE__ */ (0,
|
|
269
|
-
/* @__PURE__ */ (0,
|
|
270
|
-
/* @__PURE__ */ (0,
|
|
286
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: { display: "flex", flexDirection: "column" }, children: [
|
|
287
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: { display: "flex", flexDirection: "row", alignItems: "center", gap: "0.5rem" }, children: [
|
|
288
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_timescircle.TimesCircleIcon, { style: { width: "1.5rem", height: "1.5rem" } }),
|
|
289
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "p-message-summary", children: translateString(import_utils6.TranslatableString.ErrorsLabel) })
|
|
271
290
|
] }),
|
|
272
|
-
/* @__PURE__ */ (0,
|
|
291
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { className: "p-message-list", children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("li", { children: error.stack }, `error-${index}`)) })
|
|
273
292
|
] });
|
|
274
|
-
return /* @__PURE__ */ (0,
|
|
293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
275
294
|
import_message.Message,
|
|
276
295
|
{
|
|
277
296
|
className: "p-message",
|
|
@@ -289,45 +308,6 @@ function ErrorList({
|
|
|
289
308
|
);
|
|
290
309
|
}
|
|
291
310
|
|
|
292
|
-
// src/IconButton/IconButton.tsx
|
|
293
|
-
var import_button2 = require("primereact/button");
|
|
294
|
-
var import_utils6 = require("@rjsf/utils");
|
|
295
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
296
|
-
function IconButton(props) {
|
|
297
|
-
const { icon, iconType, uiSchema, registry, ...otherProps } = props;
|
|
298
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_button2.Button, { icon: `pi pi-${icon}`, rounded: true, text: true, severity: "secondary", ...otherProps });
|
|
299
|
-
}
|
|
300
|
-
function CopyButton(props) {
|
|
301
|
-
const {
|
|
302
|
-
registry: { translateString }
|
|
303
|
-
} = props;
|
|
304
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconButton, { title: translateString(import_utils6.TranslatableString.CopyButton), ...props, icon: "copy" });
|
|
305
|
-
}
|
|
306
|
-
function MoveDownButton(props) {
|
|
307
|
-
const {
|
|
308
|
-
registry: { translateString }
|
|
309
|
-
} = props;
|
|
310
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconButton, { title: translateString(import_utils6.TranslatableString.MoveDownButton), ...props, icon: "angle-down" });
|
|
311
|
-
}
|
|
312
|
-
function MoveUpButton(props) {
|
|
313
|
-
const {
|
|
314
|
-
registry: { translateString }
|
|
315
|
-
} = props;
|
|
316
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconButton, { title: translateString(import_utils6.TranslatableString.MoveUpButton), ...props, icon: "angle-up" });
|
|
317
|
-
}
|
|
318
|
-
function RemoveButton(props) {
|
|
319
|
-
const {
|
|
320
|
-
registry: { translateString }
|
|
321
|
-
} = props;
|
|
322
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconButton, { title: translateString(import_utils6.TranslatableString.RemoveButton), ...props, icon: "trash" });
|
|
323
|
-
}
|
|
324
|
-
function ClearButton(props) {
|
|
325
|
-
const {
|
|
326
|
-
registry: { translateString }
|
|
327
|
-
} = props;
|
|
328
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconButton, { title: translateString(import_utils6.TranslatableString.ClearButton), ...props, icon: "times" });
|
|
329
|
-
}
|
|
330
|
-
|
|
331
311
|
// src/FieldErrorTemplate/FieldErrorTemplate.tsx
|
|
332
312
|
var import_utils7 = require("@rjsf/utils");
|
|
333
313
|
var import_message2 = require("primereact/message");
|
|
@@ -353,8 +333,8 @@ function FieldErrorTemplate({ errors, fieldPathId }) {
|
|
|
353
333
|
}
|
|
354
334
|
|
|
355
335
|
// src/FieldHelpTemplate/FieldHelpTemplate.tsx
|
|
356
|
-
var import_utils8 = require("@rjsf/utils");
|
|
357
336
|
var import_core2 = require("@rjsf/core");
|
|
337
|
+
var import_utils8 = require("@rjsf/utils");
|
|
358
338
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
359
339
|
function FieldHelpTemplate(props) {
|
|
360
340
|
const { fieldPathId, help, uiSchema, registry } = props;
|
|
@@ -403,20 +383,128 @@ function FieldTemplate(props) {
|
|
|
403
383
|
] }) });
|
|
404
384
|
}
|
|
405
385
|
|
|
386
|
+
// src/GridTemplate/GridTemplate.tsx
|
|
387
|
+
var import_react2 = require("react");
|
|
388
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
389
|
+
var breakpoints = {
|
|
390
|
+
xs: 0,
|
|
391
|
+
sm: 576,
|
|
392
|
+
md: 768,
|
|
393
|
+
lg: 992,
|
|
394
|
+
xl: 1200
|
|
395
|
+
};
|
|
396
|
+
function getBreakpoint(width) {
|
|
397
|
+
if (width >= breakpoints.xl) {
|
|
398
|
+
return "xl";
|
|
399
|
+
}
|
|
400
|
+
if (width >= breakpoints.lg) {
|
|
401
|
+
return "lg";
|
|
402
|
+
}
|
|
403
|
+
if (width >= breakpoints.md) {
|
|
404
|
+
return "md";
|
|
405
|
+
}
|
|
406
|
+
if (width >= breakpoints.sm) {
|
|
407
|
+
return "sm";
|
|
408
|
+
}
|
|
409
|
+
return "xs";
|
|
410
|
+
}
|
|
411
|
+
function getResponsiveSpan(spanDef, breakpoint) {
|
|
412
|
+
return spanDef[breakpoint] ?? spanDef.xl ?? spanDef.lg ?? spanDef.md ?? spanDef.sm ?? spanDef.xs ?? 12;
|
|
413
|
+
}
|
|
414
|
+
function getInitialWidth() {
|
|
415
|
+
return typeof window !== "undefined" ? window.innerWidth : breakpoints.xs;
|
|
416
|
+
}
|
|
417
|
+
function GridTemplate(props) {
|
|
418
|
+
return props.column ? GridTemplateColumn(props) : GridTemplateRow(props);
|
|
419
|
+
}
|
|
420
|
+
function GridTemplateRow(props) {
|
|
421
|
+
const { children, column, uiSchema, style, ...rest } = props;
|
|
422
|
+
const layoutGrid = uiSchema?.["ui:layoutGrid"] ?? {};
|
|
423
|
+
const totalColumns = layoutGrid.columns ?? 12;
|
|
424
|
+
const gap = layoutGrid.gap ?? "16px";
|
|
425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
426
|
+
"div",
|
|
427
|
+
{
|
|
428
|
+
style: {
|
|
429
|
+
display: "grid",
|
|
430
|
+
gridTemplateColumns: `repeat(${totalColumns}, 1fr)`,
|
|
431
|
+
alignItems: "start",
|
|
432
|
+
gap,
|
|
433
|
+
...style ?? {}
|
|
434
|
+
},
|
|
435
|
+
...rest,
|
|
436
|
+
children
|
|
437
|
+
}
|
|
438
|
+
);
|
|
439
|
+
}
|
|
440
|
+
function GridTemplateColumn(props) {
|
|
441
|
+
const { children, column, uiSchema, xs, sm, md, lg, xl, style, ...rest } = props;
|
|
442
|
+
const [breakpoint, setBreakpoint] = (0, import_react2.useState)(() => getBreakpoint(getInitialWidth()));
|
|
443
|
+
(0, import_react2.useEffect)(() => {
|
|
444
|
+
if (typeof window === "undefined") {
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
const handleResize = () => setBreakpoint(getBreakpoint(window.innerWidth));
|
|
448
|
+
window.addEventListener("resize", handleResize);
|
|
449
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
450
|
+
}, []);
|
|
451
|
+
const span = getResponsiveSpan(props, breakpoint);
|
|
452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { gridColumn: `span ${span} / span ${span}`, ...style ?? {} }, ...rest, children });
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
// src/IconButton/IconButton.tsx
|
|
456
|
+
var import_utils10 = require("@rjsf/utils");
|
|
457
|
+
var import_button2 = require("primereact/button");
|
|
458
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
459
|
+
function IconButton(props) {
|
|
460
|
+
const { icon, iconType, uiSchema, registry, ...otherProps } = props;
|
|
461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_button2.Button, { icon: `pi pi-${icon}`, rounded: true, text: true, severity: "secondary", ...otherProps });
|
|
462
|
+
}
|
|
463
|
+
function CopyButton(props) {
|
|
464
|
+
const {
|
|
465
|
+
registry: { translateString }
|
|
466
|
+
} = props;
|
|
467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconButton, { title: translateString(import_utils10.TranslatableString.CopyButton), ...props, icon: "copy" });
|
|
468
|
+
}
|
|
469
|
+
function MoveDownButton(props) {
|
|
470
|
+
const {
|
|
471
|
+
registry: { translateString }
|
|
472
|
+
} = props;
|
|
473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconButton, { title: translateString(import_utils10.TranslatableString.MoveDownButton), ...props, icon: "angle-down" });
|
|
474
|
+
}
|
|
475
|
+
function MoveUpButton(props) {
|
|
476
|
+
const {
|
|
477
|
+
registry: { translateString }
|
|
478
|
+
} = props;
|
|
479
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconButton, { title: translateString(import_utils10.TranslatableString.MoveUpButton), ...props, icon: "angle-up" });
|
|
480
|
+
}
|
|
481
|
+
function RemoveButton(props) {
|
|
482
|
+
const {
|
|
483
|
+
registry: { translateString }
|
|
484
|
+
} = props;
|
|
485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconButton, { title: translateString(import_utils10.TranslatableString.RemoveButton), ...props, icon: "trash" });
|
|
486
|
+
}
|
|
487
|
+
function ClearButton(props) {
|
|
488
|
+
const {
|
|
489
|
+
registry: { translateString }
|
|
490
|
+
} = props;
|
|
491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconButton, { title: translateString(import_utils10.TranslatableString.ClearButton), ...props, icon: "times" });
|
|
492
|
+
}
|
|
493
|
+
|
|
406
494
|
// src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx
|
|
407
495
|
var import_fieldset2 = require("primereact/fieldset");
|
|
408
|
-
var
|
|
496
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
409
497
|
function MultiSchemaFieldTemplate(props) {
|
|
410
498
|
const { selector, optionSchemaField } = props;
|
|
411
|
-
return /* @__PURE__ */ (0,
|
|
412
|
-
/* @__PURE__ */ (0,
|
|
499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_fieldset2.Fieldset, { children: [
|
|
500
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { marginBottom: "1rem" }, children: selector }),
|
|
413
501
|
optionSchemaField
|
|
414
502
|
] });
|
|
415
503
|
}
|
|
416
504
|
|
|
417
505
|
// src/ObjectFieldTemplate/ObjectFieldTemplate.tsx
|
|
418
|
-
var
|
|
419
|
-
var
|
|
506
|
+
var import_utils11 = require("@rjsf/utils");
|
|
507
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
420
508
|
function ObjectFieldTemplate(props) {
|
|
421
509
|
const {
|
|
422
510
|
description,
|
|
@@ -433,9 +521,9 @@ function ObjectFieldTemplate(props) {
|
|
|
433
521
|
fieldPathId,
|
|
434
522
|
registry
|
|
435
523
|
} = props;
|
|
436
|
-
const uiOptions = (0,
|
|
437
|
-
const TitleFieldTemplate = (0,
|
|
438
|
-
const DescriptionFieldTemplate = (0,
|
|
524
|
+
const uiOptions = (0, import_utils11.getUiOptions)(uiSchema);
|
|
525
|
+
const TitleFieldTemplate = (0, import_utils11.getTemplate)("TitleFieldTemplate", registry, uiOptions);
|
|
526
|
+
const DescriptionFieldTemplate = (0, import_utils11.getTemplate)(
|
|
439
527
|
"DescriptionFieldTemplate",
|
|
440
528
|
registry,
|
|
441
529
|
uiOptions
|
|
@@ -444,11 +532,11 @@ function ObjectFieldTemplate(props) {
|
|
|
444
532
|
const {
|
|
445
533
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
446
534
|
} = registry.templates;
|
|
447
|
-
return /* @__PURE__ */ (0,
|
|
448
|
-
title && /* @__PURE__ */ (0,
|
|
535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
536
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
449
537
|
TitleFieldTemplate,
|
|
450
538
|
{
|
|
451
|
-
id: (0,
|
|
539
|
+
id: (0, import_utils11.titleId)(fieldPathId),
|
|
452
540
|
title,
|
|
453
541
|
required,
|
|
454
542
|
schema,
|
|
@@ -457,10 +545,10 @@ function ObjectFieldTemplate(props) {
|
|
|
457
545
|
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
458
546
|
}
|
|
459
547
|
),
|
|
460
|
-
description && /* @__PURE__ */ (0,
|
|
548
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { marginBottom: "1rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
461
549
|
DescriptionFieldTemplate,
|
|
462
550
|
{
|
|
463
|
-
id: (0,
|
|
551
|
+
id: (0, import_utils11.descriptionId)(fieldPathId),
|
|
464
552
|
description,
|
|
465
553
|
schema,
|
|
466
554
|
uiSchema,
|
|
@@ -469,10 +557,10 @@ function ObjectFieldTemplate(props) {
|
|
|
469
557
|
) }),
|
|
470
558
|
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
471
559
|
properties.map((prop) => prop.content),
|
|
472
|
-
(0,
|
|
560
|
+
(0, import_utils11.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { marginTop: "1rem", textAlign: "right" }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
473
561
|
AddButton2,
|
|
474
562
|
{
|
|
475
|
-
id: (0,
|
|
563
|
+
id: (0, import_utils11.buttonId)(fieldPathId, "add"),
|
|
476
564
|
className: "rjsf-object-property-expand",
|
|
477
565
|
icon: "pi pi-plus",
|
|
478
566
|
onClick: onAddProperty,
|
|
@@ -484,11 +572,11 @@ function ObjectFieldTemplate(props) {
|
|
|
484
572
|
}
|
|
485
573
|
|
|
486
574
|
// src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx
|
|
487
|
-
var
|
|
575
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
488
576
|
function OptionalDataControlsTemplate(props) {
|
|
489
577
|
const { id, registry, label, onAddClick, onRemoveClick } = props;
|
|
490
578
|
if (onAddClick) {
|
|
491
|
-
return /* @__PURE__ */ (0,
|
|
579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
492
580
|
IconButton,
|
|
493
581
|
{
|
|
494
582
|
id,
|
|
@@ -501,7 +589,7 @@ function OptionalDataControlsTemplate(props) {
|
|
|
501
589
|
}
|
|
502
590
|
);
|
|
503
591
|
} else if (onRemoveClick) {
|
|
504
|
-
return /* @__PURE__ */ (0,
|
|
592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
505
593
|
RemoveButton,
|
|
506
594
|
{
|
|
507
595
|
id,
|
|
@@ -513,25 +601,25 @@ function OptionalDataControlsTemplate(props) {
|
|
|
513
601
|
}
|
|
514
602
|
);
|
|
515
603
|
}
|
|
516
|
-
return /* @__PURE__ */ (0,
|
|
604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("em", { id, children: label });
|
|
517
605
|
}
|
|
518
606
|
|
|
519
607
|
// src/SubmitButton/SubmitButton.tsx
|
|
608
|
+
var import_utils12 = require("@rjsf/utils");
|
|
520
609
|
var import_button3 = require("primereact/button");
|
|
521
|
-
var
|
|
522
|
-
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
610
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
523
611
|
function SubmitButton({ uiSchema }) {
|
|
524
|
-
const { submitText, norender, props: submitButtonProps = {} } = (0,
|
|
612
|
+
const { submitText, norender, props: submitButtonProps = {} } = (0, import_utils12.getSubmitButtonOptions)(uiSchema);
|
|
525
613
|
if (norender) {
|
|
526
614
|
return null;
|
|
527
615
|
}
|
|
528
|
-
return /* @__PURE__ */ (0,
|
|
616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_button3.Button, { type: "submit", label: submitText, ...submitButtonProps });
|
|
529
617
|
}
|
|
530
618
|
|
|
531
619
|
// src/TitleField/TitleField.tsx
|
|
620
|
+
var import_utils13 = require("@rjsf/utils");
|
|
532
621
|
var import_divider = require("primereact/divider");
|
|
533
|
-
var
|
|
534
|
-
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
622
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
535
623
|
function TitleField({
|
|
536
624
|
id,
|
|
537
625
|
title,
|
|
@@ -539,28 +627,28 @@ function TitleField({
|
|
|
539
627
|
required,
|
|
540
628
|
optionalDataControl
|
|
541
629
|
}) {
|
|
542
|
-
const uiOptions = (0,
|
|
543
|
-
let heading = /* @__PURE__ */ (0,
|
|
630
|
+
const uiOptions = (0, import_utils13.getUiOptions)(uiSchema);
|
|
631
|
+
let heading = /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("h5", { style: { margin: 0, fontSize: id === (0, import_utils13.titleId)("root") ? "1.5rem" : "1.2rem" }, children: [
|
|
544
632
|
uiOptions.title || title,
|
|
545
633
|
" ",
|
|
546
634
|
required ? "*" : ""
|
|
547
635
|
] });
|
|
548
636
|
if (optionalDataControl) {
|
|
549
|
-
heading = /* @__PURE__ */ (0,
|
|
550
|
-
/* @__PURE__ */ (0,
|
|
551
|
-
/* @__PURE__ */ (0,
|
|
637
|
+
heading = /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: { display: "flex" }, children: [
|
|
638
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { flexGrow: 1 }, children: heading }),
|
|
639
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { marginLeft: "-5px" }, children: optionalDataControl })
|
|
552
640
|
] });
|
|
553
641
|
}
|
|
554
|
-
return /* @__PURE__ */ (0,
|
|
642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { id, children: [
|
|
555
643
|
heading,
|
|
556
|
-
/* @__PURE__ */ (0,
|
|
644
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_divider.Divider, { pt: { root: { style: { marginTop: "0.5rem" } } } })
|
|
557
645
|
] });
|
|
558
646
|
}
|
|
559
647
|
|
|
560
648
|
// src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx
|
|
561
|
-
var
|
|
649
|
+
var import_utils14 = require("@rjsf/utils");
|
|
562
650
|
var import_inputtext2 = require("primereact/inputtext");
|
|
563
|
-
var
|
|
651
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
564
652
|
function WrapIfAdditionalTemplate({
|
|
565
653
|
classNames,
|
|
566
654
|
style,
|
|
@@ -579,22 +667,22 @@ function WrapIfAdditionalTemplate({
|
|
|
579
667
|
}) {
|
|
580
668
|
const { templates, translateString } = registry;
|
|
581
669
|
const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
|
|
582
|
-
const keyLabel = translateString(
|
|
583
|
-
const additional =
|
|
670
|
+
const keyLabel = translateString(import_utils14.TranslatableString.KeyLabel, [label]);
|
|
671
|
+
const additional = import_utils14.ADDITIONAL_PROPERTY_FLAG in schema;
|
|
584
672
|
const hasDescription = !!rawDescription;
|
|
585
673
|
const margin = hasDescription ? -8 : 12;
|
|
586
674
|
if (!additional) {
|
|
587
|
-
return /* @__PURE__ */ (0,
|
|
675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: classNames, style, children });
|
|
588
676
|
}
|
|
589
|
-
return /* @__PURE__ */ (0,
|
|
677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
590
678
|
"div",
|
|
591
679
|
{
|
|
592
680
|
className: classNames,
|
|
593
681
|
style: { ...style, display: "flex", alignItems: "flex-start", gap: "1rem" },
|
|
594
682
|
children: [
|
|
595
|
-
/* @__PURE__ */ (0,
|
|
596
|
-
displayLabel && /* @__PURE__ */ (0,
|
|
597
|
-
/* @__PURE__ */ (0,
|
|
683
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { style: { flex: 1 }, children: [
|
|
684
|
+
displayLabel && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("label", { htmlFor: `${id}-key`, style: { display: "block", marginBottom: "0.5rem" }, children: keyLabel }),
|
|
685
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
598
686
|
import_inputtext2.InputText,
|
|
599
687
|
{
|
|
600
688
|
id: `${id}-key`,
|
|
@@ -608,11 +696,11 @@ function WrapIfAdditionalTemplate({
|
|
|
608
696
|
label
|
|
609
697
|
)
|
|
610
698
|
] }),
|
|
611
|
-
/* @__PURE__ */ (0,
|
|
612
|
-
/* @__PURE__ */ (0,
|
|
699
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: { flex: 1 }, children }),
|
|
700
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: displayLabel ? { alignSelf: "center", marginTop: `${margin}px` } : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
613
701
|
RemoveButton2,
|
|
614
702
|
{
|
|
615
|
-
id: (0,
|
|
703
|
+
id: (0, import_utils14.buttonId)(id, "remove"),
|
|
616
704
|
className: "rjsf-object-property-remove",
|
|
617
705
|
disabled: disabled || readonly,
|
|
618
706
|
onClick: onRemoveProperty,
|
|
@@ -625,94 +713,6 @@ function WrapIfAdditionalTemplate({
|
|
|
625
713
|
);
|
|
626
714
|
}
|
|
627
715
|
|
|
628
|
-
// src/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.tsx
|
|
629
|
-
var import_utils14 = require("@rjsf/utils");
|
|
630
|
-
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
631
|
-
function ArrayFieldTitleTemplate({ title, uiSchema, required, fieldPathId, optionalDataControl }) {
|
|
632
|
-
const uiOptions = (0, import_utils14.getUiOptions)(uiSchema);
|
|
633
|
-
let heading = /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("h5", { id: (0, import_utils14.titleId)(fieldPathId), style: { margin: 0, fontSize: "1.5rem", marginBottom: "0.2rem" }, children: [
|
|
634
|
-
uiOptions.title || title,
|
|
635
|
-
" ",
|
|
636
|
-
required ? "*" : ""
|
|
637
|
-
] });
|
|
638
|
-
if (optionalDataControl) {
|
|
639
|
-
heading = /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: { display: "flex" }, children: [
|
|
640
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { flexGrow: 1 }, children: heading }),
|
|
641
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { children: optionalDataControl })
|
|
642
|
-
] });
|
|
643
|
-
}
|
|
644
|
-
return heading;
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
// src/GridTemplate/GridTemplate.tsx
|
|
648
|
-
var import_react2 = require("react");
|
|
649
|
-
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
650
|
-
var breakpoints = {
|
|
651
|
-
xs: 0,
|
|
652
|
-
sm: 576,
|
|
653
|
-
md: 768,
|
|
654
|
-
lg: 992,
|
|
655
|
-
xl: 1200
|
|
656
|
-
};
|
|
657
|
-
function getBreakpoint(width) {
|
|
658
|
-
if (width >= breakpoints.xl) {
|
|
659
|
-
return "xl";
|
|
660
|
-
}
|
|
661
|
-
if (width >= breakpoints.lg) {
|
|
662
|
-
return "lg";
|
|
663
|
-
}
|
|
664
|
-
if (width >= breakpoints.md) {
|
|
665
|
-
return "md";
|
|
666
|
-
}
|
|
667
|
-
if (width >= breakpoints.sm) {
|
|
668
|
-
return "sm";
|
|
669
|
-
}
|
|
670
|
-
return "xs";
|
|
671
|
-
}
|
|
672
|
-
function getResponsiveSpan(spanDef, breakpoint) {
|
|
673
|
-
return spanDef[breakpoint] ?? spanDef.xl ?? spanDef.lg ?? spanDef.md ?? spanDef.sm ?? spanDef.xs ?? 12;
|
|
674
|
-
}
|
|
675
|
-
function getInitialWidth() {
|
|
676
|
-
return typeof window !== "undefined" ? window.innerWidth : breakpoints.xs;
|
|
677
|
-
}
|
|
678
|
-
function GridTemplate(props) {
|
|
679
|
-
return props.column ? GridTemplateColumn(props) : GridTemplateRow(props);
|
|
680
|
-
}
|
|
681
|
-
function GridTemplateRow(props) {
|
|
682
|
-
const { children, column, uiSchema, style, ...rest } = props;
|
|
683
|
-
const layoutGrid = uiSchema?.["ui:layoutGrid"] ?? {};
|
|
684
|
-
const totalColumns = layoutGrid.columns ?? 12;
|
|
685
|
-
const gap = layoutGrid.gap ?? "16px";
|
|
686
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
687
|
-
"div",
|
|
688
|
-
{
|
|
689
|
-
style: {
|
|
690
|
-
display: "grid",
|
|
691
|
-
gridTemplateColumns: `repeat(${totalColumns}, 1fr)`,
|
|
692
|
-
alignItems: "start",
|
|
693
|
-
gap,
|
|
694
|
-
...style ?? {}
|
|
695
|
-
},
|
|
696
|
-
...rest,
|
|
697
|
-
children
|
|
698
|
-
}
|
|
699
|
-
);
|
|
700
|
-
}
|
|
701
|
-
function GridTemplateColumn(props) {
|
|
702
|
-
const { children, column, uiSchema, xs, sm, md, lg, xl, style, ...rest } = props;
|
|
703
|
-
const [breakpoint, setBreakpoint] = (0, import_react2.useState)(() => getBreakpoint(getInitialWidth()));
|
|
704
|
-
(0, import_react2.useEffect)(() => {
|
|
705
|
-
if (typeof window === "undefined") {
|
|
706
|
-
return;
|
|
707
|
-
}
|
|
708
|
-
const handleResize = () => setBreakpoint(getBreakpoint(window.innerWidth));
|
|
709
|
-
window.addEventListener("resize", handleResize);
|
|
710
|
-
return () => window.removeEventListener("resize", handleResize);
|
|
711
|
-
}, []);
|
|
712
|
-
const span = getResponsiveSpan(props, breakpoint);
|
|
713
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: { gridColumn: `span ${span} / span ${span}`, ...style ?? {} }, ...rest, children });
|
|
714
|
-
}
|
|
715
|
-
|
|
716
716
|
// src/Templates/Templates.ts
|
|
717
717
|
function generateTemplates() {
|
|
718
718
|
return {
|
|
@@ -819,77 +819,10 @@ function AutoCompleteWidget(props) {
|
|
|
819
819
|
);
|
|
820
820
|
}
|
|
821
821
|
|
|
822
|
-
// src/
|
|
822
|
+
// src/CheckboxesWidget/CheckboxesWidget.tsx
|
|
823
823
|
var import_utils16 = require("@rjsf/utils");
|
|
824
824
|
var import_checkbox = require("primereact/checkbox");
|
|
825
825
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
826
|
-
function CheckboxWidget(props) {
|
|
827
|
-
const {
|
|
828
|
-
id,
|
|
829
|
-
htmlName,
|
|
830
|
-
value,
|
|
831
|
-
disabled,
|
|
832
|
-
readonly,
|
|
833
|
-
label = "",
|
|
834
|
-
hideLabel,
|
|
835
|
-
autofocus,
|
|
836
|
-
onChange,
|
|
837
|
-
onBlur,
|
|
838
|
-
options,
|
|
839
|
-
onFocus,
|
|
840
|
-
schema,
|
|
841
|
-
uiSchema,
|
|
842
|
-
registry
|
|
843
|
-
} = props;
|
|
844
|
-
const DescriptionFieldTemplate = (0, import_utils16.getTemplate)(
|
|
845
|
-
"DescriptionFieldTemplate",
|
|
846
|
-
registry,
|
|
847
|
-
options
|
|
848
|
-
);
|
|
849
|
-
const required = (0, import_utils16.schemaRequiresTrueValue)(schema);
|
|
850
|
-
const checked = value === "true" || value === true;
|
|
851
|
-
const _onChange = (e) => onChange && onChange(e.checked);
|
|
852
|
-
const _onBlur = () => onBlur && onBlur(id, value);
|
|
853
|
-
const _onFocus = () => onFocus && onFocus(id, value);
|
|
854
|
-
const description = options.description ?? schema.description;
|
|
855
|
-
const primeProps = options.prime || {};
|
|
856
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
857
|
-
!hideLabel && !!description && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
858
|
-
DescriptionFieldTemplate,
|
|
859
|
-
{
|
|
860
|
-
id: (0, import_utils16.descriptionId)(id),
|
|
861
|
-
description,
|
|
862
|
-
schema,
|
|
863
|
-
uiSchema,
|
|
864
|
-
registry
|
|
865
|
-
}
|
|
866
|
-
),
|
|
867
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { display: "flex", flexDirection: "row", gap: "0.5rem", alignItems: "center" }, children: [
|
|
868
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
869
|
-
import_checkbox.Checkbox,
|
|
870
|
-
{
|
|
871
|
-
inputId: id,
|
|
872
|
-
name: htmlName || id,
|
|
873
|
-
...primeProps,
|
|
874
|
-
disabled: disabled || readonly,
|
|
875
|
-
autoFocus: autofocus,
|
|
876
|
-
checked: typeof value === "undefined" ? false : checked,
|
|
877
|
-
onChange: _onChange,
|
|
878
|
-
onBlur: _onBlur,
|
|
879
|
-
onFocus: _onFocus,
|
|
880
|
-
required,
|
|
881
|
-
"aria-describedby": (0, import_utils16.ariaDescribedByIds)(id)
|
|
882
|
-
}
|
|
883
|
-
),
|
|
884
|
-
(0, import_utils16.labelValue)(/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Label, { id, text: label }), hideLabel, false)
|
|
885
|
-
] })
|
|
886
|
-
] });
|
|
887
|
-
}
|
|
888
|
-
|
|
889
|
-
// src/CheckboxesWidget/CheckboxesWidget.tsx
|
|
890
|
-
var import_checkbox2 = require("primereact/checkbox");
|
|
891
|
-
var import_utils17 = require("@rjsf/utils");
|
|
892
|
-
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
893
826
|
function CheckboxesWidget(props) {
|
|
894
827
|
const {
|
|
895
828
|
id,
|
|
@@ -912,12 +845,12 @@ function CheckboxesWidget(props) {
|
|
|
912
845
|
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
913
846
|
const _onChange = (index) => (e) => {
|
|
914
847
|
if (e.checked) {
|
|
915
|
-
onChange((0,
|
|
848
|
+
onChange((0, import_utils16.enumOptionsSelectValue)(index, checkboxesValues, enumOptions));
|
|
916
849
|
} else {
|
|
917
|
-
onChange((0,
|
|
850
|
+
onChange((0, import_utils16.enumOptionsDeselectValue)(index, checkboxesValues, enumOptions));
|
|
918
851
|
}
|
|
919
852
|
};
|
|
920
|
-
const DescriptionFieldTemplate = (0,
|
|
853
|
+
const DescriptionFieldTemplate = (0, import_utils16.getTemplate)(
|
|
921
854
|
"DescriptionFieldTemplate",
|
|
922
855
|
registry,
|
|
923
856
|
options
|
|
@@ -925,16 +858,16 @@ function CheckboxesWidget(props) {
|
|
|
925
858
|
const _onBlur = () => onBlur(id, value);
|
|
926
859
|
const _onFocus = () => onFocus(id, value);
|
|
927
860
|
const description = options.description ?? schema.description;
|
|
928
|
-
return /* @__PURE__ */ (0,
|
|
861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
929
862
|
"div",
|
|
930
863
|
{
|
|
931
864
|
id,
|
|
932
865
|
style: { display: "flex", flexDirection: "column", gap: "1rem", marginTop: "0.5rem", marginBottom: "0.5rem" },
|
|
933
866
|
children: [
|
|
934
|
-
!hideLabel && !!description && /* @__PURE__ */ (0,
|
|
867
|
+
!hideLabel && !!description && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
935
868
|
DescriptionFieldTemplate,
|
|
936
869
|
{
|
|
937
|
-
id: (0,
|
|
870
|
+
id: (0, import_utils16.descriptionId)(id),
|
|
938
871
|
description,
|
|
939
872
|
schema,
|
|
940
873
|
uiSchema,
|
|
@@ -942,13 +875,13 @@ function CheckboxesWidget(props) {
|
|
|
942
875
|
}
|
|
943
876
|
),
|
|
944
877
|
Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
945
|
-
const checked = (0,
|
|
878
|
+
const checked = (0, import_utils16.enumOptionsIsSelected)(option.value, checkboxesValues);
|
|
946
879
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
947
|
-
return /* @__PURE__ */ (0,
|
|
948
|
-
/* @__PURE__ */ (0,
|
|
949
|
-
|
|
880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { display: "flex", flexDirection: "row", gap: "0.5rem", alignItems: "center" }, children: [
|
|
881
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
882
|
+
import_checkbox.Checkbox,
|
|
950
883
|
{
|
|
951
|
-
inputId: (0,
|
|
884
|
+
inputId: (0, import_utils16.optionId)(id, index),
|
|
952
885
|
name: htmlName || id,
|
|
953
886
|
...primeProps,
|
|
954
887
|
value: option.value,
|
|
@@ -958,10 +891,10 @@ function CheckboxesWidget(props) {
|
|
|
958
891
|
onChange: _onChange(index),
|
|
959
892
|
onBlur: _onBlur,
|
|
960
893
|
onFocus: _onFocus,
|
|
961
|
-
"aria-describedby": (0,
|
|
894
|
+
"aria-describedby": (0, import_utils16.ariaDescribedByIds)(id)
|
|
962
895
|
}
|
|
963
896
|
),
|
|
964
|
-
/* @__PURE__ */ (0,
|
|
897
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Label, { id: (0, import_utils16.optionId)(id, index), text: option.label })
|
|
965
898
|
] }, index);
|
|
966
899
|
})
|
|
967
900
|
]
|
|
@@ -969,6 +902,73 @@ function CheckboxesWidget(props) {
|
|
|
969
902
|
);
|
|
970
903
|
}
|
|
971
904
|
|
|
905
|
+
// src/CheckboxWidget/CheckboxWidget.tsx
|
|
906
|
+
var import_utils17 = require("@rjsf/utils");
|
|
907
|
+
var import_checkbox2 = require("primereact/checkbox");
|
|
908
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
909
|
+
function CheckboxWidget(props) {
|
|
910
|
+
const {
|
|
911
|
+
id,
|
|
912
|
+
htmlName,
|
|
913
|
+
value,
|
|
914
|
+
disabled,
|
|
915
|
+
readonly,
|
|
916
|
+
label = "",
|
|
917
|
+
hideLabel,
|
|
918
|
+
autofocus,
|
|
919
|
+
onChange,
|
|
920
|
+
onBlur,
|
|
921
|
+
options,
|
|
922
|
+
onFocus,
|
|
923
|
+
schema,
|
|
924
|
+
uiSchema,
|
|
925
|
+
registry
|
|
926
|
+
} = props;
|
|
927
|
+
const DescriptionFieldTemplate = (0, import_utils17.getTemplate)(
|
|
928
|
+
"DescriptionFieldTemplate",
|
|
929
|
+
registry,
|
|
930
|
+
options
|
|
931
|
+
);
|
|
932
|
+
const required = (0, import_utils17.schemaRequiresTrueValue)(schema);
|
|
933
|
+
const checked = value === "true" || value === true;
|
|
934
|
+
const _onChange = (e) => onChange && onChange(e.checked);
|
|
935
|
+
const _onBlur = () => onBlur && onBlur(id, value);
|
|
936
|
+
const _onFocus = () => onFocus && onFocus(id, value);
|
|
937
|
+
const description = options.description ?? schema.description;
|
|
938
|
+
const primeProps = options.prime || {};
|
|
939
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
940
|
+
!hideLabel && !!description && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
941
|
+
DescriptionFieldTemplate,
|
|
942
|
+
{
|
|
943
|
+
id: (0, import_utils17.descriptionId)(id),
|
|
944
|
+
description,
|
|
945
|
+
schema,
|
|
946
|
+
uiSchema,
|
|
947
|
+
registry
|
|
948
|
+
}
|
|
949
|
+
),
|
|
950
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", flexDirection: "row", gap: "0.5rem", alignItems: "center" }, children: [
|
|
951
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
952
|
+
import_checkbox2.Checkbox,
|
|
953
|
+
{
|
|
954
|
+
inputId: id,
|
|
955
|
+
name: htmlName || id,
|
|
956
|
+
...primeProps,
|
|
957
|
+
disabled: disabled || readonly,
|
|
958
|
+
autoFocus: autofocus,
|
|
959
|
+
checked: typeof value === "undefined" ? false : checked,
|
|
960
|
+
onChange: _onChange,
|
|
961
|
+
onBlur: _onBlur,
|
|
962
|
+
onFocus: _onFocus,
|
|
963
|
+
required,
|
|
964
|
+
"aria-describedby": (0, import_utils17.ariaDescribedByIds)(id)
|
|
965
|
+
}
|
|
966
|
+
),
|
|
967
|
+
(0, import_utils17.labelValue)(/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Label, { id, text: label }), hideLabel, false)
|
|
968
|
+
] })
|
|
969
|
+
] });
|
|
970
|
+
}
|
|
971
|
+
|
|
972
972
|
// src/ColorWidget/ColorWidget.tsx
|
|
973
973
|
var import_utils18 = require("@rjsf/utils");
|
|
974
974
|
var import_colorpicker = require("primereact/colorpicker");
|
|
@@ -1105,8 +1105,8 @@ function RadioWidget(props) {
|
|
|
1105
1105
|
}
|
|
1106
1106
|
|
|
1107
1107
|
// src/RangeWidget/RangeWidget.tsx
|
|
1108
|
-
var import_slider = require("primereact/slider");
|
|
1109
1108
|
var import_utils21 = require("@rjsf/utils");
|
|
1109
|
+
var import_slider = require("primereact/slider");
|
|
1110
1110
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1111
1111
|
function RangeWidget(props) {
|
|
1112
1112
|
const { value, readonly, disabled, onBlur, onFocus, options, schema, onChange, id } = props;
|
|
@@ -1133,8 +1133,8 @@ function RangeWidget(props) {
|
|
|
1133
1133
|
}
|
|
1134
1134
|
|
|
1135
1135
|
// src/SelectWidget/SelectWidget.tsx
|
|
1136
|
-
var import_dropdown = require("primereact/dropdown");
|
|
1137
1136
|
var import_utils22 = require("@rjsf/utils");
|
|
1137
|
+
var import_dropdown = require("primereact/dropdown");
|
|
1138
1138
|
var import_multiselect = require("primereact/multiselect");
|
|
1139
1139
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1140
1140
|
function SelectWidget(props) {
|