@rjsf/primereact 6.6.0 → 6.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +133 -118
- package/dist/index.cjs.map +3 -3
- package/dist/primereact.esm.js +147 -179
- package/dist/primereact.esm.js.map +3 -3
- package/dist/primereact.umd.js +130 -116
- package/lib/AddButton/AddButton.d.ts +1 -1
- package/lib/AddButton/AddButton.js.map +1 -1
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +1 -1
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +1 -1
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
- package/lib/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.d.ts +1 -1
- package/lib/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.js +1 -1
- package/lib/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.js.map +1 -1
- package/lib/AutoCompleteWidget/AutoCompleteWidget.d.ts +1 -1
- package/lib/AutoCompleteWidget/AutoCompleteWidget.js +6 -6
- package/lib/AutoCompleteWidget/AutoCompleteWidget.js.map +1 -1
- package/lib/BaseInputTemplate/BaseInputTemplate.d.ts +1 -1
- package/lib/BaseInputTemplate/BaseInputTemplate.js +6 -6
- package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
- package/lib/CheckboxWidget/CheckboxWidget.d.ts +1 -1
- package/lib/CheckboxWidget/CheckboxWidget.js +5 -5
- package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.d.ts +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.js +5 -5
- package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
- package/lib/ColorWidget/ColorWidget.d.ts +1 -1
- package/lib/ColorWidget/ColorWidget.js +5 -5
- package/lib/ColorWidget/ColorWidget.js.map +1 -1
- package/lib/DescriptionField/DescriptionField.d.ts +1 -1
- package/lib/ErrorList/ErrorList.d.ts +1 -1
- package/lib/ErrorList/ErrorList.js +1 -1
- package/lib/ErrorList/ErrorList.js.map +1 -1
- package/lib/FieldErrorTemplate/FieldErrorTemplate.d.ts +1 -1
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js +2 -3
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -1
- package/lib/FieldHelpTemplate/FieldHelpTemplate.d.ts +1 -1
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -1
- package/lib/FieldTemplate/FieldTemplate.d.ts +1 -1
- package/lib/FieldTemplate/FieldTemplate.js +1 -1
- package/lib/FieldTemplate/FieldTemplate.js.map +1 -1
- package/lib/GridTemplate/GridTemplate.d.ts +1 -1
- package/lib/GridTemplate/GridTemplate.js +1 -1
- package/lib/GridTemplate/GridTemplate.js.map +1 -1
- package/lib/IconButton/IconButton.d.ts +15 -8
- package/lib/IconButton/IconButton.js +14 -6
- package/lib/IconButton/IconButton.js.map +1 -1
- package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.d.ts +1 -1
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +1 -1
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +1 -1
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.d.ts +1 -1
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js +1 -1
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js.map +1 -1
- package/lib/PasswordWidget/PasswordWidget.d.ts +1 -1
- package/lib/PasswordWidget/PasswordWidget.js +5 -5
- package/lib/PasswordWidget/PasswordWidget.js.map +1 -1
- package/lib/PrimeForm/PrimeForm.d.ts +3 -3
- package/lib/PrimeForm/PrimeForm.js.map +1 -1
- package/lib/RadioWidget/RadioWidget.d.ts +1 -1
- package/lib/RadioWidget/RadioWidget.js +5 -5
- package/lib/RadioWidget/RadioWidget.js.map +1 -1
- package/lib/RangeWidget/RangeWidget.d.ts +1 -1
- package/lib/RangeWidget/RangeWidget.js +5 -5
- package/lib/RangeWidget/RangeWidget.js.map +1 -1
- package/lib/SelectWidget/SelectWidget.d.ts +1 -1
- package/lib/SelectWidget/SelectWidget.js +18 -18
- package/lib/SelectWidget/SelectWidget.js.map +1 -1
- package/lib/SubmitButton/SubmitButton.d.ts +1 -1
- package/lib/SubmitButton/SubmitButton.js.map +1 -1
- package/lib/Templates/Templates.d.ts +1 -1
- package/lib/TextareaWidget/TextareaWidget.d.ts +1 -1
- package/lib/Theme/Theme.d.ts +2 -2
- package/lib/TitleField/TitleField.d.ts +1 -1
- package/lib/TitleField/TitleField.js.map +1 -1
- package/lib/UpDownWidget/UpDownWidget.d.ts +1 -1
- package/lib/UpDownWidget/UpDownWidget.js +5 -6
- package/lib/UpDownWidget/UpDownWidget.js.map +1 -1
- package/lib/Widgets/Widgets.d.ts +1 -1
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.d.ts +1 -1
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +1 -1
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/src/AddButton/AddButton.tsx +2 -1
- package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +2 -8
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +2 -10
- package/src/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.tsx +2 -8
- package/src/AutoCompleteWidget/AutoCompleteWidget.tsx +14 -18
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +13 -19
- package/src/CheckboxWidget/CheckboxWidget.tsx +10 -18
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +14 -13
- package/src/ColorWidget/ColorWidget.tsx +10 -16
- package/src/DescriptionField/DescriptionField.tsx +1 -1
- package/src/ErrorList/ErrorList.tsx +4 -3
- package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +4 -4
- package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +2 -1
- package/src/FieldTemplate/FieldTemplate.tsx +2 -8
- package/src/GridTemplate/GridTemplate.tsx +2 -2
- package/src/IconButton/IconButton.tsx +18 -8
- package/src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx +1 -1
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +2 -12
- package/src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx +3 -2
- package/src/PasswordWidget/PasswordWidget.tsx +10 -16
- package/src/PrimeForm/PrimeForm.ts +4 -3
- package/src/RadioWidget/RadioWidget.tsx +11 -13
- package/src/RangeWidget/RangeWidget.tsx +18 -18
- package/src/SelectWidget/SelectWidget.tsx +25 -28
- package/src/SubmitButton/SubmitButton.tsx +2 -1
- package/src/Templates/Templates.ts +1 -1
- package/src/TextareaWidget/TextareaWidget.tsx +2 -2
- package/src/Theme/Theme.ts +2 -2
- package/src/TitleField/TitleField.tsx +2 -1
- package/src/UpDownWidget/UpDownWidget.tsx +13 -18
- package/src/Widgets/Widgets.tsx +1 -1
- package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +2 -9
package/dist/primereact.umd.js
CHANGED
|
@@ -170,10 +170,10 @@
|
|
|
170
170
|
const { AutoCompleteWidget: AutoCompleteWidget2 } = registry.widgets;
|
|
171
171
|
const inputProps = utils.getInputProps(schema, type, options);
|
|
172
172
|
const primeProps = options.prime || {};
|
|
173
|
-
const
|
|
174
|
-
const
|
|
175
|
-
const
|
|
176
|
-
const
|
|
173
|
+
const handleChange = ({ target: { value: newValue } }) => onChange(newValue === "" ? options.emptyValue : newValue);
|
|
174
|
+
const handleBlur = () => onBlur && onBlur(id, value);
|
|
175
|
+
const handleFocus = () => onFocus && onFocus(id, value);
|
|
176
|
+
const handleClear = react.useCallback(
|
|
177
177
|
(e) => {
|
|
178
178
|
e.preventDefault();
|
|
179
179
|
e.stopPropagation();
|
|
@@ -199,13 +199,13 @@
|
|
|
199
199
|
list: schema.examples ? utils.examplesId(id) : void 0,
|
|
200
200
|
value: value || value === 0 ? value : "",
|
|
201
201
|
invalid: rawErrors.length > 0,
|
|
202
|
-
onChange: onChangeOverride ||
|
|
203
|
-
onBlur:
|
|
204
|
-
onFocus:
|
|
202
|
+
onChange: onChangeOverride || handleChange,
|
|
203
|
+
onBlur: handleBlur,
|
|
204
|
+
onFocus: handleFocus,
|
|
205
205
|
"aria-describedby": utils.ariaDescribedByIds(id, !!schema.examples)
|
|
206
206
|
}
|
|
207
207
|
),
|
|
208
|
-
options.allowClearTextInputs && !readonly && !disabled && value && /* @__PURE__ */ jsxRuntime.jsx(ClearButton2, { registry, onClick:
|
|
208
|
+
options.allowClearTextInputs && !readonly && !disabled && value && /* @__PURE__ */ jsxRuntime.jsx(ClearButton2, { registry, onClick: handleClear })
|
|
209
209
|
] });
|
|
210
210
|
}
|
|
211
211
|
function DescriptionField(props) {
|
|
@@ -225,7 +225,7 @@
|
|
|
225
225
|
/* @__PURE__ */ jsxRuntime.jsx(timescircle.TimesCircleIcon, { style: { width: "1.5rem", height: "1.5rem" } }),
|
|
226
226
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-message-summary", children: translateString(utils.TranslatableString.ErrorsLabel) })
|
|
227
227
|
] }),
|
|
228
|
-
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "p-message-list", children: errors.map((error
|
|
228
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "p-message-list", children: errors.map((error) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: error.stack }, error.stack)) })
|
|
229
229
|
] });
|
|
230
230
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
231
231
|
message.Message,
|
|
@@ -247,9 +247,7 @@
|
|
|
247
247
|
function FieldErrorTemplate({ errors, fieldPathId }) {
|
|
248
248
|
if (errors && errors.length > 0) {
|
|
249
249
|
const id = utils.errorId(fieldPathId);
|
|
250
|
-
const content = errors.map((error, i) => {
|
|
251
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { children: error }, i);
|
|
252
|
-
});
|
|
250
|
+
const content = errors.map((error, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { children: error }, i));
|
|
253
251
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
254
252
|
message.Message,
|
|
255
253
|
{
|
|
@@ -356,7 +354,8 @@
|
|
|
356
354
|
const [breakpoint, setBreakpoint] = react.useState(() => getBreakpoint(getInitialWidth()));
|
|
357
355
|
react.useEffect(() => {
|
|
358
356
|
if (typeof window === "undefined") {
|
|
359
|
-
return
|
|
357
|
+
return () => {
|
|
358
|
+
};
|
|
360
359
|
}
|
|
361
360
|
const handleResize = () => setBreakpoint(getBreakpoint(window.innerWidth));
|
|
362
361
|
window.addEventListener("resize", handleResize);
|
|
@@ -365,40 +364,47 @@
|
|
|
365
364
|
const span = getResponsiveSpan(props, breakpoint);
|
|
366
365
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { gridColumn: `span ${span} / span ${span}`, ...style ?? {} }, ...rest, children });
|
|
367
366
|
}
|
|
368
|
-
function
|
|
367
|
+
function IconButtonFn(props) {
|
|
369
368
|
const { icon, iconType, uiSchema, registry, ...otherProps } = props;
|
|
370
369
|
return /* @__PURE__ */ jsxRuntime.jsx(button.Button, { icon: `pi pi-${icon}`, rounded: true, text: true, severity: "secondary", ...otherProps });
|
|
371
370
|
}
|
|
372
|
-
|
|
371
|
+
var IconButton = react.memo(IconButtonFn);
|
|
372
|
+
var IconButton_default = IconButton;
|
|
373
|
+
function CopyButtonFn(props) {
|
|
373
374
|
const {
|
|
374
375
|
registry: { translateString }
|
|
375
376
|
} = props;
|
|
376
377
|
return /* @__PURE__ */ jsxRuntime.jsx(IconButton, { title: translateString(utils.TranslatableString.CopyButton), ...props, icon: "copy" });
|
|
377
378
|
}
|
|
378
|
-
|
|
379
|
+
var CopyButton = react.memo(CopyButtonFn);
|
|
380
|
+
function MoveDownButtonFn(props) {
|
|
379
381
|
const {
|
|
380
382
|
registry: { translateString }
|
|
381
383
|
} = props;
|
|
382
384
|
return /* @__PURE__ */ jsxRuntime.jsx(IconButton, { title: translateString(utils.TranslatableString.MoveDownButton), ...props, icon: "angle-down" });
|
|
383
385
|
}
|
|
384
|
-
|
|
386
|
+
var MoveDownButton = react.memo(MoveDownButtonFn);
|
|
387
|
+
function MoveUpButtonFn(props) {
|
|
385
388
|
const {
|
|
386
389
|
registry: { translateString }
|
|
387
390
|
} = props;
|
|
388
391
|
return /* @__PURE__ */ jsxRuntime.jsx(IconButton, { title: translateString(utils.TranslatableString.MoveUpButton), ...props, icon: "angle-up" });
|
|
389
392
|
}
|
|
390
|
-
|
|
393
|
+
var MoveUpButton = react.memo(MoveUpButtonFn);
|
|
394
|
+
function RemoveButtonFn(props) {
|
|
391
395
|
const {
|
|
392
396
|
registry: { translateString }
|
|
393
397
|
} = props;
|
|
394
398
|
return /* @__PURE__ */ jsxRuntime.jsx(IconButton, { title: translateString(utils.TranslatableString.RemoveButton), ...props, icon: "trash" });
|
|
395
399
|
}
|
|
396
|
-
|
|
400
|
+
var RemoveButton = react.memo(RemoveButtonFn);
|
|
401
|
+
function ClearButtonFn(props) {
|
|
397
402
|
const {
|
|
398
403
|
registry: { translateString }
|
|
399
404
|
} = props;
|
|
400
405
|
return /* @__PURE__ */ jsxRuntime.jsx(IconButton, { title: translateString(utils.TranslatableString.ClearButton), ...props, icon: "times" });
|
|
401
406
|
}
|
|
407
|
+
var ClearButton = react.memo(ClearButtonFn);
|
|
402
408
|
function MultiSchemaFieldTemplate(props) {
|
|
403
409
|
const { selector, optionSchemaField } = props;
|
|
404
410
|
return /* @__PURE__ */ jsxRuntime.jsxs(fieldset.Fieldset, { children: [
|
|
@@ -475,7 +481,7 @@
|
|
|
475
481
|
const { id, registry, label, onAddClick, onRemoveClick } = props;
|
|
476
482
|
if (onAddClick) {
|
|
477
483
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
478
|
-
|
|
484
|
+
IconButton_default,
|
|
479
485
|
{
|
|
480
486
|
id,
|
|
481
487
|
registry,
|
|
@@ -486,7 +492,8 @@
|
|
|
486
492
|
style: { height: "1.5rem", width: "1.5rem" }
|
|
487
493
|
}
|
|
488
494
|
);
|
|
489
|
-
}
|
|
495
|
+
}
|
|
496
|
+
if (onRemoveClick) {
|
|
490
497
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
491
498
|
RemoveButton,
|
|
492
499
|
{
|
|
@@ -646,9 +653,9 @@
|
|
|
646
653
|
} = props;
|
|
647
654
|
const inputProps = utils.getInputProps(schema, type, options);
|
|
648
655
|
const primeProps = options.prime || {};
|
|
649
|
-
const
|
|
650
|
-
const
|
|
651
|
-
const
|
|
656
|
+
const handleChange = ({ target: { value: newValue } }) => onChange(newValue === "" ? options.emptyValue : newValue);
|
|
657
|
+
const handleBlur = () => onBlur && onBlur(id, value);
|
|
658
|
+
const handleFocus = () => onFocus && onFocus(id, value);
|
|
652
659
|
const examples = schema.examples.concat(
|
|
653
660
|
schema.default && !schema.examples.includes(schema.default.toString()) ? [schema.default.toString()] : []
|
|
654
661
|
);
|
|
@@ -664,7 +671,7 @@
|
|
|
664
671
|
placeholder,
|
|
665
672
|
...primeProps,
|
|
666
673
|
...inputProps,
|
|
667
|
-
loadingIcon:
|
|
674
|
+
loadingIcon: null,
|
|
668
675
|
required,
|
|
669
676
|
autoFocus: autofocus,
|
|
670
677
|
disabled: disabled || readonly,
|
|
@@ -673,9 +680,9 @@
|
|
|
673
680
|
value: value || value === 0 ? value : "",
|
|
674
681
|
dropdown: true,
|
|
675
682
|
invalid: rawErrors.length > 0,
|
|
676
|
-
onChange: onChangeOverride ||
|
|
677
|
-
onBlur:
|
|
678
|
-
onFocus:
|
|
683
|
+
onChange: onChangeOverride || handleChange,
|
|
684
|
+
onBlur: handleBlur,
|
|
685
|
+
onFocus: handleFocus,
|
|
679
686
|
"aria-describedby": utils.ariaDescribedByIds(id, !!schema.examples),
|
|
680
687
|
pt: {
|
|
681
688
|
root: {
|
|
@@ -715,7 +722,7 @@
|
|
|
715
722
|
const { enumOptions, enumDisabled } = options;
|
|
716
723
|
const primeProps = options.prime || {};
|
|
717
724
|
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
718
|
-
const
|
|
725
|
+
const handleChange = (index) => (e) => {
|
|
719
726
|
if (e.checked) {
|
|
720
727
|
onChange(utils.enumOptionsSelectValue(index, checkboxesValues, enumOptions));
|
|
721
728
|
} else {
|
|
@@ -727,8 +734,8 @@
|
|
|
727
734
|
registry,
|
|
728
735
|
options
|
|
729
736
|
);
|
|
730
|
-
const
|
|
731
|
-
const
|
|
737
|
+
const handleBlur = () => onBlur(id, value);
|
|
738
|
+
const handleFocus = () => onFocus(id, value);
|
|
732
739
|
const description = options.description ?? schema.description;
|
|
733
740
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
734
741
|
"div",
|
|
@@ -748,26 +755,33 @@
|
|
|
748
755
|
),
|
|
749
756
|
Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
750
757
|
const checked = utils.enumOptionsIsSelected(option.value, checkboxesValues);
|
|
751
|
-
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.
|
|
752
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
{
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
758
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.includes(option.value);
|
|
759
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
760
|
+
"div",
|
|
761
|
+
{
|
|
762
|
+
style: { display: "flex", flexDirection: "row", gap: "0.5rem", alignItems: "center" },
|
|
763
|
+
children: [
|
|
764
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
765
|
+
checkbox.Checkbox,
|
|
766
|
+
{
|
|
767
|
+
inputId: utils.optionId(id, index),
|
|
768
|
+
name: htmlName || id,
|
|
769
|
+
...primeProps,
|
|
770
|
+
value: option.value,
|
|
771
|
+
checked,
|
|
772
|
+
disabled: disabled || itemDisabled || readonly,
|
|
773
|
+
autoFocus: autofocus && index === 0,
|
|
774
|
+
onChange: handleChange(index),
|
|
775
|
+
onBlur: handleBlur,
|
|
776
|
+
onFocus: handleFocus,
|
|
777
|
+
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
778
|
+
}
|
|
779
|
+
),
|
|
780
|
+
/* @__PURE__ */ jsxRuntime.jsx(Label, { id: utils.optionId(id, index), text: option.label })
|
|
781
|
+
]
|
|
782
|
+
},
|
|
783
|
+
String(option.value)
|
|
784
|
+
);
|
|
771
785
|
})
|
|
772
786
|
]
|
|
773
787
|
}
|
|
@@ -798,9 +812,9 @@
|
|
|
798
812
|
);
|
|
799
813
|
const required = utils.schemaRequiresTrueValue(schema);
|
|
800
814
|
const checked = value === "true" || value === true;
|
|
801
|
-
const
|
|
802
|
-
const
|
|
803
|
-
const
|
|
815
|
+
const handleChange = (e) => onChange && onChange(e.checked);
|
|
816
|
+
const handleBlur = () => onBlur && onBlur(id, value);
|
|
817
|
+
const handleFocus = () => onFocus && onFocus(id, value);
|
|
804
818
|
const description = options.description ?? schema.description;
|
|
805
819
|
const primeProps = options.prime || {};
|
|
806
820
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -824,9 +838,9 @@
|
|
|
824
838
|
disabled: disabled || readonly,
|
|
825
839
|
autoFocus: autofocus,
|
|
826
840
|
checked: typeof value === "undefined" ? false : checked,
|
|
827
|
-
onChange:
|
|
828
|
-
onBlur:
|
|
829
|
-
onFocus:
|
|
841
|
+
onChange: handleChange,
|
|
842
|
+
onBlur: handleBlur,
|
|
843
|
+
onFocus: handleFocus,
|
|
830
844
|
required,
|
|
831
845
|
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
832
846
|
}
|
|
@@ -855,9 +869,9 @@
|
|
|
855
869
|
const inputProps = utils.getInputProps(schema, type, options);
|
|
856
870
|
const { inline } = options;
|
|
857
871
|
const primeProps = options.prime || {};
|
|
858
|
-
const
|
|
859
|
-
const
|
|
860
|
-
const
|
|
872
|
+
const handleChange = ({ target: { value: newValue } }) => onChange(newValue === "" ? options.emptyValue : newValue);
|
|
873
|
+
const handleBlur = () => onBlur && onBlur(id, value);
|
|
874
|
+
const handleFocus = () => onFocus && onFocus(id, value);
|
|
861
875
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
862
876
|
colorpicker.ColorPicker,
|
|
863
877
|
{
|
|
@@ -871,9 +885,9 @@
|
|
|
871
885
|
autoFocus: autofocus,
|
|
872
886
|
disabled: disabled || readonly,
|
|
873
887
|
value: value || "",
|
|
874
|
-
onChange: onChangeOverride ||
|
|
875
|
-
onBlur:
|
|
876
|
-
onFocus:
|
|
888
|
+
onChange: onChangeOverride || handleChange,
|
|
889
|
+
onBlur: handleBlur,
|
|
890
|
+
onFocus: handleFocus,
|
|
877
891
|
"aria-describedby": utils.ariaDescribedByIds(id, !!schema.examples)
|
|
878
892
|
}
|
|
879
893
|
);
|
|
@@ -898,9 +912,9 @@
|
|
|
898
912
|
} = props;
|
|
899
913
|
const inputProps = utils.getInputProps(schema, type, options);
|
|
900
914
|
const primeProps = options.prime || {};
|
|
901
|
-
const
|
|
902
|
-
const
|
|
903
|
-
const
|
|
915
|
+
const handleChange = ({ target: { value: newValue } }) => onChange(newValue === "" ? options.emptyValue : newValue);
|
|
916
|
+
const handleBlur = () => onBlur && onBlur(id, value);
|
|
917
|
+
const handleFocus = () => onFocus && onFocus(id, value);
|
|
904
918
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
905
919
|
password.Password,
|
|
906
920
|
{
|
|
@@ -914,9 +928,9 @@
|
|
|
914
928
|
disabled: disabled || readonly,
|
|
915
929
|
value: value || "",
|
|
916
930
|
invalid: rawErrors.length > 0,
|
|
917
|
-
onChange: onChangeOverride ||
|
|
918
|
-
onBlur:
|
|
919
|
-
onFocus:
|
|
931
|
+
onChange: onChangeOverride || handleChange,
|
|
932
|
+
onBlur: handleBlur,
|
|
933
|
+
onFocus: handleFocus,
|
|
920
934
|
"aria-describedby": utils.ariaDescribedByIds(id, !!schema.examples),
|
|
921
935
|
pt: { root: { style: { display: "flex", flexDirection: "column" } } }
|
|
922
936
|
}
|
|
@@ -927,14 +941,14 @@
|
|
|
927
941
|
const primeProps = options.prime || {};
|
|
928
942
|
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
929
943
|
const optionValueFormat = utils.getOptionValueFormat(options);
|
|
930
|
-
const
|
|
944
|
+
const handleChange = (e) => {
|
|
931
945
|
onChange(utils.enumOptionValueDecoder(e.value, enumOptions, optionValueFormat, emptyValue));
|
|
932
946
|
};
|
|
933
|
-
const
|
|
934
|
-
const
|
|
947
|
+
const handleBlur = () => onBlur(id, value);
|
|
948
|
+
const handleFocus = () => onFocus(id, value);
|
|
935
949
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "row", gap: "1rem" }, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
936
950
|
const checked = utils.enumOptionsIsSelected(option.value, value);
|
|
937
|
-
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.
|
|
951
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.includes(option.value);
|
|
938
952
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [
|
|
939
953
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
940
954
|
radiobutton.RadioButton,
|
|
@@ -942,9 +956,9 @@
|
|
|
942
956
|
inputId: utils.optionId(id, index),
|
|
943
957
|
name: htmlName || id,
|
|
944
958
|
...primeProps,
|
|
945
|
-
onFocus:
|
|
946
|
-
onBlur:
|
|
947
|
-
onChange:
|
|
959
|
+
onFocus: handleFocus,
|
|
960
|
+
onBlur: handleBlur,
|
|
961
|
+
onChange: handleChange,
|
|
948
962
|
value: utils.enumOptionValueEncoder(option.value, index, optionValueFormat),
|
|
949
963
|
checked,
|
|
950
964
|
disabled: disabled || itemDisabled || readonly,
|
|
@@ -952,31 +966,31 @@
|
|
|
952
966
|
}
|
|
953
967
|
),
|
|
954
968
|
/* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: utils.optionId(id, index), style: { marginLeft: "8px" }, children: option.label })
|
|
955
|
-
] },
|
|
969
|
+
] }, String(option.value));
|
|
956
970
|
}) });
|
|
957
971
|
}
|
|
958
972
|
function RangeWidget(props) {
|
|
959
973
|
const { value, readonly, disabled, onBlur, onFocus, options, schema, onChange, id } = props;
|
|
960
974
|
const primeProps = options.prime || {};
|
|
961
975
|
const sliderProps = { value, id, ...utils.rangeSpec(schema) };
|
|
962
|
-
const
|
|
976
|
+
const handleChange = (e) => {
|
|
963
977
|
onChange(e.value ?? options.emptyValue);
|
|
964
978
|
};
|
|
965
|
-
const
|
|
966
|
-
const
|
|
967
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
979
|
+
const handleBlur = ({ target }) => onBlur(id, target && target.value);
|
|
980
|
+
const handleFocus = ({ target }) => onFocus(id, target && target.value);
|
|
981
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
968
982
|
slider.Slider,
|
|
969
983
|
{
|
|
970
984
|
...primeProps,
|
|
971
985
|
disabled: disabled || readonly,
|
|
972
986
|
onMouseDown: (e) => e.stopPropagation(),
|
|
973
|
-
onChange:
|
|
974
|
-
onBlur:
|
|
975
|
-
onFocus:
|
|
987
|
+
onChange: handleChange,
|
|
988
|
+
onBlur: handleBlur,
|
|
989
|
+
onFocus: handleFocus,
|
|
976
990
|
...sliderProps,
|
|
977
991
|
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
978
992
|
}
|
|
979
|
-
)
|
|
993
|
+
);
|
|
980
994
|
}
|
|
981
995
|
function SelectWidget(props) {
|
|
982
996
|
const { multiple = false } = props;
|
|
@@ -1011,11 +1025,11 @@
|
|
|
1011
1025
|
const { enumOptions, enumDisabled, emptyValue: optEmptyVal } = options;
|
|
1012
1026
|
const optionValueFormat = utils.getOptionValueFormat(options);
|
|
1013
1027
|
const primeProps = options.prime || {};
|
|
1014
|
-
|
|
1015
|
-
const emptyValue =
|
|
1016
|
-
const
|
|
1017
|
-
const
|
|
1018
|
-
const
|
|
1028
|
+
const isMultiple = typeof multiple === "undefined" ? false : multiple;
|
|
1029
|
+
const emptyValue = isMultiple ? [] : "";
|
|
1030
|
+
const handleChange = (e) => onChange(utils.enumOptionValueDecoder(e.value, enumOptions, optionValueFormat, optEmptyVal));
|
|
1031
|
+
const handleBlur = ({ target }) => onBlur(id, utils.enumOptionValueDecoder(target && target.value, enumOptions, optionValueFormat, optEmptyVal));
|
|
1032
|
+
const handleFocus = ({ target }) => onFocus(id, utils.enumOptionValueDecoder(target && target.value, enumOptions, optionValueFormat, optEmptyVal));
|
|
1019
1033
|
const { ...dropdownRemainingProps } = dropdownProps;
|
|
1020
1034
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1021
1035
|
dropdown.Dropdown,
|
|
@@ -1023,15 +1037,15 @@
|
|
|
1023
1037
|
id,
|
|
1024
1038
|
name: htmlName || id,
|
|
1025
1039
|
...primeProps,
|
|
1026
|
-
value: utils.enumOptionSelectedValue(value, enumOptions,
|
|
1027
|
-
options: (enumOptions ?? []).map(({ value:
|
|
1028
|
-
label:
|
|
1029
|
-
value: utils.enumOptionValueEncoder(
|
|
1030
|
-
disabled: Array.isArray(enumDisabled) && enumDisabled.
|
|
1040
|
+
value: utils.enumOptionSelectedValue(value, enumOptions, isMultiple, optionValueFormat, emptyValue),
|
|
1041
|
+
options: (enumOptions ?? []).map(({ value: enumValue, label: enumLabel }, i) => ({
|
|
1042
|
+
label: enumLabel,
|
|
1043
|
+
value: utils.enumOptionValueEncoder(enumValue, i, optionValueFormat),
|
|
1044
|
+
disabled: Array.isArray(enumDisabled) && enumDisabled.includes(enumValue)
|
|
1031
1045
|
})),
|
|
1032
|
-
onChange:
|
|
1033
|
-
onBlur:
|
|
1034
|
-
onFocus:
|
|
1046
|
+
onChange: handleChange,
|
|
1047
|
+
onBlur: handleBlur,
|
|
1048
|
+
onFocus: handleFocus,
|
|
1035
1049
|
placeholder,
|
|
1036
1050
|
disabled: disabled || readonly,
|
|
1037
1051
|
autoFocus: autofocus,
|
|
@@ -1058,9 +1072,9 @@
|
|
|
1058
1072
|
const optionValueFormat = utils.getOptionValueFormat(options);
|
|
1059
1073
|
const primeProps = options.prime || {};
|
|
1060
1074
|
const emptyValue = multiple ? [] : "";
|
|
1061
|
-
const
|
|
1062
|
-
const
|
|
1063
|
-
const
|
|
1075
|
+
const handleChange = (e) => onChange(utils.enumOptionValueDecoder(e.value, enumOptions, optionValueFormat, optEmptyVal));
|
|
1076
|
+
const handleBlur = ({ target }) => onBlur(id, utils.enumOptionValueDecoder(target && target.value, enumOptions, optionValueFormat, optEmptyVal));
|
|
1077
|
+
const handleFocus = ({ target }) => onFocus(id, utils.enumOptionValueDecoder(target && target.value, enumOptions, optionValueFormat, optEmptyVal));
|
|
1064
1078
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1065
1079
|
multiselect.MultiSelect,
|
|
1066
1080
|
{
|
|
@@ -1068,14 +1082,14 @@
|
|
|
1068
1082
|
name: htmlName || id,
|
|
1069
1083
|
...primeProps,
|
|
1070
1084
|
value: utils.enumOptionSelectedValue(value, enumOptions, multiple, optionValueFormat, emptyValue),
|
|
1071
|
-
options: (enumOptions ?? []).map(({ value:
|
|
1072
|
-
label,
|
|
1073
|
-
value: utils.enumOptionValueEncoder(
|
|
1074
|
-
disabled: Array.isArray(enumDisabled) && enumDisabled.
|
|
1085
|
+
options: (enumOptions ?? []).map(({ value: enumValue, label: enumLabel }, i) => ({
|
|
1086
|
+
label: enumLabel,
|
|
1087
|
+
value: utils.enumOptionValueEncoder(enumValue, i, optionValueFormat),
|
|
1088
|
+
disabled: Array.isArray(enumDisabled) && enumDisabled.includes(enumValue)
|
|
1075
1089
|
})),
|
|
1076
|
-
onChange:
|
|
1077
|
-
onBlur:
|
|
1078
|
-
onFocus:
|
|
1090
|
+
onChange: handleChange,
|
|
1091
|
+
onBlur: handleBlur,
|
|
1092
|
+
onFocus: handleFocus,
|
|
1079
1093
|
placeholder,
|
|
1080
1094
|
disabled: disabled || readonly,
|
|
1081
1095
|
autoFocus: autofocus,
|
|
@@ -1133,9 +1147,9 @@
|
|
|
1133
1147
|
const inputProps = utils.getInputProps(schema, type, options);
|
|
1134
1148
|
const { showButtons, buttonLayout, useGrouping, minFractionDigits, maxFractionDigits, locale, currency } = options;
|
|
1135
1149
|
const primeProps = options.prime || {};
|
|
1136
|
-
const
|
|
1137
|
-
const
|
|
1138
|
-
const
|
|
1150
|
+
const handleChange = (event) => onChange(event.value === null ? options.emptyValue : value);
|
|
1151
|
+
const handleBlur = () => onBlur && onBlur(id, value);
|
|
1152
|
+
const handleFocus = () => onFocus && onFocus(id, value);
|
|
1139
1153
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1140
1154
|
inputnumber.InputNumber,
|
|
1141
1155
|
{
|
|
@@ -1143,7 +1157,7 @@
|
|
|
1143
1157
|
name: id,
|
|
1144
1158
|
...primeProps,
|
|
1145
1159
|
placeholder,
|
|
1146
|
-
step: isNaN(Number(inputProps.step)) ? 1 : Number(inputProps.step),
|
|
1160
|
+
step: Number.isNaN(Number(inputProps.step)) ? 1 : Number(inputProps.step),
|
|
1147
1161
|
required,
|
|
1148
1162
|
autoFocus: autofocus,
|
|
1149
1163
|
disabled: disabled || readonly,
|
|
@@ -1156,11 +1170,11 @@
|
|
|
1156
1170
|
locale,
|
|
1157
1171
|
mode: currency ? "currency" : "decimal",
|
|
1158
1172
|
currency,
|
|
1159
|
-
value: isNaN(Number(value)) ? null : Number(value),
|
|
1173
|
+
value: Number.isNaN(Number(value)) ? null : Number(value),
|
|
1160
1174
|
invalid: rawErrors.length > 0,
|
|
1161
|
-
onChange: onChangeOverride ||
|
|
1162
|
-
onBlur:
|
|
1163
|
-
onFocus:
|
|
1175
|
+
onChange: onChangeOverride || handleChange,
|
|
1176
|
+
onBlur: handleBlur,
|
|
1177
|
+
onFocus: handleFocus,
|
|
1164
1178
|
"aria-describedby": utils.ariaDescribedByIds(id, !!schema.examples)
|
|
1165
1179
|
}
|
|
1166
1180
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
1
|
+
import type { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
2
|
/** The `AddButton` renders a button that represents the `Add` action on a form
|
|
3
3
|
*/
|
|
4
4
|
export default function AddButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ uiSchema, registry, color, ...props }: IconButtonProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddButton.js","sourceRoot":"","sources":["../../src/AddButton/AddButton.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"AddButton.js","sourceRoot":"","sources":["../../src/AddButton/AddButton.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C;GACG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAoF,EACnH,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,GAAG,KAAK,EACiB;IACzB,MAAM,EAAE,eAAe,EAAE,GAAG,QAAQ,CAAC;IACrC,OAAO,CACL,KAAC,MAAM,IACL,KAAK,EAAE,eAAe,CAAC,kBAAkB,CAAC,aAAa,CAAC,EACxD,IAAI,EAAC,YAAY,EACjB,QAAQ,QACR,QAAQ,EAAC,WAAW,EACpB,IAAI,EAAC,OAAO,KACR,KAAK,GACT,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ArrayFieldItemTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
1
|
+
import type { ArrayFieldItemTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
2
|
/** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
|
|
3
3
|
*
|
|
4
4
|
* @param props - The `ArrayFieldItemTemplateProps` props for the component
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { getTemplate, getUiOptions
|
|
2
|
+
import { getTemplate, getUiOptions } from '@rjsf/utils';
|
|
3
3
|
/** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
|
|
4
4
|
*
|
|
5
5
|
* @param props - The `ArrayFieldItemTemplateProps` props for the component
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayFieldItemTemplate.js","sourceRoot":"","sources":["../../src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ArrayFieldItemTemplate.js","sourceRoot":"","sources":["../../src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAExD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAI5C,KAA2C;IAC3C,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACvF,MAAM,SAAS,GAAG,YAAY,CAAU,QAAQ,CAAC,CAAC;IAClD,MAAM,6BAA6B,GAAG,WAAW,CAC/C,+BAA+B,EAC/B,QAAQ,EACR,SAAS,CACV,CAAC;IACF,OAAO,CACL,eAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,aACjC,UAAU,IAAI,CACb,cAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,YAC3E,UAAU,IAAI,CACb,cAAK,KAAK,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,YAClC,KAAC,6BAA6B,OAAK,YAAY,GAAI,GAC/C,CACP,GACG,CACP,EACA,QAAQ,IACL,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ArrayFieldTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
1
|
+
import type { ArrayFieldTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
2
|
/** The `ArrayFieldTemplate` component is the template used to render all items in an array.
|
|
3
3
|
*
|
|
4
4
|
* @param props - The `ArrayFieldTemplateProps` props for the component
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { getTemplate, getUiOptions, isFixedItems, buttonId
|
|
2
|
+
import { getTemplate, getUiOptions, isFixedItems, buttonId } from '@rjsf/utils';
|
|
3
3
|
import { Fieldset } from 'primereact/fieldset';
|
|
4
4
|
import AddButton from '../AddButton/index.js';
|
|
5
5
|
/** The `ArrayFieldTemplate` component is the template used to render all items in an array.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayFieldTemplate.js","sourceRoot":"","sources":["../../src/ArrayFieldTemplate/ArrayFieldTemplate.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ArrayFieldTemplate.js","sourceRoot":"","sources":["../../src/ArrayFieldTemplate/ArrayFieldTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAIxC,KAAuC;IACvC,MAAM,EACJ,QAAQ,EACR,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,KAAK,EACL,mBAAmB,EACnB,UAAU,EACV,QAAQ,EACR,MAAM,EACN,KAAK,EACL,QAAQ,EACR,QAAQ;IACR,2EAA2E;IAC3E,QAAQ,EACR,SAAS,EACT,GAAG,IAAI,EACR,GAAG,KAAK,CAAC;IAEV,MAAM,SAAS,GAAG,YAAY,CAAU,QAAQ,CAAC,CAAC;IAClD,MAAM,6BAA6B,GAAG,WAAW,CAC/C,+BAA+B,EAC/B,QAAQ,EACR,SAAS,CACV,CAAC;IACF,MAAM,uBAAuB,GAAG,WAAW,CACzC,yBAAyB,EACzB,QAAQ,EACR,SAAS,CACV,CAAC;IACF,MAAM,8BAA8B,GAAG,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC;IAE9D,OAAO,CACL,8BACE,KAAC,uBAAuB,IACtB,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,SAAS,CAAC,KAAK,IAAI,KAAK,EAC/B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,mBAAmB,EAAE,8BAA8B,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,GACrF,EACF,MAAC,QAAQ,OACH,IAAI,EACR,EAAE,EAAE,WAAW,CAAC,GAAG,EACnB,SAAS,EAAE,GAAG,SAAS,GAAG,YAAY,CAAI,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,uBAAuB,EAAE,aAElF,KAAC,6BAA6B,IAC5B,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,SAAS,CAAC,WAAW,IAAI,MAAM,CAAC,WAAW,EACxD,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB,EACF,0BACE,0BACG,CAAC,8BAA8B,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,EACjE,KAAK,IACF,EACL,MAAM,IAAI,CACT,cACE,KAAK,EAAE;oCACL,SAAS,EAAE,MAAM;oCACjB,QAAQ,EAAE,UAAU;oCACpB,SAAS,EAAE,OAAO;iCACnB,YAED,KAAC,SAAS,IACR,EAAE,EAAE,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC,EAChC,SAAS,EAAC,qBAAqB,EAC/B,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAC9B,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB,GACE,CACP,KAtBO,mBAAmB,WAAW,CAAC,GAAG,EAAE,CAuBxC,IACG,IACV,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ArrayFieldTitleProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
1
|
+
import type { ArrayFieldTitleProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
2
|
/** The `ArrayFieldTitleTemplate` component renders a header for the array.
|
|
3
3
|
*
|
|
4
4
|
* @param props - The `ArrayFieldTitleProps` for the component
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { getUiOptions, titleId
|
|
2
|
+
import { getUiOptions, titleId } from '@rjsf/utils';
|
|
3
3
|
/** The `ArrayFieldTitleTemplate` component renders a header for the array.
|
|
4
4
|
*
|
|
5
5
|
* @param props - The `ArrayFieldTitleProps` for the component
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayFieldTitleTemplate.js","sourceRoot":"","sources":["../../src/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ArrayFieldTitleTemplate.js","sourceRoot":"","sources":["../../src/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAI7C,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,mBAAmB,EAAiC;IAC9F,MAAM,SAAS,GAAG,YAAY,CAAU,QAAQ,CAAC,CAAC;IAClD,IAAI,OAAO,GAAG,CACZ,cAAI,EAAE,EAAE,OAAO,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,aAC3F,SAAS,CAAC,KAAK,IAAI,KAAK,OAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAC5C,CACN,CAAC;IACF,IAAI,mBAAmB,EAAE,CAAC;QACxB,OAAO,GAAG,CACR,eAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,aAC7B,cAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,YAAG,OAAO,GAAO,EAC5C,wBAAM,mBAAmB,GAAO,IAC5B,CACP,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
1
|
+
import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
2
2
|
/** The `AutoCompleteWidget` is a widget for rendering a field with options.
|
|
3
3
|
* This is used instead of the base input template if the schema has examples.
|
|
4
4
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import { ariaDescribedByIds, getInputProps
|
|
3
|
+
import { ariaDescribedByIds, getInputProps } from '@rjsf/utils';
|
|
4
4
|
import { AutoComplete } from 'primereact/autocomplete';
|
|
5
5
|
/** The `AutoCompleteWidget` is a widget for rendering a field with options.
|
|
6
6
|
* This is used instead of the base input template if the schema has examples.
|
|
@@ -11,9 +11,9 @@ export default function AutoCompleteWidget(props) {
|
|
|
11
11
|
const { id, placeholder, value, required, readonly, disabled, onChange, onChangeOverride, onBlur, onFocus, autofocus, options, schema, type, rawErrors = [], } = props;
|
|
12
12
|
const inputProps = getInputProps(schema, type, options);
|
|
13
13
|
const primeProps = (options.prime || {});
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
14
|
+
const handleChange = ({ target: { value: newValue } }) => onChange(newValue === '' ? options.emptyValue : newValue);
|
|
15
|
+
const handleBlur = () => onBlur && onBlur(id, value);
|
|
16
|
+
const handleFocus = () => onFocus && onFocus(id, value);
|
|
17
17
|
const examples = schema.examples.concat(schema.default && !schema.examples.includes(schema.default.toString())
|
|
18
18
|
? [schema.default.toString()]
|
|
19
19
|
: []);
|
|
@@ -21,7 +21,7 @@ export default function AutoCompleteWidget(props) {
|
|
|
21
21
|
const search = (event) => {
|
|
22
22
|
setItems(examples.filter((example) => example.toString().toLowerCase().includes(event.query.toLowerCase())));
|
|
23
23
|
};
|
|
24
|
-
return (_jsx(AutoComplete, { id: id, name: id, placeholder: placeholder, ...primeProps, ...inputProps, loadingIcon:
|
|
24
|
+
return (_jsx(AutoComplete, { id: id, name: id, placeholder: placeholder, ...primeProps, ...inputProps, loadingIcon: null, required: required, autoFocus: autofocus, disabled: disabled || readonly, suggestions: items, completeMethod: search, value: value || value === 0 ? value : '', dropdown: true, invalid: rawErrors.length > 0, onChange: onChangeOverride || handleChange, onBlur: handleBlur, onFocus: handleFocus, "aria-describedby": ariaDescribedByIds(id, !!schema.examples),
|
|
25
25
|
/* Make autocomplete look like a dropdown, which looks much nicer */
|
|
26
26
|
pt: {
|
|
27
27
|
root: {
|