@rjsf/fluentui-rc 5.19.2 → 5.19.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rjsf/fluentui-rc",
3
- "version": "5.19.2",
3
+ "version": "5.19.3",
4
4
  "description": "FluentUI React Components theme, fields and widgets for react-jsonschema-form",
5
5
  "scripts": {
6
6
  "build:ts": "tsc -b",
@@ -52,10 +52,10 @@
52
52
  "@babel/preset-env": "^7.23.9",
53
53
  "@babel/preset-react": "^7.23.3",
54
54
  "@babel/preset-typescript": "^7.23.3",
55
- "@rjsf/core": "^5.19.2",
56
- "@rjsf/snapshot-tests": "^5.19.2",
57
- "@rjsf/utils": "^5.19.2",
58
- "@rjsf/validator-ajv8": "^5.19.2",
55
+ "@rjsf/core": "^5.19.3",
56
+ "@rjsf/snapshot-tests": "^5.19.3",
57
+ "@rjsf/utils": "^5.19.3",
58
+ "@rjsf/validator-ajv8": "^5.19.3",
59
59
  "@types/jest": "^29.5.12",
60
60
  "@types/react": "^18.2.58",
61
61
  "@types/react-dom": "^18.2.19",
@@ -93,5 +93,5 @@
93
93
  "publishConfig": {
94
94
  "access": "public"
95
95
  },
96
- "gitHead": "dfdb9f6f35fa22d79b0502b85241b031a61adecc"
96
+ "gitHead": "3d0a309c23e6f6da116b350faead174dade7ca40"
97
97
  }
@@ -38,6 +38,8 @@ function SelectWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extend
38
38
  onChange,
39
39
  onBlur,
40
40
  onFocus,
41
+ schema,
42
+ placeholder,
41
43
  }: WidgetProps<T, S, F>) {
42
44
  const { enumOptions, enumDisabled, emptyValue: optEmptyVal } = options;
43
45
 
@@ -60,6 +62,7 @@ function SelectWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extend
60
62
  const newValue = getValue(data, multiple);
61
63
  return onChange(enumOptionsValueForIndex<S>(newValue, enumOptions, optEmptyVal));
62
64
  };
65
+ const showPlaceholderOption = !multiple && schema.default === undefined;
63
66
 
64
67
  return (
65
68
  <Field
@@ -81,6 +84,7 @@ function SelectWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extend
81
84
  selectedOptions={selectedIndexesAsArray}
82
85
  aria-describedby={ariaDescribedByIds<T>(id)}
83
86
  >
87
+ {showPlaceholderOption && <Option value=''>{placeholder || ''}</Option>}
84
88
  {Array.isArray(enumOptions) &&
85
89
  enumOptions.map(({ value, label }, i) => {
86
90
  const disabled = enumDisabled && enumDisabled.indexOf(value) !== -1;