react-jsonschema-form-extras 0.9.83 → 1.0.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/README.md CHANGED
@@ -787,7 +787,7 @@ All properties are configured under the `multiTypeahead` object in uiSchema:
787
787
  - `label` (string): Optional label for the field.
788
788
  - `placeholder` (string): Optional placeholder text (default: "Select...").
789
789
  - `labelTemplate` (string): Template for displaying option labels. Use `{fieldName}` syntax to reference object properties (e.g., `"{name} - {category}"`).
790
- - `valueKeys` (array): Array of keys to extract from selected options for the form value (default: `["value"]`).
790
+ - `valueKeys` (array): Array of keys to extract from selected options for the form value (default: `["value"]`). **Note**: When using nested property paths (e.g., `"user.profile.name"`), only the last part of the key chain (`"name"`) will be used as the property name in the resulting value object.
791
791
 
792
792
  ### Key Features
793
793
 
@@ -920,6 +920,43 @@ const uiSchema = {
920
920
  };
921
921
  ```
922
922
 
923
+ #### ValueKeys with Nested Properties Example
924
+
925
+ ```js
926
+ // Options with nested properties
927
+ const options = [
928
+ {
929
+ user: { profile: { name: "John Doe" }, id: 123 },
930
+ department: { info: { title: "Engineering" } },
931
+ role: "Developer"
932
+ }
933
+ ];
934
+
935
+ const uiSchema = {
936
+ employees: {
937
+ "ui:field": "multiTypeahead",
938
+ multiTypeahead: {
939
+ options: options,
940
+ labelTemplate: "{user.profile.name} - {role}",
941
+ valueKeys: [
942
+ "user.profile.name",
943
+ "user.id",
944
+ "department.info.title",
945
+ "role"
946
+ ]
947
+ }
948
+ }
949
+ };
950
+
951
+ // Resulting value object for selected option will be:
952
+ // {
953
+ // name: "John Doe", // from user.profile.name (uses last part: "name")
954
+ // id: 123, // from user.id (uses last part: "id")
955
+ // title: "Engineering", // from department.info.title (uses last part: "title")
956
+ // role: "Developer" // from role (uses last part: "role")
957
+ // }
958
+ ```
959
+
923
960
  ### Custom Styling
924
961
 
925
962
  All styles are handled via JSS (`withStyles`) in the component. The styling is designed to be consistent and follows Material-UI design patterns with custom color overrides: