@abgov/jsonforms-components 1.25.6 → 1.26.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.
Files changed (2) hide show
  1. package/index.esm.js +9 -1
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -4032,6 +4032,7 @@ const EnumSelect = props => {
4032
4032
  } = props;
4033
4033
  const registerCtx = useContext(JsonFormsRegisterContext);
4034
4034
  const registerConfig = fetchRegisterConfigFromOptions((_b = (_a = props.uischema) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.register);
4035
+ // eslint-disable-next-line react-hooks/exhaustive-deps
4035
4036
  let registerData = [];
4036
4037
  if (registerConfig) {
4037
4038
  registerData = registerCtx === null || registerCtx === void 0 ? void 0 : registerCtx.selectRegisterData(registerConfig);
@@ -4039,7 +4040,7 @@ const EnumSelect = props => {
4039
4040
  const autocompletion = ((_d = (_c = props.uischema) === null || _c === void 0 ? void 0 : _c.options) === null || _d === void 0 ? void 0 : _d.autocomplete) === true;
4040
4041
  const appliedUiSchemaOptions = merge({}, config, props.uischema.options);
4041
4042
  const mergedOptions = useMemo(() => {
4042
- return [...(options || []), ...registerData.map(d => {
4043
+ const newOptions = [...(options || []), ...registerData.map(d => {
4043
4044
  if (typeof d === 'string') {
4044
4045
  return {
4045
4046
  value: d,
@@ -4049,6 +4050,13 @@ const EnumSelect = props => {
4049
4050
  return Object.assign({}, d);
4050
4051
  }
4051
4052
  })];
4053
+ if (newOptions && newOptions.length === 0) {
4054
+ newOptions.push({
4055
+ label: '',
4056
+ value: ''
4057
+ });
4058
+ }
4059
+ return newOptions;
4052
4060
  }, [registerData, options]);
4053
4061
  useEffect(() => {
4054
4062
  if (registerConfig) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "1.25.6",
3
+ "version": "1.26.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Government of Alberta - React renderers for JSON Forms based on the design system.",
6
6
  "repository": "https://github.com/GovAlta/adsp-monorepo",