@rjsf/primereact 6.0.0-beta.21 → 6.0.0-beta.23

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 (40) hide show
  1. package/dist/index.cjs +21 -30
  2. package/dist/index.cjs.map +3 -3
  3. package/dist/primereact.esm.js +21 -31
  4. package/dist/primereact.esm.js.map +3 -3
  5. package/dist/primereact.umd.js +21 -30
  6. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +3 -3
  7. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +1 -1
  8. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
  9. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +1 -1
  10. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +3 -12
  11. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
  12. package/lib/BaseInputTemplate/BaseInputTemplate.js +2 -2
  13. package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
  14. package/lib/CheckboxWidget/CheckboxWidget.js +2 -2
  15. package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
  16. package/lib/CheckboxesWidget/CheckboxesWidget.js +2 -2
  17. package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
  18. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +2 -2
  19. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
  20. package/lib/RadioWidget/RadioWidget.js +2 -2
  21. package/lib/RadioWidget/RadioWidget.js.map +1 -1
  22. package/lib/SelectWidget/SelectWidget.js +5 -5
  23. package/lib/SelectWidget/SelectWidget.js.map +1 -1
  24. package/lib/TextareaWidget/TextareaWidget.js +2 -2
  25. package/lib/TextareaWidget/TextareaWidget.js.map +1 -1
  26. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.d.ts +1 -1
  27. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +2 -3
  28. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
  29. package/lib/tsconfig.tsbuildinfo +1 -1
  30. package/package.json +7 -7
  31. package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +3 -3
  32. package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +2 -17
  33. package/src/BaseInputTemplate/BaseInputTemplate.tsx +2 -1
  34. package/src/CheckboxWidget/CheckboxWidget.tsx +2 -1
  35. package/src/CheckboxesWidget/CheckboxesWidget.tsx +2 -1
  36. package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +2 -2
  37. package/src/RadioWidget/RadioWidget.tsx +2 -2
  38. package/src/SelectWidget/SelectWidget.tsx +4 -3
  39. package/src/TextareaWidget/TextareaWidget.tsx +2 -1
  40. package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +4 -7
@@ -50,7 +50,6 @@ import {
50
50
  getTemplate as getTemplate2,
51
51
  getUiOptions as getUiOptions2,
52
52
  isFixedItems,
53
- UI_OPTIONS_KEY,
54
53
  buttonId
55
54
  } from "@rjsf/utils";
56
55
  import { Fieldset } from "primereact/fieldset";
@@ -78,11 +77,6 @@ function ArrayFieldTemplate(props) {
78
77
  registry,
79
78
  uiOptions
80
79
  );
81
- const ArrayFieldItemTemplate2 = getTemplate2(
82
- "ArrayFieldItemTemplate",
83
- registry,
84
- uiOptions
85
- );
86
80
  const ArrayFieldTitleTemplate2 = getTemplate2(
87
81
  "ArrayFieldTitleTemplate",
88
82
  registry,
@@ -122,15 +116,7 @@ function ArrayFieldTemplate(props) {
122
116
  /* @__PURE__ */ jsxs2("div", { children: [
123
117
  /* @__PURE__ */ jsxs2("div", { children: [
124
118
  !showOptionalDataControlInTitle ? optionalDataControl : void 0,
125
- items.map(({ key, uiSchema: itemUiSchema = {}, ...props2 }) => {
126
- const mergedUiSchema = {
127
- ...itemUiSchema,
128
- [UI_OPTIONS_KEY]: {
129
- ...itemUiSchema[UI_OPTIONS_KEY]
130
- }
131
- };
132
- return /* @__PURE__ */ jsx3(ArrayFieldItemTemplate2, { ...props2, uiSchema: mergedUiSchema }, key);
133
- })
119
+ items
134
120
  ] }),
135
121
  canAdd && /* @__PURE__ */ jsx3(
136
122
  "div",
@@ -171,6 +157,7 @@ import { jsx as jsx4 } from "react/jsx-runtime";
171
157
  function BaseInputTemplate(props) {
172
158
  const {
173
159
  id,
160
+ htmlName,
174
161
  placeholder,
175
162
  value,
176
163
  required,
@@ -200,7 +187,7 @@ function BaseInputTemplate(props) {
200
187
  InputText,
201
188
  {
202
189
  id,
203
- name: id,
190
+ name: htmlName || id,
204
191
  placeholder,
205
192
  ...primeProps,
206
193
  ...inputProps,
@@ -399,7 +386,7 @@ function ObjectFieldTemplate(props) {
399
386
  const {
400
387
  description,
401
388
  optionalDataControl,
402
- onAddClick,
389
+ onAddProperty,
403
390
  title,
404
391
  properties,
405
392
  disabled,
@@ -453,7 +440,7 @@ function ObjectFieldTemplate(props) {
453
440
  id: buttonId2(fieldPathId, "add"),
454
441
  className: "rjsf-object-property-expand",
455
442
  icon: "pi pi-plus",
456
- onClick: onAddClick(schema),
443
+ onClick: onAddProperty,
457
444
  disabled: disabled || readonly,
458
445
  registry
459
446
  }
@@ -550,8 +537,8 @@ function WrapIfAdditionalTemplate({
550
537
  disabled,
551
538
  id,
552
539
  label,
553
- onDropPropertyClick,
554
- onKeyChange,
540
+ onRemoveProperty,
541
+ onKeyRenameBlur,
555
542
  readonly,
556
543
  required,
557
544
  schema,
@@ -564,7 +551,6 @@ function WrapIfAdditionalTemplate({
564
551
  if (!additional) {
565
552
  return /* @__PURE__ */ jsx16("div", { className: classNames, style, children });
566
553
  }
567
- const handleBlur = ({ target }) => onKeyChange(target.value);
568
554
  return /* @__PURE__ */ jsxs9(
569
555
  "div",
570
556
  {
@@ -580,7 +566,7 @@ function WrapIfAdditionalTemplate({
580
566
  name: `${id}-key`,
581
567
  defaultValue: label,
582
568
  disabled: disabled || readonly,
583
- onBlur: !readonly ? handleBlur : void 0,
569
+ onBlur: !readonly ? onKeyRenameBlur : void 0,
584
570
  required,
585
571
  style: { width: "100%" }
586
572
  }
@@ -593,7 +579,7 @@ function WrapIfAdditionalTemplate({
593
579
  id: buttonId3(id, "remove"),
594
580
  className: "rjsf-object-property-remove",
595
581
  disabled: disabled || readonly,
596
- onClick: onDropPropertyClick(label),
582
+ onClick: onRemoveProperty,
597
583
  registry
598
584
  }
599
585
  ) })
@@ -815,6 +801,7 @@ import { Fragment as Fragment4, jsx as jsx20, jsxs as jsxs11 } from "react/jsx-r
815
801
  function CheckboxWidget(props) {
816
802
  const {
817
803
  id,
804
+ htmlName,
818
805
  value,
819
806
  disabled,
820
807
  readonly,
@@ -857,7 +844,7 @@ function CheckboxWidget(props) {
857
844
  Checkbox,
858
845
  {
859
846
  inputId: id,
860
- name: id,
847
+ name: htmlName || id,
861
848
  ...primeProps,
862
849
  disabled: disabled || readonly,
863
850
  autoFocus: autofocus,
@@ -889,6 +876,7 @@ import { jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
889
876
  function CheckboxesWidget(props) {
890
877
  const {
891
878
  id,
879
+ htmlName,
892
880
  disabled,
893
881
  options,
894
882
  value,
@@ -944,7 +932,7 @@ function CheckboxesWidget(props) {
944
932
  Checkbox2,
945
933
  {
946
934
  inputId: optionId(id, index),
947
- name: id,
935
+ name: htmlName || id,
948
936
  ...primeProps,
949
937
  value: option.value,
950
938
  checked,
@@ -1077,7 +1065,7 @@ import {
1077
1065
  import { RadioButton } from "primereact/radiobutton";
1078
1066
  import { jsx as jsx24, jsxs as jsxs13 } from "react/jsx-runtime";
1079
1067
  function RadioWidget(props) {
1080
- const { id, value, disabled, readonly, onChange, onBlur, onFocus, options } = props;
1068
+ const { id, htmlName, value, disabled, readonly, onChange, onBlur, onFocus, options } = props;
1081
1069
  const primeProps = options.prime || {};
1082
1070
  const { enumOptions, enumDisabled, emptyValue } = options;
1083
1071
  const _onChange = (e) => {
@@ -1093,7 +1081,7 @@ function RadioWidget(props) {
1093
1081
  RadioButton,
1094
1082
  {
1095
1083
  inputId: optionId2(id, index),
1096
- name: id,
1084
+ name: htmlName || id,
1097
1085
  ...primeProps,
1098
1086
  onFocus: _onFocus,
1099
1087
  onBlur: _onBlur,
@@ -1153,6 +1141,7 @@ function SelectWidget(props) {
1153
1141
  function SingleSelectWidget({
1154
1142
  schema,
1155
1143
  id,
1144
+ htmlName,
1156
1145
  name,
1157
1146
  // remove this from dropdownProps
1158
1147
  options,
@@ -1173,7 +1162,6 @@ function SingleSelectWidget({
1173
1162
  registry,
1174
1163
  uiSchema,
1175
1164
  hideError,
1176
- formContext,
1177
1165
  ...dropdownProps
1178
1166
  }) {
1179
1167
  const { enumOptions, enumDisabled, emptyValue: optEmptyVal } = options;
@@ -1190,7 +1178,7 @@ function SingleSelectWidget({
1190
1178
  Dropdown,
1191
1179
  {
1192
1180
  id,
1193
- name: id,
1181
+ name: htmlName || id,
1194
1182
  ...primeProps,
1195
1183
  value: !isEmpty && typeof selectedIndexes !== "undefined" ? selectedIndexes : emptyValue,
1196
1184
  options: (enumOptions ?? []).map(({ value: value2, label: label2 }, i) => ({
@@ -1211,6 +1199,7 @@ function SingleSelectWidget({
1211
1199
  }
1212
1200
  function MultiSelectWidget({
1213
1201
  id,
1202
+ htmlName,
1214
1203
  options,
1215
1204
  disabled,
1216
1205
  placeholder,
@@ -1234,7 +1223,7 @@ function MultiSelectWidget({
1234
1223
  MultiSelect,
1235
1224
  {
1236
1225
  id,
1237
- name: id,
1226
+ name: htmlName || id,
1238
1227
  ...primeProps,
1239
1228
  value: !isEmpty && typeof selectedIndexes !== "undefined" ? selectedIndexes : emptyValue,
1240
1229
  options: (enumOptions ?? []).map(({ value: value2, label }, i) => ({
@@ -1259,7 +1248,7 @@ function MultiSelectWidget({
1259
1248
  import { InputTextarea } from "primereact/inputtextarea";
1260
1249
  import { jsx as jsx27 } from "react/jsx-runtime";
1261
1250
  function TextareaWidget(props) {
1262
- const { id, value, required, disabled, readonly, autofocus, onChange, onBlur, onFocus, options } = props;
1251
+ const { id, htmlName, value, required, disabled, readonly, autofocus, onChange, onBlur, onFocus, options } = props;
1263
1252
  const primeProps = options.prime || {};
1264
1253
  let rows = 5;
1265
1254
  if (typeof options.rows === "string" || typeof options.rows === "number") {
@@ -1272,6 +1261,7 @@ function TextareaWidget(props) {
1272
1261
  InputTextarea,
1273
1262
  {
1274
1263
  id,
1264
+ name: htmlName || id,
1275
1265
  ...primeProps,
1276
1266
  value: value || "",
1277
1267
  required,