@rjsf/primereact 6.5.3 → 6.6.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.
Files changed (50) hide show
  1. package/dist/index.cjs +276 -276
  2. package/dist/index.cjs.map +4 -4
  3. package/dist/primereact.esm.js +279 -279
  4. package/dist/primereact.esm.js.map +4 -4
  5. package/dist/primereact.umd.js +180 -180
  6. package/lib/AddButton/AddButton.js +1 -1
  7. package/lib/AddButton/AddButton.js.map +1 -1
  8. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
  9. package/lib/CheckboxesWidget/CheckboxesWidget.js +1 -1
  10. package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
  11. package/lib/DescriptionField/DescriptionField.js.map +1 -1
  12. package/lib/ErrorList/ErrorList.js +2 -2
  13. package/lib/ErrorList/ErrorList.js.map +1 -1
  14. package/lib/FieldHelpTemplate/FieldHelpTemplate.js +1 -1
  15. package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -1
  16. package/lib/IconButton/IconButton.d.ts +1 -1
  17. package/lib/IconButton/IconButton.js +1 -1
  18. package/lib/IconButton/IconButton.js.map +1 -1
  19. package/lib/RangeWidget/RangeWidget.js +1 -1
  20. package/lib/RangeWidget/RangeWidget.js.map +1 -1
  21. package/lib/SelectWidget/SelectWidget.js +1 -1
  22. package/lib/SelectWidget/SelectWidget.js.map +1 -1
  23. package/lib/SubmitButton/SubmitButton.js +1 -1
  24. package/lib/SubmitButton/SubmitButton.js.map +1 -1
  25. package/lib/Templates/Templates.js +3 -3
  26. package/lib/Templates/Templates.js.map +1 -1
  27. package/lib/TextareaWidget/TextareaWidget.js.map +1 -1
  28. package/lib/Theme/Theme.d.ts +1 -1
  29. package/lib/TitleField/TitleField.js +1 -1
  30. package/lib/TitleField/TitleField.js.map +1 -1
  31. package/lib/Widgets/Widgets.js +1 -1
  32. package/lib/Widgets/Widgets.js.map +1 -1
  33. package/lib/tsconfig.tsbuildinfo +1 -1
  34. package/package.json +16 -16
  35. package/src/AddButton/AddButton.tsx +1 -1
  36. package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +1 -0
  37. package/src/CheckboxesWidget/CheckboxesWidget.tsx +1 -1
  38. package/src/DescriptionField/DescriptionField.tsx +1 -1
  39. package/src/ErrorList/ErrorList.tsx +2 -2
  40. package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +1 -1
  41. package/src/IconButton/IconButton.tsx +1 -1
  42. package/src/RangeWidget/RangeWidget.tsx +1 -1
  43. package/src/SelectWidget/SelectWidget.tsx +1 -1
  44. package/src/SubmitButton/SubmitButton.tsx +1 -1
  45. package/src/Templates/Templates.ts +3 -3
  46. package/src/TextareaWidget/TextareaWidget.tsx +1 -1
  47. package/src/Theme/Theme.ts +1 -1
  48. package/src/TitleField/TitleField.tsx +1 -1
  49. package/src/Widgets/Widgets.tsx +1 -1
  50. package/src/tsconfig.json +0 -1
@@ -2,8 +2,8 @@
2
2
  import { withTheme } from "@rjsf/core";
3
3
 
4
4
  // src/AddButton/AddButton.tsx
5
- import { Button } from "primereact/button";
6
5
  import { TranslatableString } from "@rjsf/utils";
6
+ import { Button } from "primereact/button";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
  function AddButton({
9
9
  uiSchema,
@@ -149,6 +149,28 @@ function ArrayFieldTemplate(props) {
149
149
  ] });
150
150
  }
151
151
 
152
+ // src/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.tsx
153
+ import {
154
+ getUiOptions as getUiOptions3,
155
+ titleId
156
+ } from "@rjsf/utils";
157
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
158
+ function ArrayFieldTitleTemplate({ title, uiSchema, required, fieldPathId, optionalDataControl }) {
159
+ const uiOptions = getUiOptions3(uiSchema);
160
+ let heading = /* @__PURE__ */ jsxs3("h5", { id: titleId(fieldPathId), style: { margin: 0, fontSize: "1.5rem", marginBottom: "0.2rem" }, children: [
161
+ uiOptions.title || title,
162
+ " ",
163
+ required ? "*" : ""
164
+ ] });
165
+ if (optionalDataControl) {
166
+ heading = /* @__PURE__ */ jsxs3("div", { style: { display: "flex" }, children: [
167
+ /* @__PURE__ */ jsx4("div", { style: { flexGrow: 1 }, children: heading }),
168
+ /* @__PURE__ */ jsx4("div", { children: optionalDataControl })
169
+ ] });
170
+ }
171
+ return heading;
172
+ }
173
+
152
174
  // src/BaseInputTemplate/BaseInputTemplate.tsx
153
175
  import { useCallback } from "react";
154
176
  import {
@@ -157,7 +179,7 @@ import {
157
179
  getInputProps
158
180
  } from "@rjsf/utils";
159
181
  import { InputText } from "primereact/inputtext";
160
- import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
182
+ import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
161
183
  function BaseInputTemplate(props) {
162
184
  const {
163
185
  id,
@@ -194,10 +216,10 @@ function BaseInputTemplate(props) {
194
216
  [onChange, options.emptyValue]
195
217
  );
196
218
  if (Array.isArray(schema.examples)) {
197
- return /* @__PURE__ */ jsx4(AutoCompleteWidget2, { ...props });
219
+ return /* @__PURE__ */ jsx5(AutoCompleteWidget2, { ...props });
198
220
  }
199
- return /* @__PURE__ */ jsxs3(Fragment2, { children: [
200
- /* @__PURE__ */ jsx4(
221
+ return /* @__PURE__ */ jsxs4(Fragment2, { children: [
222
+ /* @__PURE__ */ jsx5(
201
223
  InputText,
202
224
  {
203
225
  id,
@@ -217,39 +239,39 @@ function BaseInputTemplate(props) {
217
239
  "aria-describedby": ariaDescribedByIds(id, !!schema.examples)
218
240
  }
219
241
  ),
220
- options.allowClearTextInputs && !readonly && !disabled && value && /* @__PURE__ */ jsx4(ClearButton2, { registry, onClick: _onClear })
242
+ options.allowClearTextInputs && !readonly && !disabled && value && /* @__PURE__ */ jsx5(ClearButton2, { registry, onClick: _onClear })
221
243
  ] });
222
244
  }
223
245
 
224
246
  // src/DescriptionField/DescriptionField.tsx
225
247
  import { RichDescription } from "@rjsf/core";
226
- import { jsx as jsx5 } from "react/jsx-runtime";
248
+ import { jsx as jsx6 } from "react/jsx-runtime";
227
249
  function DescriptionField(props) {
228
250
  const { id, description, registry, uiSchema } = props;
229
251
  if (!description) {
230
252
  return null;
231
253
  }
232
- return /* @__PURE__ */ jsx5("span", { id, children: /* @__PURE__ */ jsx5(RichDescription, { description, registry, uiSchema }) });
254
+ return /* @__PURE__ */ jsx6("span", { id, children: /* @__PURE__ */ jsx6(RichDescription, { description, registry, uiSchema }) });
233
255
  }
234
256
 
235
257
  // src/ErrorList/ErrorList.tsx
236
- import { Message } from "primereact/message";
237
- import { TimesCircleIcon } from "primereact/icons/timescircle";
238
258
  import { TranslatableString as TranslatableString2 } from "@rjsf/utils";
239
- import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
259
+ import { TimesCircleIcon } from "primereact/icons/timescircle";
260
+ import { Message } from "primereact/message";
261
+ import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
240
262
  function ErrorList({
241
263
  errors,
242
264
  registry
243
265
  }) {
244
266
  const { translateString } = registry;
245
- const content = /* @__PURE__ */ jsxs4("div", { style: { display: "flex", flexDirection: "column" }, children: [
246
- /* @__PURE__ */ jsxs4("div", { style: { display: "flex", flexDirection: "row", alignItems: "center", gap: "0.5rem" }, children: [
247
- /* @__PURE__ */ jsx6(TimesCircleIcon, { style: { width: "1.5rem", height: "1.5rem" } }),
248
- /* @__PURE__ */ jsx6("div", { className: "p-message-summary", children: translateString(TranslatableString2.ErrorsLabel) })
267
+ const content = /* @__PURE__ */ jsxs5("div", { style: { display: "flex", flexDirection: "column" }, children: [
268
+ /* @__PURE__ */ jsxs5("div", { style: { display: "flex", flexDirection: "row", alignItems: "center", gap: "0.5rem" }, children: [
269
+ /* @__PURE__ */ jsx7(TimesCircleIcon, { style: { width: "1.5rem", height: "1.5rem" } }),
270
+ /* @__PURE__ */ jsx7("div", { className: "p-message-summary", children: translateString(TranslatableString2.ErrorsLabel) })
249
271
  ] }),
250
- /* @__PURE__ */ jsx6("ul", { className: "p-message-list", children: errors.map((error, index) => /* @__PURE__ */ jsx6("li", { children: error.stack }, `error-${index}`)) })
272
+ /* @__PURE__ */ jsx7("ul", { className: "p-message-list", children: errors.map((error, index) => /* @__PURE__ */ jsx7("li", { children: error.stack }, `error-${index}`)) })
251
273
  ] });
252
- return /* @__PURE__ */ jsx6(
274
+ return /* @__PURE__ */ jsx7(
253
275
  Message,
254
276
  {
255
277
  className: "p-message",
@@ -267,45 +289,6 @@ function ErrorList({
267
289
  );
268
290
  }
269
291
 
270
- // src/IconButton/IconButton.tsx
271
- import { Button as Button2 } from "primereact/button";
272
- import { TranslatableString as TranslatableString3 } from "@rjsf/utils";
273
- import { jsx as jsx7 } from "react/jsx-runtime";
274
- function IconButton(props) {
275
- const { icon, iconType, uiSchema, registry, ...otherProps } = props;
276
- return /* @__PURE__ */ jsx7(Button2, { icon: `pi pi-${icon}`, rounded: true, text: true, severity: "secondary", ...otherProps });
277
- }
278
- function CopyButton(props) {
279
- const {
280
- registry: { translateString }
281
- } = props;
282
- return /* @__PURE__ */ jsx7(IconButton, { title: translateString(TranslatableString3.CopyButton), ...props, icon: "copy" });
283
- }
284
- function MoveDownButton(props) {
285
- const {
286
- registry: { translateString }
287
- } = props;
288
- return /* @__PURE__ */ jsx7(IconButton, { title: translateString(TranslatableString3.MoveDownButton), ...props, icon: "angle-down" });
289
- }
290
- function MoveUpButton(props) {
291
- const {
292
- registry: { translateString }
293
- } = props;
294
- return /* @__PURE__ */ jsx7(IconButton, { title: translateString(TranslatableString3.MoveUpButton), ...props, icon: "angle-up" });
295
- }
296
- function RemoveButton(props) {
297
- const {
298
- registry: { translateString }
299
- } = props;
300
- return /* @__PURE__ */ jsx7(IconButton, { title: translateString(TranslatableString3.RemoveButton), ...props, icon: "trash" });
301
- }
302
- function ClearButton(props) {
303
- const {
304
- registry: { translateString }
305
- } = props;
306
- return /* @__PURE__ */ jsx7(IconButton, { title: translateString(TranslatableString3.ClearButton), ...props, icon: "times" });
307
- }
308
-
309
292
  // src/FieldErrorTemplate/FieldErrorTemplate.tsx
310
293
  import { errorId } from "@rjsf/utils";
311
294
  import { Message as Message2 } from "primereact/message";
@@ -331,8 +314,8 @@ function FieldErrorTemplate({ errors, fieldPathId }) {
331
314
  }
332
315
 
333
316
  // src/FieldHelpTemplate/FieldHelpTemplate.tsx
334
- import { helpId } from "@rjsf/utils";
335
317
  import { RichHelp } from "@rjsf/core";
318
+ import { helpId } from "@rjsf/utils";
336
319
  import { jsx as jsx9 } from "react/jsx-runtime";
337
320
  function FieldHelpTemplate(props) {
338
321
  const { fieldPathId, help, uiSchema, registry } = props;
@@ -345,16 +328,16 @@ function FieldHelpTemplate(props) {
345
328
  // src/FieldTemplate/FieldTemplate.tsx
346
329
  import {
347
330
  getTemplate as getTemplate3,
348
- getUiOptions as getUiOptions3
331
+ getUiOptions as getUiOptions4
349
332
  } from "@rjsf/utils";
350
333
 
351
334
  // src/util.tsx
352
- import { jsxs as jsxs5 } from "react/jsx-runtime";
335
+ import { jsxs as jsxs6 } from "react/jsx-runtime";
353
336
  function Label({ id, text, required }) {
354
337
  if (!text) {
355
338
  return null;
356
339
  }
357
- return /* @__PURE__ */ jsxs5("label", { htmlFor: id, children: [
340
+ return /* @__PURE__ */ jsxs6("label", { htmlFor: id, children: [
358
341
  text,
359
342
  " ",
360
343
  required ? "*" : ""
@@ -362,10 +345,10 @@ function Label({ id, text, required }) {
362
345
  }
363
346
 
364
347
  // src/FieldTemplate/FieldTemplate.tsx
365
- import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
348
+ import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
366
349
  function FieldTemplate(props) {
367
350
  const { children, errors, help, displayLabel, description, rawDescription, hidden, uiSchema, registry } = props;
368
- const uiOptions = getUiOptions3(uiSchema);
351
+ const uiOptions = getUiOptions4(uiSchema);
369
352
  const WrapIfAdditionalTemplate2 = getTemplate3(
370
353
  "WrapIfAdditionalTemplate",
371
354
  registry,
@@ -375,7 +358,7 @@ function FieldTemplate(props) {
375
358
  return /* @__PURE__ */ jsx10("div", { style: { display: "none" }, children });
376
359
  }
377
360
  const isCheckbox = uiOptions.widget === "checkbox";
378
- return /* @__PURE__ */ jsx10(WrapIfAdditionalTemplate2, { ...props, children: /* @__PURE__ */ jsxs6("div", { style: { display: "flex", flexDirection: "column", gap: "0.5rem", marginBottom: "1rem" }, children: [
361
+ return /* @__PURE__ */ jsx10(WrapIfAdditionalTemplate2, { ...props, children: /* @__PURE__ */ jsxs7("div", { style: { display: "flex", flexDirection: "column", gap: "0.5rem", marginBottom: "1rem" }, children: [
379
362
  displayLabel && !isCheckbox && /* @__PURE__ */ jsx10(Label, { id: props.id, text: props.label, required: props.required }),
380
363
  children,
381
364
  displayLabel && rawDescription && !isCheckbox && /* @__PURE__ */ jsx10("small", { children: description }),
@@ -384,13 +367,121 @@ function FieldTemplate(props) {
384
367
  ] }) });
385
368
  }
386
369
 
370
+ // src/GridTemplate/GridTemplate.tsx
371
+ import { useEffect, useState } from "react";
372
+ import { jsx as jsx11 } from "react/jsx-runtime";
373
+ var breakpoints = {
374
+ xs: 0,
375
+ sm: 576,
376
+ md: 768,
377
+ lg: 992,
378
+ xl: 1200
379
+ };
380
+ function getBreakpoint(width) {
381
+ if (width >= breakpoints.xl) {
382
+ return "xl";
383
+ }
384
+ if (width >= breakpoints.lg) {
385
+ return "lg";
386
+ }
387
+ if (width >= breakpoints.md) {
388
+ return "md";
389
+ }
390
+ if (width >= breakpoints.sm) {
391
+ return "sm";
392
+ }
393
+ return "xs";
394
+ }
395
+ function getResponsiveSpan(spanDef, breakpoint) {
396
+ return spanDef[breakpoint] ?? spanDef.xl ?? spanDef.lg ?? spanDef.md ?? spanDef.sm ?? spanDef.xs ?? 12;
397
+ }
398
+ function getInitialWidth() {
399
+ return typeof window !== "undefined" ? window.innerWidth : breakpoints.xs;
400
+ }
401
+ function GridTemplate(props) {
402
+ return props.column ? GridTemplateColumn(props) : GridTemplateRow(props);
403
+ }
404
+ function GridTemplateRow(props) {
405
+ const { children, column, uiSchema, style, ...rest } = props;
406
+ const layoutGrid = uiSchema?.["ui:layoutGrid"] ?? {};
407
+ const totalColumns = layoutGrid.columns ?? 12;
408
+ const gap = layoutGrid.gap ?? "16px";
409
+ return /* @__PURE__ */ jsx11(
410
+ "div",
411
+ {
412
+ style: {
413
+ display: "grid",
414
+ gridTemplateColumns: `repeat(${totalColumns}, 1fr)`,
415
+ alignItems: "start",
416
+ gap,
417
+ ...style ?? {}
418
+ },
419
+ ...rest,
420
+ children
421
+ }
422
+ );
423
+ }
424
+ function GridTemplateColumn(props) {
425
+ const { children, column, uiSchema, xs, sm, md, lg, xl, style, ...rest } = props;
426
+ const [breakpoint, setBreakpoint] = useState(() => getBreakpoint(getInitialWidth()));
427
+ useEffect(() => {
428
+ if (typeof window === "undefined") {
429
+ return;
430
+ }
431
+ const handleResize = () => setBreakpoint(getBreakpoint(window.innerWidth));
432
+ window.addEventListener("resize", handleResize);
433
+ return () => window.removeEventListener("resize", handleResize);
434
+ }, []);
435
+ const span = getResponsiveSpan(props, breakpoint);
436
+ return /* @__PURE__ */ jsx11("div", { style: { gridColumn: `span ${span} / span ${span}`, ...style ?? {} }, ...rest, children });
437
+ }
438
+
439
+ // src/IconButton/IconButton.tsx
440
+ import { TranslatableString as TranslatableString3 } from "@rjsf/utils";
441
+ import { Button as Button2 } from "primereact/button";
442
+ import { jsx as jsx12 } from "react/jsx-runtime";
443
+ function IconButton(props) {
444
+ const { icon, iconType, uiSchema, registry, ...otherProps } = props;
445
+ return /* @__PURE__ */ jsx12(Button2, { icon: `pi pi-${icon}`, rounded: true, text: true, severity: "secondary", ...otherProps });
446
+ }
447
+ function CopyButton(props) {
448
+ const {
449
+ registry: { translateString }
450
+ } = props;
451
+ return /* @__PURE__ */ jsx12(IconButton, { title: translateString(TranslatableString3.CopyButton), ...props, icon: "copy" });
452
+ }
453
+ function MoveDownButton(props) {
454
+ const {
455
+ registry: { translateString }
456
+ } = props;
457
+ return /* @__PURE__ */ jsx12(IconButton, { title: translateString(TranslatableString3.MoveDownButton), ...props, icon: "angle-down" });
458
+ }
459
+ function MoveUpButton(props) {
460
+ const {
461
+ registry: { translateString }
462
+ } = props;
463
+ return /* @__PURE__ */ jsx12(IconButton, { title: translateString(TranslatableString3.MoveUpButton), ...props, icon: "angle-up" });
464
+ }
465
+ function RemoveButton(props) {
466
+ const {
467
+ registry: { translateString }
468
+ } = props;
469
+ return /* @__PURE__ */ jsx12(IconButton, { title: translateString(TranslatableString3.RemoveButton), ...props, icon: "trash" });
470
+ }
471
+ function ClearButton(props) {
472
+ const {
473
+ registry: { translateString }
474
+ } = props;
475
+ return /* @__PURE__ */ jsx12(IconButton, { title: translateString(TranslatableString3.ClearButton), ...props, icon: "times" });
476
+ }
477
+
387
478
  // src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx
388
479
  import { Fieldset as Fieldset2 } from "primereact/fieldset";
389
- import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
480
+ import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
390
481
  function MultiSchemaFieldTemplate(props) {
391
482
  const { selector, optionSchemaField } = props;
392
- return /* @__PURE__ */ jsxs7(Fieldset2, { children: [
393
- /* @__PURE__ */ jsx11("div", { style: { marginBottom: "1rem" }, children: selector }),
483
+ return /* @__PURE__ */ jsxs8(Fieldset2, { children: [
484
+ /* @__PURE__ */ jsx13("div", { style: { marginBottom: "1rem" }, children: selector }),
394
485
  optionSchemaField
395
486
  ] });
396
487
  }
@@ -400,11 +491,11 @@ import {
400
491
  canExpand,
401
492
  descriptionId,
402
493
  getTemplate as getTemplate4,
403
- getUiOptions as getUiOptions4,
404
- titleId,
494
+ getUiOptions as getUiOptions5,
495
+ titleId as titleId2,
405
496
  buttonId as buttonId2
406
497
  } from "@rjsf/utils";
407
- import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
498
+ import { Fragment as Fragment3, jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
408
499
  function ObjectFieldTemplate(props) {
409
500
  const {
410
501
  description,
@@ -421,7 +512,7 @@ function ObjectFieldTemplate(props) {
421
512
  fieldPathId,
422
513
  registry
423
514
  } = props;
424
- const uiOptions = getUiOptions4(uiSchema);
515
+ const uiOptions = getUiOptions5(uiSchema);
425
516
  const TitleFieldTemplate = getTemplate4("TitleFieldTemplate", registry, uiOptions);
426
517
  const DescriptionFieldTemplate = getTemplate4(
427
518
  "DescriptionFieldTemplate",
@@ -432,11 +523,11 @@ function ObjectFieldTemplate(props) {
432
523
  const {
433
524
  ButtonTemplates: { AddButton: AddButton2 }
434
525
  } = registry.templates;
435
- return /* @__PURE__ */ jsxs8(Fragment3, { children: [
436
- title && /* @__PURE__ */ jsx12(
526
+ return /* @__PURE__ */ jsxs9(Fragment3, { children: [
527
+ title && /* @__PURE__ */ jsx14(
437
528
  TitleFieldTemplate,
438
529
  {
439
- id: titleId(fieldPathId),
530
+ id: titleId2(fieldPathId),
440
531
  title,
441
532
  required,
442
533
  schema,
@@ -445,7 +536,7 @@ function ObjectFieldTemplate(props) {
445
536
  optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
446
537
  }
447
538
  ),
448
- description && /* @__PURE__ */ jsx12("div", { style: { marginBottom: "1rem" }, children: /* @__PURE__ */ jsx12(
539
+ description && /* @__PURE__ */ jsx14("div", { style: { marginBottom: "1rem" }, children: /* @__PURE__ */ jsx14(
449
540
  DescriptionFieldTemplate,
450
541
  {
451
542
  id: descriptionId(fieldPathId),
@@ -457,7 +548,7 @@ function ObjectFieldTemplate(props) {
457
548
  ) }),
458
549
  !showOptionalDataControlInTitle ? optionalDataControl : void 0,
459
550
  properties.map((prop) => prop.content),
460
- canExpand(schema, uiSchema, formData) && /* @__PURE__ */ jsx12("div", { style: { marginTop: "1rem", textAlign: "right" }, children: /* @__PURE__ */ jsx12(
551
+ canExpand(schema, uiSchema, formData) && /* @__PURE__ */ jsx14("div", { style: { marginTop: "1rem", textAlign: "right" }, children: /* @__PURE__ */ jsx14(
461
552
  AddButton2,
462
553
  {
463
554
  id: buttonId2(fieldPathId, "add"),
@@ -472,11 +563,11 @@ function ObjectFieldTemplate(props) {
472
563
  }
473
564
 
474
565
  // src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx
475
- import { jsx as jsx13 } from "react/jsx-runtime";
566
+ import { jsx as jsx15 } from "react/jsx-runtime";
476
567
  function OptionalDataControlsTemplate(props) {
477
568
  const { id, registry, label, onAddClick, onRemoveClick } = props;
478
569
  if (onAddClick) {
479
- return /* @__PURE__ */ jsx13(
570
+ return /* @__PURE__ */ jsx15(
480
571
  IconButton,
481
572
  {
482
573
  id,
@@ -489,7 +580,7 @@ function OptionalDataControlsTemplate(props) {
489
580
  }
490
581
  );
491
582
  } else if (onRemoveClick) {
492
- return /* @__PURE__ */ jsx13(
583
+ return /* @__PURE__ */ jsx15(
493
584
  RemoveButton,
494
585
  {
495
586
  id,
@@ -501,25 +592,25 @@ function OptionalDataControlsTemplate(props) {
501
592
  }
502
593
  );
503
594
  }
504
- return /* @__PURE__ */ jsx13("em", { id, children: label });
595
+ return /* @__PURE__ */ jsx15("em", { id, children: label });
505
596
  }
506
597
 
507
598
  // src/SubmitButton/SubmitButton.tsx
508
- import { Button as Button3 } from "primereact/button";
509
599
  import { getSubmitButtonOptions } from "@rjsf/utils";
510
- import { jsx as jsx14 } from "react/jsx-runtime";
600
+ import { Button as Button3 } from "primereact/button";
601
+ import { jsx as jsx16 } from "react/jsx-runtime";
511
602
  function SubmitButton({ uiSchema }) {
512
603
  const { submitText, norender, props: submitButtonProps = {} } = getSubmitButtonOptions(uiSchema);
513
604
  if (norender) {
514
605
  return null;
515
606
  }
516
- return /* @__PURE__ */ jsx14(Button3, { type: "submit", label: submitText, ...submitButtonProps });
607
+ return /* @__PURE__ */ jsx16(Button3, { type: "submit", label: submitText, ...submitButtonProps });
517
608
  }
518
609
 
519
610
  // src/TitleField/TitleField.tsx
611
+ import { getUiOptions as getUiOptions6, titleId as titleId3 } from "@rjsf/utils";
520
612
  import { Divider } from "primereact/divider";
521
- import { getUiOptions as getUiOptions5, titleId as titleId2 } from "@rjsf/utils";
522
- import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
613
+ import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
523
614
  function TitleField({
524
615
  id,
525
616
  title,
@@ -527,21 +618,21 @@ function TitleField({
527
618
  required,
528
619
  optionalDataControl
529
620
  }) {
530
- const uiOptions = getUiOptions5(uiSchema);
531
- let heading = /* @__PURE__ */ jsxs9("h5", { style: { margin: 0, fontSize: id === titleId2("root") ? "1.5rem" : "1.2rem" }, children: [
621
+ const uiOptions = getUiOptions6(uiSchema);
622
+ let heading = /* @__PURE__ */ jsxs10("h5", { style: { margin: 0, fontSize: id === titleId3("root") ? "1.5rem" : "1.2rem" }, children: [
532
623
  uiOptions.title || title,
533
624
  " ",
534
625
  required ? "*" : ""
535
626
  ] });
536
627
  if (optionalDataControl) {
537
- heading = /* @__PURE__ */ jsxs9("div", { style: { display: "flex" }, children: [
538
- /* @__PURE__ */ jsx15("div", { style: { flexGrow: 1 }, children: heading }),
539
- /* @__PURE__ */ jsx15("div", { style: { marginLeft: "-5px" }, children: optionalDataControl })
628
+ heading = /* @__PURE__ */ jsxs10("div", { style: { display: "flex" }, children: [
629
+ /* @__PURE__ */ jsx17("div", { style: { flexGrow: 1 }, children: heading }),
630
+ /* @__PURE__ */ jsx17("div", { style: { marginLeft: "-5px" }, children: optionalDataControl })
540
631
  ] });
541
632
  }
542
- return /* @__PURE__ */ jsxs9("div", { id, children: [
633
+ return /* @__PURE__ */ jsxs10("div", { id, children: [
543
634
  heading,
544
- /* @__PURE__ */ jsx15(Divider, { pt: { root: { style: { marginTop: "0.5rem" } } } })
635
+ /* @__PURE__ */ jsx17(Divider, { pt: { root: { style: { marginTop: "0.5rem" } } } })
545
636
  ] });
546
637
  }
547
638
 
@@ -552,7 +643,7 @@ import {
552
643
  TranslatableString as TranslatableString4
553
644
  } from "@rjsf/utils";
554
645
  import { InputText as InputText2 } from "primereact/inputtext";
555
- import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
646
+ import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
556
647
  function WrapIfAdditionalTemplate({
557
648
  classNames,
558
649
  style,
@@ -576,17 +667,17 @@ function WrapIfAdditionalTemplate({
576
667
  const hasDescription = !!rawDescription;
577
668
  const margin = hasDescription ? -8 : 12;
578
669
  if (!additional) {
579
- return /* @__PURE__ */ jsx16("div", { className: classNames, style, children });
670
+ return /* @__PURE__ */ jsx18("div", { className: classNames, style, children });
580
671
  }
581
- return /* @__PURE__ */ jsxs10(
672
+ return /* @__PURE__ */ jsxs11(
582
673
  "div",
583
674
  {
584
675
  className: classNames,
585
676
  style: { ...style, display: "flex", alignItems: "flex-start", gap: "1rem" },
586
677
  children: [
587
- /* @__PURE__ */ jsxs10("div", { style: { flex: 1 }, children: [
588
- displayLabel && /* @__PURE__ */ jsx16("label", { htmlFor: `${id}-key`, style: { display: "block", marginBottom: "0.5rem" }, children: keyLabel }),
589
- /* @__PURE__ */ jsx16(
678
+ /* @__PURE__ */ jsxs11("div", { style: { flex: 1 }, children: [
679
+ displayLabel && /* @__PURE__ */ jsx18("label", { htmlFor: `${id}-key`, style: { display: "block", marginBottom: "0.5rem" }, children: keyLabel }),
680
+ /* @__PURE__ */ jsx18(
590
681
  InputText2,
591
682
  {
592
683
  id: `${id}-key`,
@@ -600,8 +691,8 @@ function WrapIfAdditionalTemplate({
600
691
  label
601
692
  )
602
693
  ] }),
603
- /* @__PURE__ */ jsx16("div", { style: { flex: 1 }, children }),
604
- /* @__PURE__ */ jsx16("div", { style: displayLabel ? { alignSelf: "center", marginTop: `${margin}px` } : void 0, children: /* @__PURE__ */ jsx16(
694
+ /* @__PURE__ */ jsx18("div", { style: { flex: 1 }, children }),
695
+ /* @__PURE__ */ jsx18("div", { style: displayLabel ? { alignSelf: "center", marginTop: `${margin}px` } : void 0, children: /* @__PURE__ */ jsx18(
605
696
  RemoveButton2,
606
697
  {
607
698
  id: buttonId3(id, "remove"),
@@ -617,97 +708,6 @@ function WrapIfAdditionalTemplate({
617
708
  );
618
709
  }
619
710
 
620
- // src/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.tsx
621
- import {
622
- getUiOptions as getUiOptions6,
623
- titleId as titleId3
624
- } from "@rjsf/utils";
625
- import { jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
626
- function ArrayFieldTitleTemplate({ title, uiSchema, required, fieldPathId, optionalDataControl }) {
627
- const uiOptions = getUiOptions6(uiSchema);
628
- let heading = /* @__PURE__ */ jsxs11("h5", { id: titleId3(fieldPathId), style: { margin: 0, fontSize: "1.5rem", marginBottom: "0.2rem" }, children: [
629
- uiOptions.title || title,
630
- " ",
631
- required ? "*" : ""
632
- ] });
633
- if (optionalDataControl) {
634
- heading = /* @__PURE__ */ jsxs11("div", { style: { display: "flex" }, children: [
635
- /* @__PURE__ */ jsx17("div", { style: { flexGrow: 1 }, children: heading }),
636
- /* @__PURE__ */ jsx17("div", { children: optionalDataControl })
637
- ] });
638
- }
639
- return heading;
640
- }
641
-
642
- // src/GridTemplate/GridTemplate.tsx
643
- import { useEffect, useState } from "react";
644
- import { jsx as jsx18 } from "react/jsx-runtime";
645
- var breakpoints = {
646
- xs: 0,
647
- sm: 576,
648
- md: 768,
649
- lg: 992,
650
- xl: 1200
651
- };
652
- function getBreakpoint(width) {
653
- if (width >= breakpoints.xl) {
654
- return "xl";
655
- }
656
- if (width >= breakpoints.lg) {
657
- return "lg";
658
- }
659
- if (width >= breakpoints.md) {
660
- return "md";
661
- }
662
- if (width >= breakpoints.sm) {
663
- return "sm";
664
- }
665
- return "xs";
666
- }
667
- function getResponsiveSpan(spanDef, breakpoint) {
668
- return spanDef[breakpoint] ?? spanDef.xl ?? spanDef.lg ?? spanDef.md ?? spanDef.sm ?? spanDef.xs ?? 12;
669
- }
670
- function getInitialWidth() {
671
- return typeof window !== "undefined" ? window.innerWidth : breakpoints.xs;
672
- }
673
- function GridTemplate(props) {
674
- return props.column ? GridTemplateColumn(props) : GridTemplateRow(props);
675
- }
676
- function GridTemplateRow(props) {
677
- const { children, column, uiSchema, style, ...rest } = props;
678
- const layoutGrid = uiSchema?.["ui:layoutGrid"] ?? {};
679
- const totalColumns = layoutGrid.columns ?? 12;
680
- const gap = layoutGrid.gap ?? "16px";
681
- return /* @__PURE__ */ jsx18(
682
- "div",
683
- {
684
- style: {
685
- display: "grid",
686
- gridTemplateColumns: `repeat(${totalColumns}, 1fr)`,
687
- alignItems: "start",
688
- gap,
689
- ...style ?? {}
690
- },
691
- ...rest,
692
- children
693
- }
694
- );
695
- }
696
- function GridTemplateColumn(props) {
697
- const { children, column, uiSchema, xs, sm, md, lg, xl, style, ...rest } = props;
698
- const [breakpoint, setBreakpoint] = useState(() => getBreakpoint(getInitialWidth()));
699
- useEffect(() => {
700
- if (typeof window === "undefined") {
701
- return;
702
- }
703
- const handleResize = () => setBreakpoint(getBreakpoint(window.innerWidth));
704
- window.addEventListener("resize", handleResize);
705
- return () => window.removeEventListener("resize", handleResize);
706
- }, []);
707
- const span = getResponsiveSpan(props, breakpoint);
708
- return /* @__PURE__ */ jsx18("div", { style: { gridColumn: `span ${span} / span ${span}`, ...style ?? {} }, ...rest, children });
709
- }
710
-
711
711
  // src/Templates/Templates.ts
712
712
  function generateTemplates() {
713
713
  return {
@@ -817,91 +817,18 @@ function AutoCompleteWidget(props) {
817
817
  );
818
818
  }
819
819
 
820
- // src/CheckboxWidget/CheckboxWidget.tsx
821
- import {
822
- ariaDescribedByIds as ariaDescribedByIds3,
823
- descriptionId as descriptionId2,
824
- getTemplate as getTemplate5,
825
- labelValue,
826
- schemaRequiresTrueValue
827
- } from "@rjsf/utils";
828
- import { Checkbox } from "primereact/checkbox";
829
- import { Fragment as Fragment5, jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
830
- function CheckboxWidget(props) {
831
- const {
832
- id,
833
- htmlName,
834
- value,
835
- disabled,
836
- readonly,
837
- label = "",
838
- hideLabel,
839
- autofocus,
840
- onChange,
841
- onBlur,
842
- options,
843
- onFocus,
844
- schema,
845
- uiSchema,
846
- registry
847
- } = props;
848
- const DescriptionFieldTemplate = getTemplate5(
849
- "DescriptionFieldTemplate",
850
- registry,
851
- options
852
- );
853
- const required = schemaRequiresTrueValue(schema);
854
- const checked = value === "true" || value === true;
855
- const _onChange = (e) => onChange && onChange(e.checked);
856
- const _onBlur = () => onBlur && onBlur(id, value);
857
- const _onFocus = () => onFocus && onFocus(id, value);
858
- const description = options.description ?? schema.description;
859
- const primeProps = options.prime || {};
860
- return /* @__PURE__ */ jsxs12(Fragment5, { children: [
861
- !hideLabel && !!description && /* @__PURE__ */ jsx20(
862
- DescriptionFieldTemplate,
863
- {
864
- id: descriptionId2(id),
865
- description,
866
- schema,
867
- uiSchema,
868
- registry
869
- }
870
- ),
871
- /* @__PURE__ */ jsxs12("div", { style: { display: "flex", flexDirection: "row", gap: "0.5rem", alignItems: "center" }, children: [
872
- /* @__PURE__ */ jsx20(
873
- Checkbox,
874
- {
875
- inputId: id,
876
- name: htmlName || id,
877
- ...primeProps,
878
- disabled: disabled || readonly,
879
- autoFocus: autofocus,
880
- checked: typeof value === "undefined" ? false : checked,
881
- onChange: _onChange,
882
- onBlur: _onBlur,
883
- onFocus: _onFocus,
884
- required,
885
- "aria-describedby": ariaDescribedByIds3(id)
886
- }
887
- ),
888
- labelValue(/* @__PURE__ */ jsx20(Label, { id, text: label }), hideLabel, false)
889
- ] })
890
- ] });
891
- }
892
-
893
820
  // src/CheckboxesWidget/CheckboxesWidget.tsx
894
- import { Checkbox as Checkbox2 } from "primereact/checkbox";
895
821
  import {
896
- ariaDescribedByIds as ariaDescribedByIds4,
822
+ ariaDescribedByIds as ariaDescribedByIds3,
897
823
  enumOptionsDeselectValue,
898
824
  enumOptionsIsSelected,
899
825
  enumOptionsSelectValue,
900
826
  optionId,
901
- descriptionId as descriptionId3,
902
- getTemplate as getTemplate6
827
+ descriptionId as descriptionId2,
828
+ getTemplate as getTemplate5
903
829
  } from "@rjsf/utils";
904
- import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
830
+ import { Checkbox } from "primereact/checkbox";
831
+ import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
905
832
  function CheckboxesWidget(props) {
906
833
  const {
907
834
  id,
@@ -929,7 +856,7 @@ function CheckboxesWidget(props) {
929
856
  onChange(enumOptionsDeselectValue(index, checkboxesValues, enumOptions));
930
857
  }
931
858
  };
932
- const DescriptionFieldTemplate = getTemplate6(
859
+ const DescriptionFieldTemplate = getTemplate5(
933
860
  "DescriptionFieldTemplate",
934
861
  registry,
935
862
  options
@@ -937,16 +864,16 @@ function CheckboxesWidget(props) {
937
864
  const _onBlur = () => onBlur(id, value);
938
865
  const _onFocus = () => onFocus(id, value);
939
866
  const description = options.description ?? schema.description;
940
- return /* @__PURE__ */ jsxs13(
867
+ return /* @__PURE__ */ jsxs12(
941
868
  "div",
942
869
  {
943
870
  id,
944
871
  style: { display: "flex", flexDirection: "column", gap: "1rem", marginTop: "0.5rem", marginBottom: "0.5rem" },
945
872
  children: [
946
- !hideLabel && !!description && /* @__PURE__ */ jsx21(
873
+ !hideLabel && !!description && /* @__PURE__ */ jsx20(
947
874
  DescriptionFieldTemplate,
948
875
  {
949
- id: descriptionId3(id),
876
+ id: descriptionId2(id),
950
877
  description,
951
878
  schema,
952
879
  uiSchema,
@@ -956,9 +883,9 @@ function CheckboxesWidget(props) {
956
883
  Array.isArray(enumOptions) && enumOptions.map((option, index) => {
957
884
  const checked = enumOptionsIsSelected(option.value, checkboxesValues);
958
885
  const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
959
- return /* @__PURE__ */ jsxs13("div", { style: { display: "flex", flexDirection: "row", gap: "0.5rem", alignItems: "center" }, children: [
960
- /* @__PURE__ */ jsx21(
961
- Checkbox2,
886
+ return /* @__PURE__ */ jsxs12("div", { style: { display: "flex", flexDirection: "row", gap: "0.5rem", alignItems: "center" }, children: [
887
+ /* @__PURE__ */ jsx20(
888
+ Checkbox,
962
889
  {
963
890
  inputId: optionId(id, index),
964
891
  name: htmlName || id,
@@ -970,10 +897,10 @@ function CheckboxesWidget(props) {
970
897
  onChange: _onChange(index),
971
898
  onBlur: _onBlur,
972
899
  onFocus: _onFocus,
973
- "aria-describedby": ariaDescribedByIds4(id)
900
+ "aria-describedby": ariaDescribedByIds3(id)
974
901
  }
975
902
  ),
976
- /* @__PURE__ */ jsx21(Label, { id: optionId(id, index), text: option.label })
903
+ /* @__PURE__ */ jsx20(Label, { id: optionId(id, index), text: option.label })
977
904
  ] }, index);
978
905
  })
979
906
  ]
@@ -981,6 +908,79 @@ function CheckboxesWidget(props) {
981
908
  );
982
909
  }
983
910
 
911
+ // src/CheckboxWidget/CheckboxWidget.tsx
912
+ import {
913
+ ariaDescribedByIds as ariaDescribedByIds4,
914
+ descriptionId as descriptionId3,
915
+ getTemplate as getTemplate6,
916
+ labelValue,
917
+ schemaRequiresTrueValue
918
+ } from "@rjsf/utils";
919
+ import { Checkbox as Checkbox2 } from "primereact/checkbox";
920
+ import { Fragment as Fragment5, jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
921
+ function CheckboxWidget(props) {
922
+ const {
923
+ id,
924
+ htmlName,
925
+ value,
926
+ disabled,
927
+ readonly,
928
+ label = "",
929
+ hideLabel,
930
+ autofocus,
931
+ onChange,
932
+ onBlur,
933
+ options,
934
+ onFocus,
935
+ schema,
936
+ uiSchema,
937
+ registry
938
+ } = props;
939
+ const DescriptionFieldTemplate = getTemplate6(
940
+ "DescriptionFieldTemplate",
941
+ registry,
942
+ options
943
+ );
944
+ const required = schemaRequiresTrueValue(schema);
945
+ const checked = value === "true" || value === true;
946
+ const _onChange = (e) => onChange && onChange(e.checked);
947
+ const _onBlur = () => onBlur && onBlur(id, value);
948
+ const _onFocus = () => onFocus && onFocus(id, value);
949
+ const description = options.description ?? schema.description;
950
+ const primeProps = options.prime || {};
951
+ return /* @__PURE__ */ jsxs13(Fragment5, { children: [
952
+ !hideLabel && !!description && /* @__PURE__ */ jsx21(
953
+ DescriptionFieldTemplate,
954
+ {
955
+ id: descriptionId3(id),
956
+ description,
957
+ schema,
958
+ uiSchema,
959
+ registry
960
+ }
961
+ ),
962
+ /* @__PURE__ */ jsxs13("div", { style: { display: "flex", flexDirection: "row", gap: "0.5rem", alignItems: "center" }, children: [
963
+ /* @__PURE__ */ jsx21(
964
+ Checkbox2,
965
+ {
966
+ inputId: id,
967
+ name: htmlName || id,
968
+ ...primeProps,
969
+ disabled: disabled || readonly,
970
+ autoFocus: autofocus,
971
+ checked: typeof value === "undefined" ? false : checked,
972
+ onChange: _onChange,
973
+ onBlur: _onBlur,
974
+ onFocus: _onFocus,
975
+ required,
976
+ "aria-describedby": ariaDescribedByIds4(id)
977
+ }
978
+ ),
979
+ labelValue(/* @__PURE__ */ jsx21(Label, { id, text: label }), hideLabel, false)
980
+ ] })
981
+ ] });
982
+ }
983
+
984
984
  // src/ColorWidget/ColorWidget.tsx
985
985
  import {
986
986
  ariaDescribedByIds as ariaDescribedByIds5,
@@ -1130,8 +1130,8 @@ function RadioWidget(props) {
1130
1130
  }
1131
1131
 
1132
1132
  // src/RangeWidget/RangeWidget.tsx
1133
- import { Slider } from "primereact/slider";
1134
1133
  import { ariaDescribedByIds as ariaDescribedByIds8, rangeSpec } from "@rjsf/utils";
1134
+ import { Slider } from "primereact/slider";
1135
1135
  import { Fragment as Fragment6, jsx as jsx25 } from "react/jsx-runtime";
1136
1136
  function RangeWidget(props) {
1137
1137
  const { value, readonly, disabled, onBlur, onFocus, options, schema, onChange, id } = props;
@@ -1158,7 +1158,6 @@ function RangeWidget(props) {
1158
1158
  }
1159
1159
 
1160
1160
  // src/SelectWidget/SelectWidget.tsx
1161
- import { Dropdown } from "primereact/dropdown";
1162
1161
  import {
1163
1162
  ariaDescribedByIds as ariaDescribedByIds9,
1164
1163
  enumOptionSelectedValue,
@@ -1166,6 +1165,7 @@ import {
1166
1165
  enumOptionValueEncoder as enumOptionValueEncoder2,
1167
1166
  getOptionValueFormat as getOptionValueFormat2
1168
1167
  } from "@rjsf/utils";
1168
+ import { Dropdown } from "primereact/dropdown";
1169
1169
  import { MultiSelect } from "primereact/multiselect";
1170
1170
  import { jsx as jsx26 } from "react/jsx-runtime";
1171
1171
  function SelectWidget(props) {